App:Library:LVGL:docs:Widgets:Object mask (lv objmask)

提供: robot-jp wiki
ナビゲーションに移動検索に移動

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