# lv_draw_mask.h (/api/draw/lv_draw_mask_h)



<ApiSummary functions="3" structs="1" />

Functions [#functions]

<ApiTabs items="[&#x22;Getters (1)&#x22;,&#x22;Other (2)&#x22;]">
  <ApiTab value="Getters (1)">
    <ApiMember kind="function" name="lv_draw_task_get_mask_rect_dsc" file="draw/lv_draw_mask.h" line="58" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw_mask.h#L58">
      lv_draw_task_get_mask_rect_dsc [#lv_draw_task_get_mask_rect_dsc]

      Try to get a rectangle mask draw descriptor from a draw task.

      ```c title=" " lineNumbers=1
      lv_draw_mask_rect_dsc_t * lv_draw_task_get_mask_rect_dsc(lv_draw_task_t *task)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                                         | Description |
      | ------ | ------------------------------------------------------------ | ----------- |
      | `task` | <ApiLink name="lv_draw_task_t" display="lv_draw_task_t *" /> | draw task   |

      **Returns:** <ApiLink name="lv_draw_mask_rect_dsc_t" display="lv_draw_mask_rect_dsc_t *" /> — the task's draw descriptor or NULL if the task is not of type LV\_DRAW\_TASK\_TYPE\_MASK\_RECTANGLE
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (2)">
    <ApiMember kind="function" name="lv_draw_mask_rect_dsc_init" file="draw/lv_draw_mask.h" line="51" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw_mask.h#L51">
      lv_draw_mask_rect_dsc_init [#lv_draw_mask_rect_dsc_init]

      Initialize a rectangle mask draw descriptor.

      ```c title=" " lineNumbers=1
      void lv_draw_mask_rect_dsc_init(lv_draw_mask_rect_dsc_t *dsc)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                                           | Description                  |
      | ----- | ------------------------------------------------------------------------------ | ---------------------------- |
      | `dsc` | <ApiLink name="lv_draw_mask_rect_dsc_t" display="lv_draw_mask_rect_dsc_t *" /> | pointer to a draw descriptor |
    </ApiMember>

    <ApiMember kind="function" name="lv_draw_mask_rect" file="draw/lv_draw_mask.h" line="65" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw_mask.h#L65">
      lv_draw_mask_rect [#lv_draw_mask_rect]

      Create a draw task to mask a rectangle from the buffer

      ```c title=" " lineNumbers=1
      void lv_draw_mask_rect(lv_layer_t *layer, const lv_draw_mask_rect_dsc_t *dsc)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                                                                 | Description                  |
      | ------- | ------------------------------------------------------------------------------------ | ---------------------------- |
      | `layer` | <ApiLink name="lv_layer_t" display="lv_layer_t *" />                                 | pointer to a layer           |
      | `dsc`   | <ApiLink name="lv_draw_mask_rect_dsc_t" display="const lv_draw_mask_rect_dsc_t *" /> | pointer to a draw descriptor |
    </ApiMember>
  </ApiTab>
</ApiTabs>

Structs [#structs]

<ApiMember kind="struct" name="_lv_draw_mask_rect_dsc_t">
  \_lv_draw_mask_rect_dsc_t [#_lv_draw_mask_rect_dsc_t]

  | Member         | Type                                  | Description                                                                   |
  | -------------- | ------------------------------------- | ----------------------------------------------------------------------------- |
  | `base`         | <ApiLink name="lv_draw_dsc_base_t" /> |                                                                               |
  | `area`         | <ApiLink name="lv_area_t" />          | The area to mask.                                                             |
  | `radius`       | <ApiLink name="int32_t" />            | The radius of masking                                                         |
  | `keep_outside` | <ApiLink name="uint32_t" />           | 0: clear the content out of the `area`. 1: don't touch the area out of `area` |
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_draw.h&#x22;, &#x22;lv_color.h&#x22;, &#x22;lv_area.h&#x22;, &#x22;lv_style.h&#x22;]" includedBy="[&#x22;lv_draw_nema_gfx.h&#x22;, &#x22;lv_draw_sw.h&#x22;]" transitiveIncludes="[&#x22;lv_anim.h&#x22;, &#x22;lv_array.h&#x22;, &#x22;lv_assert.h&#x22;, &#x22;lv_bidi.h&#x22;, &#x22;lv_color_op.h&#x22;, &#x22;lv_conf_internal.h&#x22;, &#x22;lv_conf_kconfig.h&#x22;, &#x22;lv_draw_buf.h&#x22;, &#x22;lv_event.h&#x22;, &#x22;lv_ext_data.h&#x22;, &#x22;lv_flex.h&#x22;, &#x22;lv_font.h&#x22;, &#x22;lv_fs.h&#x22;, &#x22;lv_grad.h&#x22;, &#x22;lv_grid.h&#x22;, &#x22;lv_image_decoder.h&#x22;, &#x22;lv_image_dsc.h&#x22;, &#x22;lv_layout.h&#x22;, &#x22;lv_ll.h&#x22;, &#x22;lv_log.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_matrix.h&#x22;, &#x22;lv_mem.h&#x22;, &#x22;lv_palette.h&#x22;, &#x22;lv_profiler.h&#x22;, &#x22;lv_profiler_builtin.h&#x22;, &#x22;lv_sprintf.h&#x22;, &#x22;lv_string.h&#x22;, &#x22;lv_style_gen.h&#x22;, &#x22;lv_symbol_def.h&#x22;, &#x22;lv_text.h&#x22;, &#x22;lv_tick.h&#x22;, &#x22;lv_timer.h&#x22;, &#x22;lv_types.h&#x22;]" />
