1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

chore(libs/png): rename lv_png to lv_lodepng (#4574)

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
Co-authored-by: pengyiqiang <pengyiqiang@xiaomi.com>
This commit is contained in:
_VIFEXTech 2023-09-20 16:30:04 +08:00 committed by GitHub
parent f77cacd1b7
commit 45fb2148d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 59 additions and 59 deletions

View File

@ -627,8 +627,8 @@
#define LV_FS_FATFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*PNG decoder library*/
#define LV_USE_PNG 0
/*LODEPNG decoder library*/
#define LV_USE_LODEPNG 0
/*BMP decoder library*/
#define LV_USE_BMP 0

View File

@ -1020,7 +1020,7 @@ menu "LVGL configuration"
default 0
depends on LV_USE_FS_FATFS
config LV_USE_PNG
config LV_USE_LODEPNG
bool "PNG decoder library"
config LV_USE_BMP

View File

@ -9,7 +9,7 @@
fs
bmp
sjpg
png
lodepng
gif
freetype
tiny_ttf

View File

@ -1,11 +1,11 @@
===========
PNG decoder
===========
===============
LODEPNG decoder
===============
Allow the use of PNG images in LVGL. This implementation uses
`lodepng <https://github.com/lvandeve/lodepng>`__ library.
If enabled in ``lv_conf.h`` by :c:macro:`LV_USE_PNG` LVGL will register a new
If enabled in ``lv_conf.h`` by :c:macro:`LV_USE_LODEPNG` LVGL will register a new
image decoder automatically so PNG files can be directly used as any
other image sources.
@ -21,7 +21,7 @@ As it might take significant time to decode PNG images LVGL's :ref:`image-cachin
Example
-------
.. include:: ../examples/libs/png/index.rst
.. include:: ../examples/libs/lodepng/index.rst
API
---

View File

@ -479,8 +479,8 @@
<file category="sourceC" name="src/libs/fsdrv/lv_fs_win32.c" />
<file category="sourceC" name="src/libs/freetype/lv_freetype.c" />
<file category="sourceC" name="src/libs/ffmpeg/lv_ffmpeg.c" />
<file category="sourceC" name="src/libs/png/lv_png.c" />
<file category="sourceC" name="src/libs/png/lodepng.c" />
<file category="sourceC" name="src/libs/lodepng/lv_lodepng.c" />
<file category="sourceC" name="src/libs/lodepng/lodepng.c" />
<file category="sourceC" name="src/libs/gif/gifdec.c" />
<file category="sourceC" name="src/libs/gif/lv_gif.c" />
<file category="sourceC" name="src/libs/rlottie/lv_rlottie.c" />
@ -706,14 +706,14 @@
<description>Add PNG support</description>
<files>
<!-- src/libs/png -->
<file category="sourceC" name="src/libs/png/lodepng.c" />
<file category="sourceC" name="src/libs/png/lv_png.c" />
<file category="sourceC" name="src/libs/lodepng/lodepng.c" />
<file category="sourceC" name="src/libs/lodepng/lv_lodepng.c" />
</files>
<RTE_Components_h>
/*! \brief enable PNG support */
#define LV_USE_PNG 1
#define LV_USE_LODEPNG 1
</RTE_Components_h>
</component>

View File

@ -151,7 +151,7 @@ Make sure `LV_MEM_SIZE` is no less than `(64*1024U)`.
- \#define LV_USE_FS_POSIX 0
- \#define LV_USE_FS_WIN32 0
- \#define LV_USE_FS_FATFS 0
- \#define LV_USE_PNG 0
- \#define LV_USE_LODEPNG 0
- \#define LV_USE_BMP 0
- \#define LV_USE_SJPG 0
- \#define LV_USE_GIF 0

View File

@ -1,5 +1,5 @@
#include "../../../lvgl.h"
#if LV_USE_PNG && LV_BUILD_EXAMPLES
#if LV_USE_LODEPNG && LV_BUILD_EXAMPLES
#ifndef LV_ATTRIBUTE_MEM_ALIGN
@ -345,4 +345,4 @@ const lv_image_dsc_t img_wink_png = {
.data = img_wink_png_map,
};
#endif /*LV_USE_PNG && LV_BUILD_EXAMPLES*/
#endif /*LV_USE_LODEPNG && LV_BUILD_EXAMPLES*/

View File

@ -1,6 +1,6 @@
Open a PNG image from file and variable
---------------------------------------
.. lv_example:: libs/png/lv_example_png_1
.. lv_example:: libs/lodepng/lv_example_png_1
:language: c

View File

@ -1,5 +1,5 @@
/**
* @file lv_example_png.h
* @file lv_example_lodepng.h
*
*/
@ -25,7 +25,7 @@ extern "C" {
/**********************
* GLOBAL PROTOTYPES
**********************/
void lv_example_png_1(void);
void lv_example_lodepng_1(void);
/**********************
* MACROS

View File

@ -1,10 +1,10 @@
#include "../../lv_examples.h"
#if LV_USE_PNG && LV_USE_IMG && LV_BUILD_EXAMPLES
#if LV_USE_LODEPNG && LV_USE_IMG && LV_BUILD_EXAMPLES
/**
* Open a PNG image from a file and a variable
*/
void lv_example_png_1(void)
void lv_example_lodepng_1(void)
{
LV_IMAGE_DECLARE(img_wink_png);
lv_obj_t * img;
@ -16,7 +16,7 @@ void lv_example_png_1(void)
img = lv_image_create(lv_scr_act());
/* Assuming a File system is attached to letter 'A'
* E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */
lv_image_set_src(img, "A:lvgl/examples/libs/png/wink.png");
lv_image_set_src(img, "A:lvgl/examples/libs/lodepng/wink.png");
lv_obj_align(img, LV_ALIGN_RIGHT_MID, -20, 0);
}

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@ -18,7 +18,7 @@ extern "C" {
#include "ffmpeg/lv_example_ffmpeg.h"
#include "freetype/lv_example_freetype.h"
#include "gif/lv_example_gif.h"
#include "png/lv_example_png.h"
#include "lodepng/lv_example_lodepng.h"
#include "qrcode/lv_example_qrcode.h"
#include "rlottie/lv_example_rlottie.h"
#include "jpg/lv_example_jpg.h"

View File

@ -22,7 +22,7 @@ static const void * get_imgfont_path(const lv_font_t * font, uint32_t unicode, u
else if(unicode == 0xF600) {
#if LV_USE_FFMPEG
return "lvgl/examples/assets/emoji/F600.png";
#elif LV_USE_PNG
#elif LV_USE_LODEPNG
return "A:lvgl/examples/assets/emoji/F600.png";
#endif
}

View File

@ -248,7 +248,7 @@
#endif
/*Default cache size in bytes.
*Used by image decoders such as `lv_png` to keep the decoded image in the memory.
*Used by image decoders such as `lv_lodepng` to keep the decoded image in the memory.
*Data larger than the size of the cache also can be allocated but
*will be dropped immediately after usage.*/
#define LV_CACHE_DEF_SIZE 0
@ -575,8 +575,8 @@
#define LV_FS_MEMFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#endif
/*PNG decoder library*/
#define LV_USE_PNG 0
/*LODEPNG decoder library*/
#define LV_USE_LODEPNG 0
/*BMP decoder library*/
#define LV_USE_BMP 0

2
lvgl.h
View File

@ -92,7 +92,7 @@ extern "C" {
#include "src/libs/barcode/lv_barcode.h"
#include "src/libs/bmp/lv_bmp.h"
#include "src/libs/fsdrv/lv_fsdrv.h"
#include "src/libs/png/lv_png.h"
#include "src/libs/lodepng/lv_lodepng.h"
#include "src/libs/gif/lv_gif.h"
#include "src/libs/qrcode/lv_qrcode.h"
#include "src/libs/jpg/lv_jpg.h"

View File

@ -32,8 +32,8 @@
--exclude=../src/core/lv_obj_style_gen.h
--exclude=../src/extra/libs/gif/gifdec.c
--exclude=../src/extra/libs/gif/gifdec.h
--exclude=../src/extra/libs/png/lodepng.c
--exclude=../src/extra/libs/png/lodepng.h
--exclude=../src/extra/libs/lodepng/lodepng.c
--exclude=../src/extra/libs/lodepng/lodepng.h
--exclude=../src/extra/libs/qrcode/qrcodegen.c
--exclude=../src/extra/libs/qrcode/qrcodegen.h
--exclude=../src/extra/libs/sjpg/tjpgd.c

View File

@ -29,7 +29,7 @@ Rename this file to lodepng.cpp to use it for C++, or to lodepng.c to use it for
*/
#include "lodepng.h"
#if LV_USE_PNG
#if LV_USE_LODEPNG
#ifdef LODEPNG_COMPILE_DISK
#include <limits.h> /* LONG_MAX */
@ -7039,4 +7039,4 @@ unsigned encode(const std::string & filename,
} /* namespace lodepng */
#endif /*LODEPNG_COMPILE_CPP*/
#endif /*LV_USE_PNG*/
#endif /*LV_USE_LODEPNG*/

View File

@ -29,7 +29,7 @@ freely, subject to the following restrictions:
#include <string.h> /*for size_t*/
#include "../../../lvgl.h"
#if LV_USE_PNG
#if LV_USE_LODEPNG
extern const char * LODEPNG_VERSION_STRING;
/*
@ -1090,7 +1090,7 @@ TODO:
[X] provide alternatives for C library functions not present on some platforms (memcpy, ...)
*/
#endif /*LV_USE_PNG*/
#endif /*LV_USE_LODEPNG*/
#endif /*LODEPNG_H inclusion guard*/

View File

@ -1,5 +1,5 @@
/**
* @file lv_png.c
* @file lv_lodepng.c
*
*/
@ -7,9 +7,9 @@
* INCLUDES
*********************/
#include "../../../lvgl.h"
#if LV_USE_PNG
#if LV_USE_LODEPNG
#include "lv_png.h"
#include "lv_lodepng.h"
#include "lodepng.h"
#include <stdlib.h>
@ -46,7 +46,7 @@ static lv_result_t try_cache(lv_image_decoder_dsc_t * dsc);
/**
* Register the PNG decoder functions in LVGL
*/
void lv_png_init(void)
void lv_lodepng_init(void)
{
lv_image_decoder_t * dec = lv_image_decoder_create();
lv_image_decoder_set_info_cb(dec, decoder_info);
@ -283,6 +283,6 @@ static void convert_color_depth(uint8_t * img_p, uint32_t px_cnt)
}
}
#endif /*LV_USE_PNG*/
#endif /*LV_USE_LODEPNG*/

View File

@ -1,10 +1,10 @@
/**
* @file lv_png.h
* @file lv_lodepng.h
*
*/
#ifndef LV_PNG_H
#define LV_PNG_H
#ifndef LV_LODEPNG_H
#define LV_LODEPNG_H
#ifdef __cplusplus
extern "C" {
@ -14,7 +14,7 @@ extern "C" {
* INCLUDES
*********************/
#include "../../lv_conf_internal.h"
#if LV_USE_PNG
#if LV_USE_LODEPNG
/*********************
* DEFINES
@ -31,16 +31,16 @@ extern "C" {
/**
* Register the PNG decoder functions in LVGL
*/
void lv_png_init(void);
void lv_lodepng_init(void);
/**********************
* MACROS
**********************/
#endif /*LV_USE_PNG*/
#endif /*LV_USE_LODEPNG*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_PNG_H*/
#endif /*LV_LODEPNG_H*/

View File

@ -690,7 +690,7 @@
#endif
/*Default cache size in bytes.
*Used by image decoders such as `lv_png` to keep the decoded image in the memory.
*Used by image decoders such as `lv_lodepng` to keep the decoded image in the memory.
*Data larger than the size of the cache also can be allocated but
*will be dropped immediately after usage.*/
#ifndef LV_CACHE_DEF_SIZE
@ -1937,12 +1937,12 @@
#endif
#endif
/*PNG decoder library*/
#ifndef LV_USE_PNG
#ifdef CONFIG_LV_USE_PNG
#define LV_USE_PNG CONFIG_LV_USE_PNG
/*LODEPNG decoder library*/
#ifndef LV_USE_LODEPNG
#ifdef CONFIG_LV_USE_LODEPNG
#define LV_USE_LODEPNG CONFIG_LV_USE_LODEPNG
#else
#define LV_USE_PNG 0
#define LV_USE_LODEPNG 0
#endif
#endif

View File

@ -16,7 +16,7 @@
#include "libs/freetype/lv_freetype.h"
#include "libs/fsdrv/lv_fsdrv.h"
#include "libs/gif/lv_gif.h"
#include "libs/png/lv_png.h"
#include "libs/lodepng/lv_lodepng.h"
#include "libs/jpg/lv_jpg.h"
#include "draw/lv_draw.h"
#include "misc/lv_cache.h"
@ -215,8 +215,8 @@ void lv_init(void)
lv_fs_memfs_init();
#endif
#if LV_USE_PNG
lv_png_init();
#if LV_USE_LODEPNG
lv_lodepng_init();
#endif
#if LV_USE_JPG

View File

@ -61,7 +61,7 @@
#define LV_USE_FS_MEMFS 1
#define LV_FS_MEMFS_LETTER 'M'
#define LV_USE_PNG 1
#define LV_USE_LODEPNG 1
#define LV_USE_BMP 1
#define LV_USE_JPG 1
#define LV_USE_GIF 1

View File

@ -16,7 +16,7 @@
#define LV_USE_THEME_BASIC 1
#define LV_USE_THEME_DEFAULT 0
#define LV_USE_PNG 1
#define LV_USE_LODEPNG 1
#define LV_USE_BMP 1
#define LV_USE_GIF 1
#define LV_USE_QRCODE 1

View File

@ -39,7 +39,7 @@ static void create_images(void)
lv_obj_align(label, LV_ALIGN_CENTER, 100, 20);
}
void test_png_1(void)
void test_lodepng_1(void)
{
create_images();