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

提供: robot-jp wiki
ナビゲーションに移動検索に移動
 
(同じ利用者による、間の5版が非表示)
1行目: 1行目:
 
https://docs.lvgl.io/8.2/libs/gif.html
 
https://docs.lvgl.io/8.2/libs/gif.html
 
__NOTOC__
 
__NOTOC__
 +
= GIF decoder =
 
{| class="wikitable"
 
{| class="wikitable"
 
!英文
 
!英文
6行目: 7行目:
 
|-
 
|-
 
|
 
|
|
+
Allow using GIF images in LVGL. Based on <nowiki>https://github.com/lecram/gifdec</nowiki>
|}
 
  
 +
When enabled in <code style="color: #bb0000;">lv_conf.h</code> with <code style="color: #bb0000;">LV_USE_GIF</code> <code style="color: #bb0000;">lv_gif_create(parent)</code> can be used to create a gif widget.
  
 +
<code style="color: #bb0000;">lv_gif_set_src(obj, src)</code> works very similarly to <code style="color: #bb0000;">lv_img_set_src</code>. As source, it also accepts images as variables (<code style="color: #bb0000;">lv_img_dsc_t</code>) or files.
 +
|LVGLでのGIF画像の使用を許可します。
 +
<nowiki>https://github.com/lecram/gifdec</nowiki> に基づいています。
  
= GIF decoder =
+
<code style="color: #bb0000;">lv_conf.h</code> で<code style="color: #bb0000;">LV_USE_GIF</code> を有効にすると、<code style="color: #bb0000;">lv_gif_create(parent)</code>を使って GIF ウィジェットを作成することができます。
Allow using GIF images in LVGL. Based on <nowiki>https://github.com/lecram/gifdec</nowiki>
 
  
When enabled in <code>lv_conf.h</code> with <code>LV_USE_GIF</code> <code>lv_gif_create(parent)</code> can be used to create a gif widget.
+
<code style="color: #bb0000;">lv_gif_set_src(obj, src)</code> は,<code style="color: #bb0000;">lv_img_set_src</code> と非常によく似た働きをします.source と同様に、画像を変数(<code style="color: #bb0000;">lv_img_dsc_t</code>)またはファイルとして受け取ります。
 +
|}
 +
:[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]]
  
<code>lv_gif_set_src(obj, src)</code> works very similarly to <code>lv_img_set_src</code>. As source, it also accepts images as variables (<code>lv_img_dsc_t</code>) or files.
 
  
 
== Convert GIF files to C array ==
 
== Convert GIF files to C array ==
 +
{| class="wikitable"
 +
!英文
 +
!自動翻訳
 +
|-
 +
|
 
To convert a GIF file to byte values array use LVGL's online converter. Select "Raw" color format and "C array" Output format.
 
To convert a GIF file to byte values array use LVGL's online converter. Select "Raw" color format and "C array" Output format.
 +
|GIFファイルをバイト値配列に変換するには、LVGLのオンラインコンバーターを使用します。「Raw」カラーフォーマットと「Carray」出力フォーマットを選択します。
 +
|}
 +
:[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]]
 +
  
 
== Use GIF images from file ==
 
== Use GIF images from file ==
 +
{| class="wikitable"
 +
!英文
 +
!自動翻訳
 +
|-
 +
|
 
For example:
 
For example:
 +
<syntaxhighlight lang="C++" style="border:1px dashed gray;">
 
  lv_gif_set_src(obj, "S:path/to/example.gif");
 
  lv_gif_set_src(obj, "S:path/to/example.gif");
Note that, a file system driver needs to be 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>
+
</syntaxhighlight>Note that, a file system driver needs to be registered to open images from files. Read more about it here or just enable one in <code style="color: #bb0000;">lv_conf.h</code> with <code style="color: #bb0000;">LV_USE_FS_...</code>
 +
|例えば:
 +
<syntaxhighlight lang="C++" style="border:1px dashed gray;">
 +
lv_gif_set_src(obj、 "S:path / to / example.gif");
 +
</syntaxhighlight>
 +
 
 +
 
 +
ファイルからイメージを開くには、ファイルシステムドライバを登録する必要があることに注意してください。詳しくはこちらをご覧ください。また、<code style="color: #bb0000;">lv_conf.h</code> で <code style="color: #bb0000;">LV_USE_FS_...</code>を指定して有効にすることもできます。
 +
|}
 +
:[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]]
 +
 
  
 
== Memory requirements ==
 
== Memory requirements ==
 +
{| class="wikitable"
 +
!英文
 +
!自動翻訳
 +
|-
 +
|
 
To decode and display a GIF animation the following amount of RAM is required:
 
To decode and display a GIF animation the following amount of RAM is required:
  
* <code>LV_COLOR_DEPTH 8</code>: 3 x image width x image height
+
* <code style="color: #bb0000;">LV_COLOR_DEPTH 8</code>: 3 x image width x image height
* <code>LV_COLOR_DEPTH 16</code>: 4 x image width x image height
+
* <code style="color: #bb0000;">LV_COLOR_DEPTH 16</code>: 4 x image width x image height
* <code>LV_COLOR_DEPTH 32</code>: 5 x image width x image height
+
* <code style="color: #bb0000;">LV_COLOR_DEPTH 32</code>: 5 x image width x image height
 +
|GIFアニメーションをデコードして表示するには、次の量のRAMが必要です。
 +
 
 +
* <code style="color: #bb0000;">LV_COLOR_DEPTH 8</code>:3x画像幅x画像高さ
 +
* <code style="color: #bb0000;">LV_COLOR_DEPTH 16</code>:4x画像幅x画像高さ
 +
* <code style="color: #bb0000;">LV_COLOR_DEPTH 32</code>:5x画像幅x画像高さ
 +
|}
 +
:[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]]
 +
 
  
 
== Example ==
 
== Example ==
 
+
{| class="wikitable"
 +
!英文
 +
!自動翻訳
 +
|-
 +
|
 
=== Open a GIF image from file and variable ===
 
=== Open a GIF image from file and variable ===
[[ファイル:LVGL docs 3rdPartyLibs GifDecoder 01.png|サムネイル]]
+
[[file:LVGL docs 3rdPartyLibs GifDecoder 01.png|link=https://docs.lvgl.io/8.2/libs/gif.html#open-a-gif-image-from-file-and-variable]]|
 +
|}
 +
:[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]]
  
 
https://docs.lvgl.io/8.2/libs/gif.html#open-a-gif-image-from-file-and-variable
 
 
----
 
  
 
== API ==
 
== API ==
 +
{| class="wikitable"
 +
!英文
 +
!自動翻訳
 +
|-
 +
|
 
Functions
 
Functions
  
; <span id="_CPPv313lv_gif_createP8lv_obj_t"></span><span id="_CPPv213lv_gif_createP8lv_obj_t"></span><span id="lv_gif_create__lv_obj_tP"></span><span id="lv__gif_8h_1ac173517583d3565541eff6122bf00f28" class="target"></span>lv_obj_t *lv_gif_create(lv_obj_t *parent)[https://docs.lvgl.io/8.2/libs/gif.html#_CPPv413lv_gif_createP8lv_obj_t] <span id="_CPPv313lv_gif_createP8lv_obj_t"></span><span id="_CPPv213lv_gif_createP8lv_obj_t"></span><span id="lv_gif_create__lv_obj_tP"></span><span id="lv__gif_8h_1ac173517583d3565541eff6122bf00f28" class="target"></span>
+
; lv_obj_t *lv_gif_create(lv_obj_t *parent)  
 
:
 
:
  
; <span id="_CPPv314lv_gif_set_srcP8lv_obj_tPKv"></span><span id="_CPPv214lv_gif_set_srcP8lv_obj_tPKv"></span><span id="lv_gif_set_src__lv_obj_tP.voidCP"></span><span id="lv__gif_8h_1af38a16a850de26f255bc83f0c3049901" class="target"></span>void lv_gif_set_src(lv_obj_t *o[https://docs.lvgl.io/8.2/libs/gif.html#_CPPv413lv_gif_createP8lv_obj_t]bj, const void *src)[https://docs.lvgl.io/8.2/libs/gif.html#_CPPv414lv_gif_set_srcP8lv_obj_tPKv] <span id="_CPPv314lv_gif_set_srcP8lv_obj_tPKv"></span><span id="_CPPv214lv_gif_set_srcP8lv_obj_tPKv"></span><span id="lv_gif_set_src__lv_obj_tP.voidCP"></span><span id="lv__gif_8h_1af38a16a850de26f255bc83f0c3049901" class="target"></span>
+
; void lv_gif_set_src(lv_obj_t *obj, const void *src)  
 
:
 
:
  
; <span id="_CPPv314lv_gif_restartP8lv_obj_t"></span><span id="_CPPv214lv_gif_restartP8lv_obj_t"></span><span id="lv_gif_restart__lv_obj_tP"></span><span id="lv__gif_8h_1aac889070c61873d3740cdeb13f917076" class="target"></span>void lv_gif_restart(lv_obj_t *gif)[https://docs.lvgl.io/8.2/libs/gif.html#_CPPv414lv_gif_restartP8lv_obj_t] <span id="_CPPv314lv_gif_restartP8lv_obj_t"></span><span id="_CPPv214lv_gif_restartP8lv_obj_t"></span><span id="lv_gif_restart__lv_obj_tP"></span><span id="lv__gif_8h_1aac889070c61873d3740cdeb13f917076" class="target"></span>
+
; void lv_gif_restart(lv_obj_t *gif)  
[https://docs.lvgl.io/8.2/libs/gif.html#_CPPv414lv_gif_set_srcP8lv_obj_tPKv]
+
:   
  
 
Variables
 
Variables
  
; <span id="_CPPv312lv_gif_class"></span><span id="_CPPv212lv_gif_class"></span><span id="lv_gif_class__lv_obj_class_tC"></span><span id="lv__gif_8h_1afb3e145e1424a7d7c703de5a5c96b24c" class="target"></span>const lv_obj_[https://docs.lvgl.io/8.2/libs/gif.html#_CPPv414lv_gif_restartP8lv_obj_t]class_t lv_gif_class[https://docs.lvgl.io/8.2/libs/gif.html#_CPPv412lv_gif_class] <span id="_CPPv312lv_gif_class"></span><span id="_CPPv212lv_gif_class"></span><span id="lv_gif_class__lv_obj_class_tC"></span><span id="lv__gif_8h_1afb3e145e1424a7d7c703de5a5c96b24c" class="target"></span>
+
; const lv_obj_class_t lv_gif_class  
 
:
 
:
  
; <span id="_CPPv38lv_gif_t"></span><span id="_CPPv28lv_gif_t"></span><span id="lv_gif_t"></span><span id="structlv__gif__t" class="target"></span>struct lv_gif_t[https://docs.lvgl.io/8.2/libs/gif.html#_CPPv48lv_gif_t] <span id="_CPPv38lv_gif_t"></span><span id="_CPPv28lv_gif_t"></span><span id="lv_gif_t"></span><span id="structlv__gif__t" class="target"></span>
+
; struct lv_gif_t  
: Pu[https://docs.lvgl.io/8.2/libs/gif.html#_CPPv412lv_gif_class]blic Memb[https://docs.lvgl.io/8.2/libs/gif.html#_CPPv48lv_gif_t]ers
+
: Public Members
:; <span id="_CPPv3N8lv_gif_t3imgE"></span><span id="_CPPv2N8lv_gif_t3imgE"></span><span id="lv_gif_t::img__lv_img_t"></span><span id="structlv__gif__t_1a4b879857d698725b43177938f4dde9b7" class="target"></span>lv_img_t img[https://docs.lvgl.io/8.2/libs/gif.html#_CPPv4N8lv_gif_t3imgE] <span id="_CPPv3N8lv_gif_t3imgE"></span><span id="_CPPv2N8lv_gif_t3imgE"></span><span id="lv_gif_t::img__lv_img_t"></span><span id="structlv__gif__t_1a4b879857d698725b43177938f4dde9b7" class="target"></span>
+
:; lv_img_t img  
 
::
 
::
:; <span id="_CPPv3N8lv_gif_t3gifE"></span><span id="_CPPv2N8lv_gif_t3gifE"></span><span id="lv_gif_t::gif__gd_GIFP"></span><span id="structlv__gif__t_1a21180b4fc42f5069b58b97b7237c0ed6" class="target"></span>gd[https://docs.lvgl.io/8.2/libs/gif.html#_CPPv4N8lv_gif_t3imgE]_GIF *gif[https://docs.lvgl.io/8.2/libs/gif.html#_CPPv4N8lv_gif_t3gifE] <span id="_CPPv3N8lv_gif_t3gifE"></span><span id="_CPPv2N8lv_gif_t3gifE"></span><span id="lv_gif_t::gif__gd_GIFP"></span><span id="structlv__gif__t_1a21180b4fc42f5069b58b97b7237c0ed6" class="target"></span>
+
:; gd_GIF *gif  
 
::
 
::
:; <span id="_CPPv3N8lv_gif_t5timerE"></span><span id="_CPPv2N8lv_gif_t5timerE"></span><span id="lv_gif_t::timer__lv_timer_tP"></span><span id="structlv__gif__t_1a29094e197b379c1e48aff25062b4412d" class="target"></span>l[https://docs.lvgl.io/8.2/libs/gif.html#_CPPv4N8lv_gif_t3gifE]v_timer_t *timer[https://docs.lvgl.io/8.2/libs/gif.html#_CPPv4N8lv_gif_t5timerE] <span id="_CPPv3N8lv_gif_t5timerE"></span><span id="_CPPv2N8lv_gif_t5timerE"></span><span id="lv_gif_t::timer__lv_timer_tP"></span><span id="structlv__gif__t_1a29094e197b379c1e48aff25062b4412d" class="target"></span>
+
:; lv_timer_t *timer  
 
::
 
::
:; <span id="_CPPv3N8lv_gif_t6imgdscE"></span><span id="_CPPv2N8lv_gif_t6imgdscE"></span><span id="lv_gif_t::imgdsc__lv_img_dsc_t"></span><span id="structlv__gif__t_1aeddfef45a9138f36188c2d34f58bf3b8" class="target"></span>lv_img_[https://docs.lvgl.io/8.2/libs/gif.html#_CPPv4N8lv_gif_t5timerE]dsc_t imgdsc[https://docs.lvgl.io/8.2/libs/gif.html#_CPPv4N8lv_gif_t6imgdscE] <span id="_CPPv3N8lv_gif_t6imgdscE"></span><span id="_CPPv2N8lv_gif_t6imgdscE"></span><span id="lv_gif_t::imgdsc__lv_img_dsc_t"></span><span id="structlv__gif__t_1aeddfef45a9138f36188c2d34f58bf3b8" class="target"></span>
+
:; lv_img_dsc_t imgdsc  
 
::
 
::
:; <span id="_CPPv3N8lv_gif_t9last_callE"></span><span id="_CPPv2N8lv_gif_t9last_callE"></span><span id="lv_gif_t::last_call__uint32_t"></span><span id="structlv__gif__t_1addf800499b5d76b0d0f091fef128be4e" class="target"></span>uint32_t [https://docs.lvgl.io/8.2/libs/gif.html#_CPPv4N8lv_gif_t6imgdscE]last_call
+
:; uint32_t last_call
 
+
|
 
+
|}
 
 
 
 
  
  
  
----
 
 
:[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]]
 
:[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]]

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

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

GIF decoder

英文 自動翻訳

Allow using GIF images in LVGL. Based on https://github.com/lecram/gifdec

When enabled in lv_conf.h with LV_USE_GIF lv_gif_create(parent) can be used to create a gif widget.

lv_gif_set_src(obj, src) works very similarly to lv_img_set_src. As source, it also accepts images as variables (lv_img_dsc_t) or files.

LVGLでのGIF画像の使用を許可します。

https://github.com/lecram/gifdec に基づいています。

lv_conf.hLV_USE_GIF を有効にすると、lv_gif_create(parent)を使って GIF ウィジェットを作成することができます。

lv_gif_set_src(obj, src) は,lv_img_set_src と非常によく似た働きをします.source と同様に、画像を変数(lv_img_dsc_t)またはファイルとして受け取ります。

戻る : Previous


Convert GIF files to C array

英文 自動翻訳

To convert a GIF file to byte values array use LVGL's online converter. Select "Raw" color format and "C array" Output format.

GIFファイルをバイト値配列に変換するには、LVGLのオンラインコンバーターを使用します。「Raw」カラーフォーマットと「Carray」出力フォーマットを選択します。
戻る : Previous


Use GIF images from file

英文 自動翻訳

For example:

 lv_gif_set_src(obj, "S:path/to/example.gif");
Note that, a file system driver needs to be registered to open images from files. Read more about it here or just enable one in lv_conf.h with LV_USE_FS_...
例えば:
 lv_gif_set_srcobj "S:path / to / example.gif";


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

戻る : Previous


Memory requirements

英文 自動翻訳

To decode and display a GIF animation the following amount of RAM is required:

  • LV_COLOR_DEPTH 8: 3 x image width x image height
  • LV_COLOR_DEPTH 16: 4 x image width x image height
  • LV_COLOR_DEPTH 32: 5 x image width x image height
GIFアニメーションをデコードして表示するには、次の量のRAMが必要です。
  • LV_COLOR_DEPTH 8:3x画像幅x画像高さ
  • LV_COLOR_DEPTH 16:4x画像幅x画像高さ
  • LV_COLOR_DEPTH 32:5x画像幅x画像高さ
戻る : Previous


Example

英文 自動翻訳

Open a GIF image from file and variable

LVGL docs 3rdPartyLibs GifDecoder 01.png|

戻る : Previous


API

英文 自動翻訳

Functions

lv_obj_t *lv_gif_create(lv_obj_t *parent)
void lv_gif_set_src(lv_obj_t *obj, const void *src)
void lv_gif_restart(lv_obj_t *gif)

Variables

const lv_obj_class_t lv_gif_class
struct lv_gif_t
Public Members
lv_img_t img
gd_GIF *gif
lv_timer_t *timer
lv_img_dsc_t imgdsc
uint32_t last_call


戻る : Previous