mirror of
https://github.com/google/pebble.git
synced 2025-04-30 23:31:40 -04:00
spelling: palettized
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
This commit is contained in:
parent
bd132b4003
commit
3343c3a8b6
2 changed files with 7 additions and 7 deletions
|
@ -127,13 +127,13 @@ T_STATIC GColor get_bitmap_color(GBitmap *bmp, int x, int y) {
|
||||||
0, // y = 0 when using data_row
|
0, // y = 0 when using data_row
|
||||||
bmp->row_size_bytes,
|
bmp->row_size_bytes,
|
||||||
src_bpp);
|
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};
|
GColor src_color = (GColor){.argb = cindex};
|
||||||
bool palletized = ((format == GBitmapFormat1BitPalette) ||
|
bool palettized = ((format == GBitmapFormat1BitPalette) ||
|
||||||
(format == GBitmapFormat2BitPalette) ||
|
(format == GBitmapFormat2BitPalette) ||
|
||||||
(format == GBitmapFormat4BitPalette));
|
(format == GBitmapFormat4BitPalette));
|
||||||
if (palletized) {
|
if (palettized) {
|
||||||
// Look up color in palette if palletized
|
// Look up color in palette if palettized
|
||||||
const GColor *palette = bmp->palette;
|
const GColor *palette = bmp->palette;
|
||||||
src_color = palette[cindex];
|
src_color = palette[cindex];
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
strncpy(ext, EXPECTED_PBI_FILE_EXTENSION, strlen(EXPECTED_PBI_FILE_EXTENSION) + 1);
|
||||||
cl_assert(tests_write_gbitmap_to_pbi(expected_bmp, bmp_filename));
|
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) {
|
if (actual_bmp->info.format == GBitmapFormat8Bit && diff_bmp) {
|
||||||
// Only write the diff file if there is an expected image
|
// Only write the diff file if there is an expected image
|
||||||
strncpy(bmp_filename, filename, PATH_STRING_LENGTH - strlen(DIFF_PBI_FILE_EXTENSION) - 1);
|
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) {
|
for (int y = start_y; y < end_y; ++y) {
|
||||||
uint8_t *line = ((uint8_t*)diff_bmp->addr) + (diff_bmp->row_size_bytes * 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) {
|
if (actual_bmp->info.format == GBitmapFormat8Bit) {
|
||||||
line[(diff_bmp->row_size_bytes / 3) + 1] = GColorClear.argb; // Separator pixel between images
|
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
|
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;
|
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->info.format == GBitmapFormat8Bit) {
|
||||||
if (actual_bmp_color.argb != expected_bmp_color.argb) {
|
if (actual_bmp_color.argb != expected_bmp_color.argb) {
|
||||||
GColor8 diff_bmp_color = DIFF_COLOR;
|
GColor8 diff_bmp_color = DIFF_COLOR;
|
||||||
|
|
Loading…
Add table
Reference in a new issue