diff --git a/src/fw/applib/graphics/graphics_bitmap.c b/src/fw/applib/graphics/graphics_bitmap.c index 0ecff344..0678e10a 100644 --- a/src/fw/applib/graphics/graphics_bitmap.c +++ b/src/fw/applib/graphics/graphics_bitmap.c @@ -127,13 +127,13 @@ T_STATIC GColor get_bitmap_color(GBitmap *bmp, int x, int y) { 0, // y = 0 when using data_row bmp->row_size_bytes, src_bpp); - // Default color to be the raw color index - update only if palletized + // Default color to be the raw color index - update only if palettized GColor src_color = (GColor){.argb = cindex}; - bool palletized = ((format == GBitmapFormat1BitPalette) || + bool palettized = ((format == GBitmapFormat1BitPalette) || (format == GBitmapFormat2BitPalette) || (format == GBitmapFormat4BitPalette)); - if (palletized) { - // Look up color in palette if palletized + if (palettized) { + // Look up color in palette if palettized const GColor *palette = bmp->palette; src_color = palette[cindex]; } diff --git a/tests/fw/graphics/util.h b/tests/fw/graphics/util.h index 6eae7291..9f6538b8 100644 --- a/tests/fw/graphics/util.h +++ b/tests/fw/graphics/util.h @@ -238,7 +238,7 @@ static void prv_write_diff_to_file(const char *filename, GBitmap *expected_bmp, strncpy(ext, EXPECTED_PBI_FILE_EXTENSION, strlen(EXPECTED_PBI_FILE_EXTENSION) + 1); cl_assert(tests_write_gbitmap_to_pbi(expected_bmp, bmp_filename)); - // TODO: PBL-20932 Add 1-bit and palletized support + // TODO: PBL-20932 Add 1-bit and palettized support if (actual_bmp->info.format == GBitmapFormat8Bit && diff_bmp) { // Only write the diff file if there is an expected image strncpy(bmp_filename, filename, PATH_STRING_LENGTH - strlen(DIFF_PBI_FILE_EXTENSION) - 1); @@ -306,7 +306,7 @@ bool gbitmap_eq(GBitmap *actual_bmp, GBitmap *expected_bmp, const char *filename for (int y = start_y; y < end_y; ++y) { uint8_t *line = ((uint8_t*)diff_bmp->addr) + (diff_bmp->row_size_bytes * y); - // TODO: PBL-20932 Add 1-bit and palletized support + // TODO: PBL-20932 Add 1-bit and palettized support if (actual_bmp->info.format == GBitmapFormat8Bit) { line[(diff_bmp->row_size_bytes / 3) + 1] = GColorClear.argb; // Separator pixel between images line[(2 * diff_bmp->row_size_bytes / 3) + 1] = GColorClear.argb; // Separator pixel between images @@ -346,7 +346,7 @@ bool gbitmap_eq(GBitmap *actual_bmp, GBitmap *expected_bmp, const char *filename rc = false; } - // TODO: PBL-20932 Add 1-bit and palletized support + // TODO: PBL-20932 Add 1-bit and palettized support if (actual_bmp->info.format == GBitmapFormat8Bit) { if (actual_bmp_color.argb != expected_bmp_color.argb) { GColor8 diff_bmp_color = DIFF_COLOR;