summaryrefslogtreecommitdiff
path: root/core/fxcodec/lbmp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcodec/lbmp')
-rw-r--r--core/fxcodec/lbmp/fx_bmp.cpp20
-rw-r--r--core/fxcodec/lbmp/fx_bmp.h14
2 files changed, 17 insertions, 17 deletions
diff --git a/core/fxcodec/lbmp/fx_bmp.cpp b/core/fxcodec/lbmp/fx_bmp.cpp
index b7f20666d8..9105c6ed9c 100644
--- a/core/fxcodec/lbmp/fx_bmp.cpp
+++ b/core/fxcodec/lbmp/fx_bmp.cpp
@@ -105,7 +105,7 @@ int32_t bmp_read_header(bmp_decompress_struct_p bmp_ptr) {
bmp_ptr->bitCounts =
GetWord_LSBFirst((uint8_t*)&bmp_core_header_ptr->bcBitCount);
bmp_ptr->compress_flag = BMP_RGB;
- bmp_ptr->imgTB_flag = FALSE;
+ bmp_ptr->imgTB_flag = false;
} break;
case kBmpInfoHeaderSize: {
BmpInfoHeaderPtr bmp_info_header_ptr = nullptr;
@@ -130,7 +130,7 @@ int32_t bmp_read_header(bmp_decompress_struct_p bmp_ptr) {
(uint8_t*)&bmp_info_header_ptr->biYPelsPerMeter);
if (bmp_ptr->height < 0) {
bmp_ptr->height = -bmp_ptr->height;
- bmp_ptr->imgTB_flag = TRUE;
+ bmp_ptr->imgTB_flag = true;
}
} break;
default: {
@@ -160,7 +160,7 @@ int32_t bmp_read_header(bmp_decompress_struct_p bmp_ptr) {
(uint8_t*)&bmp_info_header_ptr->biYPelsPerMeter);
if (bmp_ptr->height < 0) {
bmp_ptr->height = -bmp_ptr->height;
- bmp_ptr->imgTB_flag = TRUE;
+ bmp_ptr->imgTB_flag = true;
}
if (bmp_ptr->compress_flag == BMP_RGB && biPlanes == 1 &&
bmp_ptr->color_used == 0) {
@@ -390,7 +390,7 @@ int32_t bmp_decode_rle8(bmp_decompress_struct_p bmp_ptr) {
uint8_t* first_byte_ptr = nullptr;
uint8_t* second_byte_ptr = nullptr;
bmp_ptr->col_num = 0;
- while (TRUE) {
+ while (true) {
uint32_t skip_size_org = bmp_ptr->skip_size;
if (!bmp_read_data(bmp_ptr, &first_byte_ptr, 1))
return 2;
@@ -492,7 +492,7 @@ int32_t bmp_decode_rle4(bmp_decompress_struct_p bmp_ptr) {
uint8_t* first_byte_ptr = nullptr;
uint8_t* second_byte_ptr = nullptr;
bmp_ptr->col_num = 0;
- while (TRUE) {
+ while (true) {
uint32_t skip_size_org = bmp_ptr->skip_size;
if (!bmp_read_data(bmp_ptr, &first_byte_ptr, 1))
return 2;
@@ -896,9 +896,9 @@ static void bmp_encode_rle4(bmp_compress_struct_p bmp_ptr,
dst_buf[dst_pos++] = RLE_EOI;
dst_size = dst_pos;
}
-FX_BOOL bmp_encode_image(bmp_compress_struct_p bmp_ptr,
- uint8_t*& dst_buf,
- uint32_t& dst_size) {
+bool bmp_encode_image(bmp_compress_struct_p bmp_ptr,
+ uint8_t*& dst_buf,
+ uint32_t& dst_size) {
uint32_t head_size = sizeof(BmpFileHeader) + sizeof(BmpInfoHeader);
uint32_t pal_size = sizeof(uint32_t) * bmp_ptr->pal_num;
if (bmp_ptr->info_header.biClrUsed > 0 &&
@@ -908,7 +908,7 @@ FX_BOOL bmp_encode_image(bmp_compress_struct_p bmp_ptr,
dst_size = head_size + sizeof(uint32_t) * bmp_ptr->pal_num;
dst_buf = FX_TryAlloc(uint8_t, dst_size);
if (!dst_buf)
- return FALSE;
+ return false;
FXSYS_memset(dst_buf, 0, dst_size);
bmp_ptr->file_header.bfOffBits = head_size;
@@ -935,5 +935,5 @@ FX_BOOL bmp_encode_image(bmp_compress_struct_p bmp_ptr,
}
bmp_ptr->file_header.bfSize = dst_size;
WriteFileHeader(&bmp_ptr->file_header, dst_buf);
- return TRUE;
+ return true;
}
diff --git a/core/fxcodec/lbmp/fx_bmp.h b/core/fxcodec/lbmp/fx_bmp.h
index dfaf2859ef..27a0f19970 100644
--- a/core/fxcodec/lbmp/fx_bmp.h
+++ b/core/fxcodec/lbmp/fx_bmp.h
@@ -84,7 +84,7 @@ struct tag_bmp_decompress_struct {
uint8_t* out_row_buffer;
uint16_t bitCounts;
uint32_t color_used;
- FX_BOOL imgTB_flag;
+ bool imgTB_flag;
int32_t pal_num;
int32_t pal_type;
uint32_t* pal_ptr;
@@ -99,8 +99,8 @@ struct tag_bmp_decompress_struct {
uint32_t mask_green;
uint32_t mask_blue;
- FX_BOOL (*bmp_get_data_position_fn)(bmp_decompress_struct_p bmp_ptr,
- uint32_t cur_pos);
+ bool (*bmp_get_data_position_fn)(bmp_decompress_struct_p bmp_ptr,
+ uint32_t cur_pos);
void (*bmp_get_row_fn)(bmp_decompress_struct_p bmp_ptr,
int32_t row_num,
uint8_t* row_buf);
@@ -137,7 +137,7 @@ struct tag_bmp_compress_struct {
uint32_t src_row;
uint8_t src_bpp;
uint32_t src_width;
- FX_BOOL src_free;
+ bool src_free;
uint32_t* pal_ptr;
uint16_t pal_num;
uint8_t bit_type;
@@ -145,9 +145,9 @@ struct tag_bmp_compress_struct {
bmp_compress_struct_p bmp_create_compress();
void bmp_destroy_compress(bmp_compress_struct_p bmp_ptr);
-FX_BOOL bmp_encode_image(bmp_compress_struct_p bmp_ptr,
- uint8_t*& dst_buf,
- uint32_t& dst_size);
+bool bmp_encode_image(bmp_compress_struct_p bmp_ptr,
+ uint8_t*& dst_buf,
+ uint32_t& dst_size);
uint16_t GetWord_LSBFirst(uint8_t* p);
void SetWord_LSBFirst(uint8_t* p, uint16_t v);