# lv_draw_nema_gfx_utils.h (/api/draw/nema_gfx/lv_draw_nema_gfx_utils_h)



MIT License

***

Copyright (c) 2008-24 Think Silicon Single Member PC [#copyright-c-2008-24-think-silicon-single-member-pc]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

<ApiSummary functions="4" macros="3" />

Functions [#functions]

<ApiTabs items="[&#x22;Setters (1)&#x22;,&#x22;Other (3)&#x22;]">
  <ApiTab value="Setters (1)">
    <ApiMember kind="function" name="lv_nemagfx_grad_set" file="draw/nema_gfx/lv_draw_nema_gfx_utils.h" line="175" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/nema_gfx/lv_draw_nema_gfx_utils.h#L175">
      lv_nemagfx_grad_set [#lv_nemagfx_grad_set]

      Get NemaGFX blending mode

      ```c title=" " lineNumbers=1
      void lv_nemagfx_grad_set(void *gradient, lv_grad_dsc_t lv_grad, lv_opa_t opa)
      ```

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

      | Name                 | Type                             | Description             |
      | -------------------- | -------------------------------- | ----------------------- |
      | **\[in]** `gradient` | `void *`                         | NemaGFX Gradient Buffer |
      | **\[in]** `lv_grad`  | <ApiLink name="lv_grad_dsc_t" /> | Gradient descriptor     |
      | **\[in]** `opa`      | <ApiLink name="lv_opa_t" />      | Descriptor's opacity    |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (3)">
    <ApiMember kind="function" name="lv_nemagfx_is_cf_supported" file="draw/nema_gfx/lv_draw_nema_gfx_utils.h" line="145" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/nema_gfx/lv_draw_nema_gfx_utils.h#L145">
      lv_nemagfx_is_cf_supported [#lv_nemagfx_is_cf_supported]

      Check if `lv_color_format_t` is supported.

      ```c title=" " lineNumbers=1
      bool lv_nemagfx_is_cf_supported(lv_color_format_t cf)
      ```

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

      | Name | Type                                 | Description           |
      | ---- | ------------------------------------ | --------------------- |
      | `cf` | <ApiLink name="lv_color_format_t" /> | The LVGL color format |

      **Returns:** <ApiLink name="bool" /> — True/false
    </ApiMember>

    <ApiMember kind="function" name="lv_nemagfx_cf_to_nema" file="draw/nema_gfx/lv_draw_nema_gfx_utils.h" line="152" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/nema_gfx/lv_draw_nema_gfx_utils.h#L152">
      lv_nemagfx_cf_to_nema [#lv_nemagfx_cf_to_nema]

      Convert a `lv_color_format_t` to a Nema color format.

      ```c title=" " lineNumbers=1
      uint32_t lv_nemagfx_cf_to_nema(lv_color_format_t cf)
      ```

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

      | Name | Type                                 | Description           |
      | ---- | ------------------------------------ | --------------------- |
      | `cf` | <ApiLink name="lv_color_format_t" /> | The LVGL color format |

      **Returns:** <ApiLink name="uint32_t" /> — The Nema color format
    </ApiMember>

    <ApiMember kind="function" name="lv_nemagfx_blending_mode" file="draw/nema_gfx/lv_draw_nema_gfx_utils.h" line="162" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/nema_gfx/lv_draw_nema_gfx_utils.h#L162">
      lv_nemagfx_blending_mode [#lv_nemagfx_blending_mode]

      Get NemaGFX blending mode

      ```c title=" " lineNumbers=1
      uint32_t lv_nemagfx_blending_mode(lv_blend_mode_t lv_blend_mode)
      ```

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

      | Name                      | Type                               | Description         |
      | ------------------------- | ---------------------------------- | ------------------- |
      | **\[in]** `lv_blend_mode` | <ApiLink name="lv_blend_mode_t" /> | The LVGL blend mode |

      **Returns:** <ApiLink name="uint32_t" /> — NemaGFX blending mode
    </ApiMember>
  </ApiTab>
</ApiTabs>

Macros [#macros]

<ApiMember kind="macro" name="NEMA_VIRT2PHYS" file="draw/nema_gfx/lv_draw_nema_gfx_utils.h" line="113" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/nema_gfx/lv_draw_nema_gfx_utils.h#L113">
  NEMA_VIRT2PHYS [#nema_virt2phys]

  ```c title=" " lineNumbers=1
  #define NEMA_VIRT2PHYS
  ```
</ApiMember>

<ApiMember kind="macro" name="LV_NEMA_GFX_COLOR_FORMAT" file="draw/nema_gfx/lv_draw_nema_gfx_utils.h" line="123" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/nema_gfx/lv_draw_nema_gfx_utils.h#L123">
  LV_NEMA_GFX_COLOR_FORMAT [#lv_nema_gfx_color_format]

  ```c title=" " lineNumbers=1
  #define LV_NEMA_GFX_COLOR_FORMAT NEMA_RGB565
  ```
</ApiMember>

<ApiMember kind="macro" name="LV_NEMA_GFX_FORMAT_MULTIPLIER" file="draw/nema_gfx/lv_draw_nema_gfx_utils.h" line="124" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/nema_gfx/lv_draw_nema_gfx_utils.h#L124">
  LV_NEMA_GFX_FORMAT_MULTIPLIER [#lv_nema_gfx_format_multiplier]

  ```c title=" " lineNumbers=1
  #define LV_NEMA_GFX_FORMAT_MULTIPLIER 2
  ```
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_conf_internal.h&#x22;, &#x22;lv_draw_sw.h&#x22;, &#x22;build_version.h&#x22;, &#x22;nema_blender.h&#x22;, &#x22;nema_cmdlist.h&#x22;, &#x22;nema_core.h&#x22;, &#x22;nema_easing.h&#x22;, &#x22;nema_error.h&#x22;, &#x22;nema_font.h&#x22;, &#x22;nema_graphics.h&#x22;, &#x22;nema_hal.h&#x22;, &#x22;nema_interpolators.h&#x22;, &#x22;nema_math.h&#x22;, &#x22;nema_matrix3x3.h&#x22;, &#x22;nema_matrix4x4.h&#x22;, &#x22;nema_provisional.h&#x22;, &#x22;nema_raster.h&#x22;, &#x22;nema_sys_defs.h&#x22;, &#x22;nema_transitions.h&#x22;, &#x22;nema_utils.h&#x22;, &#x22;nema_version.h&#x22;, &#x22;nema_vg_context.h&#x22;, &#x22;nema_vg_font.h&#x22;, &#x22;nema_vg.h&#x22;, &#x22;nema_vg_paint.h&#x22;, &#x22;nema_vg_path.h&#x22;, &#x22;nema_vg_tsvg.h&#x22;, &#x22;nema_vg_version.h&#x22;, &#x22;tsi_malloc.h&#x22;]" includedBy="[&#x22;lv_draw_nema_gfx.h&#x22;]" transitiveIncludes="[&#x22;lv_anim.h&#x22;, &#x22;lv_area.h&#x22;, &#x22;lv_array.h&#x22;, &#x22;lv_assert.h&#x22;, &#x22;lv_bidi.h&#x22;, &#x22;lv_color.h&#x22;, &#x22;lv_color_op.h&#x22;, &#x22;lv_conf_kconfig.h&#x22;, &#x22;lv_display.h&#x22;, &#x22;lv_draw.h&#x22;, &#x22;lv_draw_arc.h&#x22;, &#x22;lv_draw_blur.h&#x22;, &#x22;lv_draw_buf.h&#x22;, &#x22;lv_draw_image.h&#x22;, &#x22;lv_draw_label.h&#x22;, &#x22;lv_draw_line.h&#x22;, &#x22;lv_draw_mask.h&#x22;, &#x22;lv_draw_rect.h&#x22;, &#x22;lv_draw_sw_blend.h&#x22;, &#x22;lv_draw_sw_mask.h&#x22;, &#x22;lv_draw_sw_utils.h&#x22;, &#x22;lv_draw_triangle.h&#x22;, &#x22;lv_draw_vector.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.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;]" />
