Lines Matching full:if
18 #if LV_USE_LZ4_EXTERNAL
22 #if LV_USE_LZ4_INTERNAL
68 #if LV_BIN_DECODER_RAM_LOAD
101 if(decoder == NULL) { in lv_bin_decoder_init()
121 if(src_type == LV_IMAGE_SRC_VARIABLE) { in lv_bin_decoder_info()
125 else if(src_type == LV_IMAGE_SRC_FILE) { in lv_bin_decoder_info()
127 if(lv_strcmp(lv_fs_get_ext(src), "bin")) return LV_RESULT_INVALID; in lv_bin_decoder_info()
133 if(res != LV_FS_RES_OK || rn != sizeof(lv_image_header_t)) { in lv_bin_decoder_info()
143 if(header->magic != LV_IMAGE_HEADER_MAGIC) { in lv_bin_decoder_info()
152 else if(src_type == LV_IMAGE_SRC_SYMBOL) { in lv_bin_decoder_info()
167 if(header->magic != LV_IMAGE_HEADER_MAGIC) { in lv_bin_decoder_info()
186 bool use_directly = false; /*If the image is already decoded and can be used directly*/ in lv_bin_decoder_open()
188 /*Open the file if it's a file*/ in lv_bin_decoder_open()
189 if(dsc->src_type == LV_IMAGE_SRC_FILE) { in lv_bin_decoder_open()
191 if(lv_strcmp(lv_fs_get_ext(dsc->src), "bin")) return LV_RESULT_INVALID; in lv_bin_decoder_open()
193 /*If the file was open successfully save the file descriptor*/ in lv_bin_decoder_open()
195 if(decoder_data == NULL) { in lv_bin_decoder_open()
201 if(f == NULL) { in lv_bin_decoder_open()
207 if(fs_res != LV_FS_RES_OK) { in lv_bin_decoder_open()
218 if(dsc->header.flags & LV_IMAGE_FLAGS_COMPRESSED) { in lv_bin_decoder_open()
221 else if(LV_COLOR_FORMAT_IS_INDEXED(cf)) { in lv_bin_decoder_open()
222 if(dsc->args.use_indexed) { in lv_bin_decoder_open()
230 else if(LV_COLOR_FORMAT_IS_ALPHA_ONLY(cf)) { in lv_bin_decoder_open()
233 #if LV_BIN_DECODER_RAM_LOAD in lv_bin_decoder_open()
234 else if(cf == LV_COLOR_FORMAT_ARGB8888 \ in lv_bin_decoder_open()
250 else if(dsc->src_type == LV_IMAGE_SRC_VARIABLE) { in lv_bin_decoder_open()
253 if(image->data == NULL) { in lv_bin_decoder_open()
258 if(dsc->header.flags & LV_IMAGE_FLAGS_COMPRESSED) { in lv_bin_decoder_open()
261 else if(LV_COLOR_FORMAT_IS_INDEXED(cf)) { in lv_bin_decoder_open()
264 if(decoder_data == NULL) { in lv_bin_decoder_open()
268 if(dsc->args.use_indexed) { in lv_bin_decoder_open()
271 … use_directly = true; /*If draw unit supports indexed image, it can be used directly.*/ in lv_bin_decoder_open()
277 else if(LV_COLOR_FORMAT_IS_ALPHA_ONLY(cf)) { in lv_bin_decoder_open()
278 if(cf == LV_COLOR_FORMAT_A8) { in lv_bin_decoder_open()
286 if(decoder_data == NULL) { in lv_bin_decoder_open()
299 if(image->header.flags & LV_IMAGE_FLAGS_ALLOCATED) { in lv_bin_decoder_open()
304 if(image->header.stride == 0) { in lv_bin_decoder_open()
305 /*If image doesn't have stride, treat it as lvgl v8 legacy image format*/ in lv_bin_decoder_open()
316 if(decoded->header.stride == 0) { in lv_bin_decoder_open()
326 if(res != LV_RESULT_OK) { in lv_bin_decoder_open()
331 if(dsc->decoded == NULL) return LV_RESULT_OK; /*Need to read via get_area_cb*/ in lv_bin_decoder_open()
334 if(dsc->header.flags & LV_IMAGE_FLAGS_PREMULTIPLIED) { in lv_bin_decoder_open()
339 if(adjusted == NULL) { in lv_bin_decoder_open()
345 if(adjusted != decoded) { in lv_bin_decoder_open()
353 …if(use_directly || dsc->args.no_cache) return LV_RESULT_OK; /*Do not put image to cache if it can … in lv_bin_decoder_open()
355 /*If the image cache is disabled, just return the decoded image*/ in lv_bin_decoder_open()
356 if(!lv_image_cache_is_enabled()) return LV_RESULT_OK; in lv_bin_decoder_open()
365 if(cache_entry == NULL) { in lv_bin_decoder_open()
381 if(decoder_data && decoder_data->decoded_partial) { in lv_bin_decoder_close()
395 /*Check if cf is supported*/ in lv_bin_decoder_get_area()
404 if(!supported) { in lv_bin_decoder_get_area()
411 if(decoder_data == NULL) { in lv_bin_decoder_get_area()
424 if(decoded_area->y1 == LV_COORD_MIN) { in lv_bin_decoder_get_area()
429 if(decoded == NULL) { in lv_bin_decoder_get_area()
430 if(decoder_data->decoded_partial != NULL) { in lv_bin_decoder_get_area()
435 if(decoded == NULL) return LV_RESULT_INVALID; in lv_bin_decoder_get_area()
449 if(decoded_area->y1 > full_area->y2) { in lv_bin_decoder_get_area()
453 if(LV_COLOR_FORMAT_IS_INDEXED(cf)) { in lv_bin_decoder_get_area()
461 if(dsc->src_type == LV_IMAGE_SRC_FILE) { in lv_bin_decoder_get_area()
464 if(buf == NULL) in lv_bin_decoder_get_area()
468 if(res != LV_FS_RES_OK) { in lv_bin_decoder_get_area()
480 if(dsc->src_type == LV_IMAGE_SRC_FILE) lv_free((void *)buf); in lv_bin_decoder_get_area()
486 …if(cf == LV_COLOR_FORMAT_ARGB8888 || cf == LV_COLOR_FORMAT_XRGB8888 || cf == LV_COLOR_FORMAT_RGB888 in lv_bin_decoder_get_area()
492 if(res != LV_FS_RES_OK) { in lv_bin_decoder_get_area()
500 if(cf == LV_COLOR_FORMAT_RGB565A8) { in lv_bin_decoder_get_area()
506 if(res != LV_FS_RES_OK) { in lv_bin_decoder_get_area()
516 if(res != LV_FS_RES_OK) { in lv_bin_decoder_get_area()
534 if(data == NULL) { in get_decoder_data()
537 if(data == NULL) { in get_decoder_data()
551 if(decoder_data == NULL) return; in free_decoder_data()
553 if(decoder_data->f) { in free_decoder_data()
558 if(decoder_data->decoded) lv_draw_buf_destroy(decoder_data->decoded); in free_decoder_data()
559 if(decoder_data->decompressed) lv_draw_buf_destroy(decoder_data->decompressed); in free_decoder_data()
580 if(is_compressed) { in decode_indexed()
585 else if(dsc->src_type == LV_IMAGE_SRC_FILE) { in decode_indexed()
589 if(palette == NULL) { in decode_indexed()
595 if(res != LV_FS_RES_OK || rn != palette_len) { in decode_indexed()
603 #if LV_BIN_DECODER_RAM_LOAD in decode_indexed()
606 if(draw_buf_indexed == NULL) { in decode_indexed()
614 if(lv_fs_seek(f, 0, LV_FS_SEEK_END) != LV_FS_RES_OK || in decode_indexed()
623 if(res != LV_FS_RES_OK || rn != data_len) { in decode_indexed()
629 else if(dsc->src_type == LV_IMAGE_SRC_VARIABLE) { in decode_indexed()
641 #if LV_BIN_DECODER_RAM_LOAD in decode_indexed()
646 if(decoded == NULL) { in decode_indexed()
664 if(dsc->src_type == LV_IMAGE_SRC_FILE && !is_compressed) { in decode_indexed()
671 if(dsc->src_type == LV_IMAGE_SRC_FILE && !is_compressed) { in decode_indexed()
676 if(draw_buf_indexed) lv_draw_buf_destroy(draw_buf_indexed); in decode_indexed()
689 #if LV_BIN_DECODER_RAM_LOAD == 0 in load_indexed()
702 if(dsc->header.flags & LV_IMAGE_FLAGS_COMPRESSED) { in load_indexed()
712 if(dsc->src_type == LV_IMAGE_SRC_VARIABLE) { in load_indexed()
715 if(image->header.flags & LV_IMAGE_FLAGS_ALLOCATED) { in load_indexed()
725 if(decoded->header.stride == 0) { in load_indexed()
733 if(dsc->src_type == LV_IMAGE_SRC_FILE) { in load_indexed()
738 if(decoded == NULL) { in load_indexed()
746 if(res != LV_FS_RES_OK || rn != palette_len) { in load_indexed()
753 if(lv_fs_seek(f, 0, LV_FS_SEEK_END) != LV_FS_RES_OK || in load_indexed()
764 if(res != LV_FS_RES_OK || rn != data_len) { in load_indexed()
780 #if LV_BIN_DECODER_RAM_LOAD
790 if(cf == LV_COLOR_FORMAT_RGB565A8) { in decode_rgb()
796 if(decoded == NULL) { in decode_rgb()
805 if(res != LV_FS_RES_OK || rn != len) { in decode_rgb()
822 if(value == 0) return 0; in bit_extend()
849 if(decoded == NULL) { in decode_alpha_only()
856 if(dsc->header.flags & LV_IMAGE_FLAGS_COMPRESSED) { in decode_alpha_only()
860 else if(dsc->src_type == LV_IMAGE_SRC_FILE) { in decode_alpha_only()
862 if(res != LV_FS_RES_OK || rn != file_len) { in decode_alpha_only()
868 else if(dsc->src_type == LV_IMAGE_SRC_VARIABLE) { in decode_alpha_only()
873 if(dsc->header.cf != LV_COLOR_FORMAT_A8) { in decode_alpha_only()
892 if(shift >= 8) { in decode_alpha_only()
907 #if LV_BIN_DECODER_RAM_LOAD in decode_compressed()
919 if(dsc->src_type == LV_IMAGE_SRC_FILE) { in decode_compressed()
922 if(lv_fs_seek(f, 0, LV_FS_SEEK_END) != LV_FS_RES_OK || in decode_compressed()
934 if(fs_res != LV_FS_RES_OK || rn != len) { in decode_compressed()
939 if(compressed->compressed_size != compressed_len) { in decode_compressed()
945 if(file_buf == NULL) { in decode_compressed()
953 if(fs_res != LV_FS_RES_OK || rn != compressed_len) { in decode_compressed()
962 else if(dsc->src_type == LV_IMAGE_SRC_VARIABLE) { in decode_compressed()
971 if(compressed->compressed_size != compressed_len) { in decode_compressed()
984 if(res != LV_RESULT_OK) { in decode_compressed()
991 if(image->data == NULL) { in decode_compressed()
996 if(LV_COLOR_FORMAT_IS_INDEXED(cf)) { in decode_compressed()
997 if(dsc->args.use_indexed) res = load_indexed(decoder, dsc); in decode_compressed()
1000 else if(LV_COLOR_FORMAT_IS_ALPHA_ONLY(cf)) { in decode_compressed()
1063 if(shift < 0) { in decode_indexed_line()
1074 if(br) *br = 0; in fs_read_file_at()
1077 if(res != LV_FS_RES_OK) { in fs_read_file_at()
1082 if(res != LV_FS_RES_OK) { in fs_read_file_at()
1093 if(decoder_data == NULL) { in decompress_image()
1106 if(decompressed == NULL) { in decompress_image()
1111 if(out_len > decompressed->data_size) { in decompress_image()
1119 if(compressed->method == LV_IMAGE_COMPRESS_RLE) { in decompress_image()
1120 #if LV_USE_RLE in decompress_image()
1123 if(dsc->header.cf == LV_COLOR_FORMAT_RGB565A8) in decompress_image()
1131 if(len != compressed->decompressed_size) { in decompress_image()
1142 else if(compressed->method == LV_IMAGE_COMPRESS_LZ4) { in decompress_image()
1143 #if LV_USE_LZ4 in decompress_image()
1148 if(len < 0 || (uint32_t)len != compressed->decompressed_size) { in decompress_image()