「App:Library:LVGL:docs:Widgets:Object mask (lv objmask)」の版間の差分

提供: robot-jp wiki
ナビゲーションに移動検索に移動
 
(同じ利用者による、間の6版が非表示)
18行目: 18行目:
 
!自動翻訳
 
!自動翻訳
 
|-
 
|-
|The Object mask has only a main part called <code>LV_OBJMASK_PART_BG</code> and it uses the typical background style properties.
+
|The Object mask has only a main part called <code style="color: #bb0000;">LV_OBJMASK_PART_BG</code> and it uses the typical background style properties.
|オブジェクト マスクには LV_OBJMASK_PART_BG というメイン パーツのみがあり、典型的な背景スタイル プロパティを使用します。
+
|オブジェクト マスクには <code style="color: #bb0000;">LV_OBJMASK_PART_BG</code> というメイン パーツのみがあり、典型的な背景スタイル プロパティを使用します。
 
|}
 
|}
 
:[[App:Library:LVGL:docs:Widgets|戻る : Previous]]
 
:[[App:Library:LVGL:docs:Widgets|戻る : Previous]]
31行目: 31行目:
 
|-
 
|-
 
|Before adding a mask to the ''Object mask'' the mask should be initialized:
 
|Before adding a mask to the ''Object mask'' the mask should be initialized:
 +
<syntaxhighlight lang="C++" style="border: 1px dashed gray;">
 
  lv_draw_mask_<type>_param_t mask_param;
 
  lv_draw_mask_<type>_param_t mask_param;
 
  lv_draw_mask_<type>_init(&mask_param, ...);
 
  lv_draw_mask_<type>_init(&mask_param, ...);
 
  lv_objmask_mask_t * mask_p = lv_objmask_add_mask(objmask, &mask_param);
 
  lv_objmask_mask_t * mask_p = lv_objmask_add_mask(objmask, &mask_param);
 +
</syntaxhighlight>
 
Lvgl supports the following mask types:
 
Lvgl supports the following mask types:
  
47行目: 49行目:
 
For the details of the mask '''''init''''' function see the [https://robot-jp.com/wiki/index.php/App:Library:LVGL:docs:Widgets:Object_mask_(lv_objmask)#API <u>'''API'''</u>] documentation below.
 
For the details of the mask '''''init''''' function see the [https://robot-jp.com/wiki/index.php/App:Library:LVGL:docs:Widgets:Object_mask_(lv_objmask)#API <u>'''API'''</u>] documentation below.
 
|オブジェクト マスクにマスクを追加する前に、マスクを初期化する必要があります。
 
|オブジェクト マスクにマスクを追加する前に、マスクを初期化する必要があります。
 +
<syntaxhighlight lang="C++" style="border: 1px dashed gray;">
 
  lv_draw_mask_<type>_param_t mask_param;
 
  lv_draw_mask_<type>_param_t mask_param;
 
  lv_draw_mask_<type>_init(&mask_param, ...);
 
  lv_draw_mask_<type>_init(&mask_param, ...);
 
  lv_objmask_mask_t * mask_p = lv_objmask_add_mask(objmask, &mask_param);
 
  lv_objmask_mask_t * mask_p = lv_objmask_add_mask(objmask, &mask_param);
 +
</syntaxhighlight>
 
Lvgl は、次のマスク タイプをサポートしています。
 
Lvgl は、次のマスク タイプをサポートしています。
  
64行目: 68行目:
 
|}
 
|}
 
:[[App:Library:LVGL:docs:Widgets|戻る : Previous]]
 
:[[App:Library:LVGL:docs:Widgets|戻る : Previous]]
 
  
 
=== Update mask ===
 
=== Update mask ===
71行目: 74行目:
 
!自動翻訳
 
!自動翻訳
 
|-
 
|-
|AN existing mask can be updated with <code>lv_objmask_update_mask(objmask, mask_p, new_param)</code>, where <code>mask_p</code> is return value of <code>lv_objmask_add_mask</code>.
+
|AN existing mask can be updated with <code style="color: #bb0000;">lv_objmask_update_mask(objmask, mask_p, new_param)</code>, where <code style="color: #bb0000;">mask_p</code> is return value of <code style="color: #bb0000;">lv_objmask_add_mask</code>.
|既存のマスクは lv_objmask_update_mask(objmask, mask_p, new_param) で更新できます。ここで、mask_p は lv_objmask_add_mask の戻り値です。
+
|既存のマスクは <code style="color: #bb0000;">lv_objmask_update_mask(objmask, mask_p, new_param)</code> で更新できます。ここで、<code style="color: #bb0000;">mask_p</code> <code style="color: #bb0000;">lv_objmask_add_mask</code> の戻り値です。
 
|}
 
|}
 
:[[App:Library:LVGL:docs:Widgets|戻る : Previous]]
 
:[[App:Library:LVGL:docs:Widgets|戻る : Previous]]
82行目: 85行目:
 
!自動翻訳
 
!自動翻訳
 
|-
 
|-
|A mask can be removed with <code>lv_objmask_remove_mask(objmask, mask_p)</code>
+
|A mask can be removed with <code style="color: #bb0000;">lv_objmask_remove_mask(objmask, mask_p)</code>
|マスクは lv_objmask_remove_mask(objmask, mask_p) で削除できます
+
|マスクは <code style="color: #bb0000;">lv_objmask_remove_mask(objmask, mask_p)</code> で削除できます
 
|}
 
|}
 
:[[App:Library:LVGL:docs:Widgets|戻る : Previous]]
 
:[[App:Library:LVGL:docs:Widgets|戻る : Previous]]
127行目: 130行目:
 
|-
 
|-
 
|[[file:LVGL Lib docs SeveralObjectMasks.png|link=https://docs.lvgl.io/latest/en/html/widgets/objmask.html#several-object-masks]]
 
|[[file:LVGL Lib docs SeveralObjectMasks.png|link=https://docs.lvgl.io/latest/en/html/widgets/objmask.html#several-object-masks]]
 +
|}
 +
 +
=== Text mask ===
 +
{| class="wikitable"
 
|-
 
|-
|[[ファイル:LVGL Lib docs TextMask.png|サムネイル]]
+
|[[file:LVGL Lib docs TextMask.png|link=https://docs.lvgl.io/latest/en/html/widgets/objmask.html#text-mask]]
 
|}
 
|}
 
:[[App:Library:LVGL:docs:Widgets|戻る : Previous]]
 
:[[App:Library:LVGL:docs:Widgets|戻る : Previous]]
  
== API ==
+
== [https://docs.lvgl.io/latest/en/html/widgets/objmask.html#api API] ==
 
:[[App:Library:LVGL:docs:Widgets|戻る : Previous]]
 
:[[App:Library:LVGL:docs:Widgets|戻る : Previous]]

2022年8月31日 (水) 18:42時点における最新版

https://docs.lvgl.io/latest/en/html/widgets/objmask.html

Object mask (lv_objmask)

Overview

英文 自動翻訳
The Object mask is capable of add some mask to drawings when its children is drawn. オブジェクト マスクは、その子が描画されるときに描画にマスクを追加できます。
戻る : Previous


Parts and Styles

英文 自動翻訳
The Object mask has only a main part called LV_OBJMASK_PART_BG and it uses the typical background style properties. オブジェクト マスクには LV_OBJMASK_PART_BG というメイン パーツのみがあり、典型的な背景スタイル プロパティを使用します。
戻る : Previous


Usage

Adding mask

英文 自動翻訳
Before adding a mask to the Object mask the mask should be initialized:
 
 lv_draw_mask_<type>_param_t mask_param;
 lv_draw_mask_<type>_init(&mask_param, ...);
 lv_objmask_mask_t * mask_p = lv_objmask_add_mask(objmask, &mask_param);

Lvgl supports the following mask types:

  • line clip the pixels on the top/bottom left/right of a line. Can be initialized from two points or a point and an angle:
  • angle keep the pixels only between a given start and end angle
  • radius keep the pixel only inside a rectangle which can have radius (can for a circle too). Can be inverted to keep the pixel outside of the rectangle.
  • fade fade vertically (change the pixels opacity according to their y position)
  • map use an alpha mask (a byte array) to describe the pixels opacity.


The coordinates in the mask are relative to the Object. That is if the object moves the masks move with it.

For the details of the mask init function see the API documentation below.

オブジェクト マスクにマスクを追加する前に、マスクを初期化する必要があります。
 
 lv_draw_mask_<type>_param_t mask_param;
 lv_draw_mask_<type>_init(&mask_param, ...);
 lv_objmask_mask_t * mask_p = lv_objmask_add_mask(objmask, &mask_param);

Lvgl は、次のマスク タイプをサポートしています。

  • line は、ラインの上/下の左/右のピクセルをクリップします。 2 点または 1 点と角度から初期化できます。
  • angle は、指定された開始角度と終了角度の間のピクセルのみを保持します
  • radius は、半径を持つことができる長方形の内側にのみピクセルを保持します (円も可能)。 ピクセルを長方形の外側に保つために反転できます。
  • 垂直方向にフェードします (y 位置に応じてピクセルの不透明度を変更します)
  • map はアルファ マスク (バイト配列) を使用して、ピクセルの不透明度を記述します。


マスク内の座標は、オブジェクトに対して相対的です。 つまり、オブジェクトが移動すると、マスクも一緒に移動します。

mask init 関数の詳細については、以下の API ドキュメントを参照してください。

戻る : Previous

Update mask

英文 自動翻訳
AN existing mask can be updated with lv_objmask_update_mask(objmask, mask_p, new_param), where mask_p is return value of lv_objmask_add_mask. 既存のマスクは lv_objmask_update_mask(objmask, mask_p, new_param) で更新できます。ここで、mask_plv_objmask_add_mask の戻り値です。
戻る : Previous


Remove mask

英文 自動翻訳
A mask can be removed with lv_objmask_remove_mask(objmask, mask_p) マスクは lv_objmask_remove_mask(objmask, mask_p) で削除できます
戻る : Previous


Events

英文 自動翻訳
Only the Generic events are sent by the object type.


Learn more about Events.

Generic eventsのみがオブジェクトタイプによって送信されます。


詳細はEventsをご覧ください。

戻る : Previous

Keys

英文 自動翻訳
No Keys are processed by the object type.


Learn more about Keys.

オブジェクトタイプで処理されるキーはありません。


詳細はKeysをご覧ください。

戻る : Previous


Example

Several object masks

LVGL Lib docs SeveralObjectMasks.png

Text mask

LVGL Lib docs TextMask.png
戻る : Previous

API

戻る : Previous