「App:Library:LVGL:docs:3rd party libraries:JPG decoder」の版間の差分

提供: robot-jp wiki
ナビゲーションに移動検索に移動
8行目: 8行目:
 
|
 
|
 
Allow the use of JPG images in LVGL. Besides that it also allows the use of a custom format, called Split JPG (SJPG), which can be decoded in more optimal way on embedded systems.
 
Allow the use of JPG images in LVGL. Besides that it also allows the use of a custom format, called Split JPG (SJPG), which can be decoded in more optimal way on embedded systems.
|
+
|LVGLでJPG画像の使用を許可します。それに加えて、Split JPG(SJPG)と呼ばれるカスタム形式を使用することもできます。これは、組み込みシステムでより最適な方法でデコードできます。
 
|}
 
|}
 
:[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]]
 
:[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]]
30行目: 30行目:
 
* Only the required partion of the JPG and SJPG images are decoded, therefore they can't be zoomed or rotated.
 
* Only the required partion of the JPG and SJPG images are decoded, therefore they can't be zoomed or rotated.
 
|
 
|
 +
* 通常のJPG形式とカスタムSJPG形式の両方をサポートします。
 +
* 通常のJPGをデコードすると、非圧縮画像全体のサイズのRAMが消費されます(RAMが多いデバイスにのみ推奨されます)
 +
* SJPGは、「通常の」JPGに基づいたカスタム形式であり、LVGL用に特別に作成されています。
 +
* SJPGは、sjpgヘッダーを持つ小さなjpegフラグメントのバンドルである「split-jpeg」です。
 +
* SJPGのサイズは、jpgファイルとほぼ同等か、少し大きくなる可能性があります。
 +
* ファイルから読み取ったファイルとc-arrayが実装されています。
 +
* SJPEGフレームフラグメントキャッシュは、キャッシュで利用可能な場合、行の高速フェッチを可能にします。
 +
* デフォルトでは、sjpg画像キャッシュは画像幅* 2 * 16バイトになります(変更可能)
 +
* 現在、16ビットの画像形式のみがサポートされています(TODO)
 +
* JPGおよびSJPG画像の必要な部分のみがデコードされるため、ズームまたは回転することはできません。
 
|}
 
|}
 
:[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]]
 
:[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]]
45行目: 55行目:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Note that, a file system driver needs to registered to open images from files. Read more about it here or just enable one in <code>lv_conf.h</code> with <code>LV_USE_FS_...</code>
 
Note that, a file system driver needs to registered to open images from files. Read more about it here or just enable one in <code>lv_conf.h</code> with <code>LV_USE_FS_...</code>
|
+
|LVGLで有効に<code>lv_conf.h</code>する<code>LV_USE_SJPG</code>と、新しい画像デコーダーが自動的に登録されるため、JPGとSJPG
 +
  ファイルは 画像ソースとして直接使用でき ます 。例:lv_img_set_src (my_img 、 "S:path / to / picture.jpg" );     
 +
 
 +
ファイルからイメージを開くには、ファイルシステムドライバを登録する必要があることに注意してください。詳細についてはこちらをご覧になるか、で有効に<code>lv_conf.h</code>してください<code>LV_USE_FS_...</code>
 
|}
 
|}
 
:[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]]
 
:[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]]
61行目: 74行目:
 
* Color format = RAW, output format = C Array
 
* Color format = RAW, output format = C Array
 
|
 
|
 +
* lvglオンラインツールhttps://lvgl.io/tools/imageconverterを使用する
 +
* カラーフォーマット=RAW、出力フォーマット=C配列
 
|}
 
|}
 
:[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]]
 
:[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]]
100行目: 115行目:
 
[[file:LVGL docs others gridnav 03.png|link=https://docs.lvgl.io/8.2/libs/sjpg.html#load-an-sjpg-image]]
 
[[file:LVGL docs others gridnav 03.png|link=https://docs.lvgl.io/8.2/libs/sjpg.html#load-an-sjpg-image]]
 
|
 
|
 +
 +
 +
python3とPILライブラリが必要です。(PILはでインストールできます<code>pip3 install pillow</code>)
 +
 +
JPGからSJPGを作成するには:
 +
 +
* 変換する画像をコピーします<code>lvgl/scripts</code>
 +
* <code>cd lvgl/scripts</code>
 +
* <code>python3 jpg_to_sjpg.py image_to_convert.jpg</code>。CファイルとSJPG画像の両方を作成します。
 +
 +
期待される結果は次のとおりです。
 +
  変換 を開始しました...
 +
 
 +
  入力:
 +
          image_to_convert 。jpg
 +
          RES  =  640  x  480
 +
 
 +
  出力:
 +
          所要時間 = 1.66秒のビンサイズ= 77.1KB の壁紙。sjpg (binファイル)壁紙。c (c配列) 
 +
             
 +
                     
 +
                       
 +
 
 +
  すべて 良いです!
 +
 
|}
 
|}
 
:[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]]
 
:[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]]

2022年6月29日 (水) 15:24時点における版

https://docs.lvgl.io/8.2/libs/sjpg.html

JPG decoder

英文 自動翻訳

Allow the use of JPG images in LVGL. Besides that it also allows the use of a custom format, called Split JPG (SJPG), which can be decoded in more optimal way on embedded systems.

LVGLでJPG画像の使用を許可します。それに加えて、Split JPG(SJPG)と呼ばれるカスタム形式を使用することもできます。これは、組み込みシステムでより最適な方法でデコードできます。
戻る : Previous


Overview

英文 自動翻訳
  • Supports both normal JPG and the custom SJPG formats.
  • Decoding normal JPG consumes RAM with the size 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.
  • File read from file and c-array are implemented.
  • SJPEG frame fragment cache enables fast fetching of lines if available in cache.
  • By default the sjpg image cache will be image width * 2 * 16 bytes (can be modified)
  • Currently only 16 bit image format is supported (TODO)
  • Only the required partion of the JPG and SJPG images are decoded, therefore they can't be zoomed or rotated.
  • 通常のJPG形式とカスタムSJPG形式の両方をサポートします。
  • 通常のJPGをデコードすると、非圧縮画像全体のサイズのRAMが消費されます(RAMが多いデバイスにのみ推奨されます)
  • SJPGは、「通常の」JPGに基づいたカスタム形式であり、LVGL用に特別に作成されています。
  • SJPGは、sjpgヘッダーを持つ小さなjpegフラグメントのバンドルである「split-jpeg」です。
  • SJPGのサイズは、jpgファイルとほぼ同等か、少し大きくなる可能性があります。
  • ファイルから読み取ったファイルとc-arrayが実装されています。
  • SJPEGフレームフラグメントキャッシュは、キャッシュで利用可能な場合、行の高速フェッチを可能にします。
  • デフォルトでは、sjpg画像キャッシュは画像幅* 2 * 16バイトになります(変更可能)
  • 現在、16ビットの画像形式のみがサポートされています(TODO)
  • JPGおよびSJPG画像の必要な部分のみがデコードされるため、ズームまたは回転することはできません。
戻る : Previous


Usage

英文 自動翻訳
If enabled in lv_conf.h by LV_USE_SJPG LVGL will register a new image decoder automatically so JPG and SJPG
 files can be directly used as image sources. For example:
 lv_img_set_src(my_img, "S:path/to/picture.jpg");

Note that, a file system driver needs to registered to open images from files. Read more about it here or just enable one in lv_conf.h with LV_USE_FS_...

LVGLで有効にlv_conf.hするLV_USE_SJPGと、新しい画像デコーダーが自動的に登録されるため、JPGとSJPG
 ファイルは 画像ソースとして直接使用でき ます 。例:lv_img_set_src (my_img 、 "S:path / to / picture.jpg" );      
  

ファイルからイメージを開くには、ファイルシステムドライバを登録する必要があることに注意してください。詳細についてはこちらをご覧になるか、で有効にlv_conf.hしてくださいLV_USE_FS_...

戻る : Previous


Converter

Converting JPG to C array

英文 自動翻訳
  • Use lvgl online tool https://lvgl.io/tools/imageconverter
  • Color format = RAW, output format = C Array
  • lvglオンラインツールhttps://lvgl.io/tools/imageconverterを使用する
  • カラーフォーマット=RAW、出力フォーマット=C配列
戻る : Previous


Converting JPG to SJPG

英文 自動翻訳

python3 and the PIL library required. (PIL can be installed with pip3 install pillow)

To create SJPG from JPG:

  • Copy the image to convert into lvgl/scripts
  • cd lvgl/scripts
  • python3 jpg_to_sjpg.py image_to_convert.jpg. It creates both a C files and an SJPG image.

The expected result is:

 Conversion started...
 
 Input:
         image_to_convert.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!

Example

Load an SJPG image

LVGL docs others gridnav 03.png


python3とPILライブラリが必要です。(PILはでインストールできますpip3 install pillow

JPGからSJPGを作成するには:

  • 変換する画像をコピーしますlvgl/scripts
  • cd lvgl/scripts
  • python3 jpg_to_sjpg.py image_to_convert.jpg。CファイルとSJPG画像の両方を作成します。

期待される結果は次のとおりです。

 変換 を開始しました...
 
 入力:
         image_to_convert 。jpg 
         RES  =  640  x  480
 
 出力:
         所要時間 = 1.66秒のビンサイズ= 77.1KB の壁紙。sjpg (binファイル)壁紙。c (c配列)  
             
                     
                        
 
 すべて 良いです!
戻る : Previous


API

英文 自動翻訳

Functions

void lv_split_jpeg_init(void)



戻る : Previous