# lv_area_private.h (/api/misc/lv_area_private_h)



<RelatedHeaders name="lv_area.h" isPrivate="true" />

<ApiSummary functions="9" />

Functions [#functions]

<ApiTabs items="[&#x22;Setters (1)&#x22;,&#x22;Other (8)&#x22;]">
  <ApiTab value="Setters (1)">
    <ApiMember kind="function" name="lv_area_set_pos" file="misc/lv_area_private.h" line="37" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_area_private.h#L37">
      lv_area_set_pos [#lv_area_set_pos]

      Set the position of an area (width and height will be kept)

      ```c title=" " lineNumbers=1
      void lv_area_set_pos(lv_area_t *area_p, int32_t x, int32_t y)
      ```

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

      | Name     | Type                                               | Description                      |
      | -------- | -------------------------------------------------- | -------------------------------- |
      | `area_p` | <ApiLink name="lv_area_t" display="lv_area_t *" /> | pointer to an area               |
      | `x`      | <ApiLink name="int32_t" />                         | the new x coordinate of the area |
      | `y`      | <ApiLink name="int32_t" />                         | the new y coordinate of the area |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (8)">
    <ApiMember kind="function" name="lv_area_intersect" file="misc/lv_area_private.h" line="46" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_area_private.h#L46">
      lv_area_intersect [#lv_area_intersect]

      Get the common parts of two areas

      ```c title=" " lineNumbers=1
      bool lv_area_intersect(lv_area_t *res_p, const lv_area_t *a1_p, const lv_area_t *a2_p)
      ```

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

      | Name    | Type                                                     | Description                                       |
      | ------- | -------------------------------------------------------- | ------------------------------------------------- |
      | `res_p` | <ApiLink name="lv_area_t" display="lv_area_t *" />       | pointer to an area, the result will be stored her |
      | `a1_p`  | <ApiLink name="lv_area_t" display="const lv_area_t *" /> | pointer to the first area                         |
      | `a2_p`  | <ApiLink name="lv_area_t" display="const lv_area_t *" /> | pointer to the second area                        |

      **Returns:** <ApiLink name="bool" /> — false: the two area has NO common parts, res\_p is invalid
    </ApiMember>

    <ApiMember kind="function" name="lv_area_diff" file="misc/lv_area_private.h" line="55" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_area_private.h#L55">
      lv_area_diff [#lv_area_diff]

      Get resulting sub areas after removing the common parts of two areas from the first area

      ```c title=" " lineNumbers=1
      int8_t lv_area_diff(lv_area_t res_p[], const lv_area_t *a1_p, const lv_area_t *a2_p)
      ```

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

      | Name    | Type                                                     | Description                                                                             |
      | ------- | -------------------------------------------------------- | --------------------------------------------------------------------------------------- |
      | `res_p` | <ApiLink name="lv_area_t" />                             | pointer to an array of areas with a count of 4, the resulting areas will be stored here |
      | `a1_p`  | <ApiLink name="lv_area_t" display="const lv_area_t *" /> | pointer to the first area                                                               |
      | `a2_p`  | <ApiLink name="lv_area_t" display="const lv_area_t *" /> | pointer to the second area                                                              |

      **Returns:** <ApiLink name="int8_t" /> — number of results (max 4) or -1 if no intersect
    </ApiMember>

    <ApiMember kind="function" name="lv_area_join" file="misc/lv_area_private.h" line="63" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_area_private.h#L63">
      lv_area_join [#lv_area_join]

      Join two areas into a third which involves the other two

      ```c title=" " lineNumbers=1
      void lv_area_join(lv_area_t *a_res_p, const lv_area_t *a1_p, const lv_area_t *a2_p)
      ```

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

      | Name      | Type                                                     | Description                                        |
      | --------- | -------------------------------------------------------- | -------------------------------------------------- |
      | `a_res_p` | <ApiLink name="lv_area_t" display="lv_area_t *" />       | pointer to an area, the result will be stored here |
      | `a1_p`    | <ApiLink name="lv_area_t" display="const lv_area_t *" /> | pointer to the first area                          |
      | `a2_p`    | <ApiLink name="lv_area_t" display="const lv_area_t *" /> | pointer to the second area                         |
    </ApiMember>

    <ApiMember kind="function" name="lv_area_is_point_on" file="misc/lv_area_private.h" line="72" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_area_private.h#L72">
      lv_area_is_point_on [#lv_area_is_point_on]

      Check if a point is on an area

      ```c title=" " lineNumbers=1
      bool lv_area_is_point_on(const lv_area_t *a_p, const lv_point_t *p_p, int32_t radius)
      ```

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

      | Name     | Type                                                       | Description                                 |
      | -------- | ---------------------------------------------------------- | ------------------------------------------- |
      | `a_p`    | <ApiLink name="lv_area_t" display="const lv_area_t *" />   | pointer to an area                          |
      | `p_p`    | <ApiLink name="lv_point_t" display="const lv_point_t *" /> | pointer to a point                          |
      | `radius` | <ApiLink name="int32_t" />                                 | radius of area (e.g. for rounded rectangle) |

      **Returns:** <ApiLink name="bool" /> — false:the point is out of the area
    </ApiMember>

    <ApiMember kind="function" name="lv_area_is_on" file="misc/lv_area_private.h" line="80" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_area_private.h#L80">
      lv_area_is_on [#lv_area_is_on]

      Check if two area has common parts

      ```c title=" " lineNumbers=1
      bool lv_area_is_on(const lv_area_t *a1_p, const lv_area_t *a2_p)
      ```

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

      | Name   | Type                                                     | Description             |
      | ------ | -------------------------------------------------------- | ----------------------- |
      | `a1_p` | <ApiLink name="lv_area_t" display="const lv_area_t *" /> | pointer to an area.     |
      | `a2_p` | <ApiLink name="lv_area_t" display="const lv_area_t *" /> | pointer to another area |

      **Returns:** <ApiLink name="bool" /> — false: a1\_p and a2\_p has no common parts
    </ApiMember>

    <ApiMember kind="function" name="lv_area_is_in" file="misc/lv_area_private.h" line="89" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_area_private.h#L89">
      lv_area_is_in [#lv_area_is_in]

      Check if an area is fully on another

      ```c title=" " lineNumbers=1
      bool lv_area_is_in(const lv_area_t *ain_p, const lv_area_t *aholder_p, int32_t radius)
      ```

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

      | Name        | Type                                                     | Description                                        |
      | ----------- | -------------------------------------------------------- | -------------------------------------------------- |
      | `ain_p`     | <ApiLink name="lv_area_t" display="const lv_area_t *" /> | pointer to an area which could be in 'aholder\_p'  |
      | `aholder_p` | <ApiLink name="lv_area_t" display="const lv_area_t *" /> | pointer to an area which could involve 'ain\_p'    |
      | `radius`    | <ApiLink name="int32_t" />                               | radius of `aholder_p` (e.g. for rounded rectangle) |

      **Returns:** <ApiLink name="bool" /> — true: `ain_p` is fully inside `aholder_p`
    </ApiMember>

    <ApiMember kind="function" name="lv_area_is_out" file="misc/lv_area_private.h" line="98" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_area_private.h#L98">
      lv_area_is_out [#lv_area_is_out]

      Check if an area is fully out of another

      ```c title=" " lineNumbers=1
      bool lv_area_is_out(const lv_area_t *aout_p, const lv_area_t *aholder_p, int32_t radius)
      ```

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

      | Name        | Type                                                     | Description                                        |
      | ----------- | -------------------------------------------------------- | -------------------------------------------------- |
      | `aout_p`    | <ApiLink name="lv_area_t" display="const lv_area_t *" /> | pointer to an area which could be in 'aholder\_p'  |
      | `aholder_p` | <ApiLink name="lv_area_t" display="const lv_area_t *" /> | pointer to an area which could involve 'ain\_p'    |
      | `radius`    | <ApiLink name="int32_t" />                               | radius of `aholder_p` (e.g. for rounded rectangle) |

      **Returns:** <ApiLink name="bool" /> — true: `aout_p` is fully outside `aholder_p`
    </ApiMember>

    <ApiMember kind="function" name="lv_area_is_equal" file="misc/lv_area_private.h" line="105" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_area_private.h#L105">
      lv_area_is_equal [#lv_area_is_equal]

      Check if 2 area is the same

      ```c title=" " lineNumbers=1
      bool lv_area_is_equal(const lv_area_t *a, const lv_area_t *b)
      ```

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

      | Name | Type                                                     | Description             |
      | ---- | -------------------------------------------------------- | ----------------------- |
      | `a`  | <ApiLink name="lv_area_t" display="const lv_area_t *" /> | pointer to an area      |
      | `b`  | <ApiLink name="lv_area_t" display="const lv_area_t *" /> | pointer to another area |
    </ApiMember>
  </ApiTab>
</ApiTabs>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_area.h&#x22;]" includedBy="[&#x22;lv_draw_ppa.h&#x22;, &#x22;lv_draw_ppa_private.h&#x22;, &#x22;lv_draw_nanovg_private.h&#x22;, &#x22;lv_draw_nema_gfx.h&#x22;, &#x22;lv_draw_pxp.h&#x22;, &#x22;lv_draw_sw_arm2d.h&#x22;]" transitiveIncludes="[&#x22;lv_conf_internal.h&#x22;, &#x22;lv_conf_kconfig.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_types.h&#x22;]" />
