mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Fix reading RGB 24-bit images
This commit is contained in:
parent
ee5d704016
commit
63eafdab6b
@ -135,10 +135,10 @@ void bmp_read_pixels(FIL *fp, image_t *img, int n_lines, bmp_read_settings_t *rs
|
|||||||
} else if (rs->bmp_bpp == 24) {
|
} else if (rs->bmp_bpp == 24) {
|
||||||
for (int i = 0; i < n_lines; i++) {
|
for (int i = 0; i < n_lines; i++) {
|
||||||
for (int j = 0, jj = rs->bmp_row_bytes / 3; j < jj; j++) {
|
for (int j = 0, jj = rs->bmp_row_bytes / 3; j < jj; j++) {
|
||||||
uint8_t r, g, b;
|
uint8_t b, g, r;
|
||||||
read_byte(fp, &r);
|
|
||||||
read_byte(fp, &g);
|
|
||||||
read_byte(fp, &b);
|
read_byte(fp, &b);
|
||||||
|
read_byte(fp, &g);
|
||||||
|
read_byte(fp, &r);
|
||||||
uint16_t pixel = IM_RGB565(IM_R825(r), IM_G826(g), IM_B825(b));
|
uint16_t pixel = IM_RGB565(IM_R825(r), IM_G826(g), IM_B825(b));
|
||||||
if (j < img->w) {
|
if (j < img->w) {
|
||||||
if (rs->bmp_h < 0) { // vertical flip
|
if (rs->bmp_h < 0) { // vertical flip
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user