All Projects → lvgl → lv_lib_split_jpg

lvgl / lv_lib_split_jpg

Licence: MIT license
JPG decoder for LVGL

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to lv lib split jpg

lv lib rlottie
Lottie animation support for LVGL
Stars: ✭ 16 (-27.27%)
Mutual labels:  embedded, lvgl
mish
A no-std libm implementation in Rust
Stars: ✭ 14 (-36.36%)
Mutual labels:  embedded
arm synth
Wavetable Synth Running on an STM32F 32-bit ARM Cortex M3 microprocessor
Stars: ✭ 23 (+4.55%)
Mutual labels:  embedded
lwjson
Lightweight JSON parser for embedded systems
Stars: ✭ 66 (+200%)
Mutual labels:  embedded
FreeRTOS-rust
Rust crate for FreeRTOS
Stars: ✭ 159 (+622.73%)
Mutual labels:  embedded
bacnet-stack
BACnet Protocol Stack library provides a BACnet application layer, network layer and media access (MAC) layer communications services.
Stars: ✭ 199 (+804.55%)
Mutual labels:  embedded
rust-sysfs-pwm
Linux PWM Access via Sysfs in Rust
Stars: ✭ 42 (+90.91%)
Mutual labels:  embedded
micropython-micropower
Support for building ultra low power systems based on the Pyboard (1.x and D series).
Stars: ✭ 44 (+100%)
Mutual labels:  embedded
rauc-hawkbit-updater
The RAUC hawkBit updater is a simple commandline tool/daemon that runs on your target and interfaces between RAUC and hawkBit's DDI API.
Stars: ✭ 40 (+81.82%)
Mutual labels:  embedded
pumbaa
Python on Simba.
Stars: ✭ 61 (+177.27%)
Mutual labels:  embedded
zephyr-rtos-tutorial
Zephyr tutorial for beginners
Stars: ✭ 94 (+327.27%)
Mutual labels:  embedded
uevloop
A fast and lightweight event loop for embedded platforms.
Stars: ✭ 61 (+177.27%)
Mutual labels:  embedded
libDaisy
Hardware Library for the Daisy Audio Platform
Stars: ✭ 164 (+645.45%)
Mutual labels:  embedded
Embedded UKF Library
A compact Unscented Kalman Filter (UKF) library for Teensy4/Arduino system (or any real time embedded system in general)
Stars: ✭ 31 (+40.91%)
Mutual labels:  embedded
w1-gpio-cl
Command line configured kernel mode 1-wire bus master driver. w1-gpio standard Linux module enhancement/substitution.
Stars: ✭ 17 (-22.73%)
Mutual labels:  embedded
cowl
A lightweight C/C++ library for working with Web Ontology Language (OWL) ontologies
Stars: ✭ 18 (-18.18%)
Mutual labels:  embedded
libe4
C library of Teserakt's E4 end-to-end security protocol
Stars: ✭ 15 (-31.82%)
Mutual labels:  embedded
openncc
OpenNCC Kit
Stars: ✭ 23 (+4.55%)
Mutual labels:  embedded
tensorflow-on-orangepi-zero
Tensorflow for Orange PI Zero
Stars: ✭ 16 (-27.27%)
Mutual labels:  embedded
dockage
embedded document/json store
Stars: ✭ 20 (-9.09%)
Mutual labels:  embedded

JPG decoder for LVGL

This repository is merged into the lvgl repository. See https://docs.lvgl.io/master/libs/sjpg.html

Status

Overview

  • lv_lib_split_jpg supports both normal jpg and the custom sjpg formats.
  • Decoding normal jpg consumes RAM with the site fo the whole uncompressed image (recommended only for devices with more RAM)
  • sjpg is a custom format based on "normal" JPG and specially made for lvgl.
  • sjpg is 'split-jpeg' which is a bundle of small jpeg fragments with an sjpg header.
  • sjpg size will be almost comparable to the jpg file or might be a slightly larger.
  • lv_sjpg can open and handle multiple files at same time.
  • File read from disk (fread) and c-array is implemented.
  • SJPEG frame fragment cache enables fast fetching of lines if availble in cache.
  • By default the sjpg image cache will be xres * 2 * 16 bytes (can be modified)
  • Currently only 16 bit image format is supported (to do)

Getting started

  • Clone this repository next to lvgl with git clone https://github.com/lvgl/lv_lib_split_jpg.git
  • If you need to open (S)JPG files use lv_fs_if or add your own file system drivers.
    • With lv_fs_if add these line to the end of lv_conf.h to enable "PC file system" handling
#define LV_USE_FS_IF	1
#if LV_USE_FS_IF
#  define LV_FS_IF_FATFS    '\0'
#  define LV_FS_IF_PC     'S'
#endif
  • For fast simulatneous multi jpg/sjpg rendering in expense of additional RAM, you can modify LV_IMG_CACHE_DEF_SIZE to 2 or above if testing in simulator or using it in devices like raspberry pi etc.
  • To open large JPG image a lot of dymaic memory is required. Be sure to set LV_MEM_SIZE to large enough value. In simulator (4 * 1024 * 1024) shiuld be a good start.

Example code

#include <lvgl/lvgl.h>
#include "lv_lib_split_jpg/lv_sjpg.h"

LV_IMG_DECLARE( small_image_sjpg );
LV_IMG_DECLARE( wallpaper_jpg );

void demo_jpg_sjpg( void )
{
  lv_fs_if_init();
  lv_obj_t * img1;
  lv_obj_t * img2;

  lv_split_jpeg_init();
  img1 = lv_img_create(lv_scr_act(), NULL);
  img2 = lv_img_create(lv_scr_act(), NULL);

  //jpg from c array
  lv_img_set_src( img1,  &wallpaper_jpg);

  //sjpg from file (with lv_fs)
  //On Windows
  lv_img_set_src(img2,  "S.\\lv_lib_split_jpg\\example\\images\\small_image.sjpg");

  //On Linux
  //lv_img_set_src(img2,  "S/lv_lib_split_jpg/example/images/small_image.sjpg");
}

Converter

Converting JPG to C array

Converting JPG to SJPG

python3 and PIL library required

To create SJPG from JPG:

  1. Drag and drop a jpeg image on top of the jpg_to_sjpg.py
  2. Run the python script on shell with jpeg filename as argument. It should generate filename.c and filename.sjpg files.
python3 jpg_to_sjpg.py wallpaper.jpg

Expected result:

Conversion started...

Input:
        walpaper.jpg
        RES = 640 x 480

Output:
        Time taken = 1.66 sec
        bin size = 77.1 KB
        walpaper.sjpg           (bin file)
        walpaper.c              (c array)

All good!
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].