# lv_gltf_data_internal.h (/api/libs/gltf/gltf_data/lv_gltf_data_internal_h)



<ApiSummary functions="9" structs="5" />

Functions [#functions]

<ApiTabs items="[&#x22;Getters (2)&#x22;,&#x22;Other (7)&#x22;]">
  <ApiTab value="Getters (2)">
    <ApiMember kind="function" name="lv_gltf_get_compiled_shader" file="libs/gltf/gltf_data/lv_gltf_data_internal.h" line="190" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_data/lv_gltf_data_internal.h#L190">
      lv_gltf_get_compiled_shader [#lv_gltf_get_compiled_shader]

      ```c title=" " lineNumbers=1
      lv_gltf_compiled_shader_t * lv_gltf_get_compiled_shader(lv_gltf_model_t *data, size_t identifier)
      ```

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

      | Name         | Type                                                           |
      | ------------ | -------------------------------------------------------------- |
      | `data`       | <ApiLink name="lv_gltf_model_t" display="lv_gltf_model_t *" /> |
      | `identifier` | <ApiLink name="size_t" />                                      |
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_data_get_radius" file="libs/gltf/gltf_data/lv_gltf_data_internal.h" line="198" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_data/lv_gltf_data_internal.h#L198">
      lv_gltf_data_get_radius [#lv_gltf_data_get_radius]

      Retrieve the radius of the GLTF data object.

      ```c title=" " lineNumbers=1
      double lv_gltf_data_get_radius(const lv_gltf_model_t *model)
      ```

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

      | Name    | Type                                                                 |
      | ------- | -------------------------------------------------------------------- |
      | `model` | <ApiLink name="lv_gltf_model_t" display="const lv_gltf_model_t *" /> |

      **Returns:** `double` — The radius of the GLTF data object.
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (7)">
    <ApiMember kind="function" name="lv_gltf_uniform_locations_create" file="libs/gltf/gltf_data/lv_gltf_data_internal.h" line="182" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_data/lv_gltf_data_internal.h#L182">
      lv_gltf_uniform_locations_create [#lv_gltf_uniform_locations_create]

      ```c title=" " lineNumbers=1
      lv_gltf_uniform_locations_t lv_gltf_uniform_locations_create(GLuint program)
      ```

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

      | Name      | Type     |
      | --------- | -------- |
      | `program` | `GLuint` |
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_store_compiled_shader" file="libs/gltf/gltf_data/lv_gltf_data_internal.h" line="189" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_data/lv_gltf_data_internal.h#L189">
      lv_gltf_store_compiled_shader [#lv_gltf_store_compiled_shader]

      ```c title=" " lineNumbers=1
      void lv_gltf_store_compiled_shader(lv_gltf_model_t *data, size_t identifier, lv_gltf_compiled_shader_t *shader)
      ```

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

      | Name         | Type                                                                               |
      | ------------ | ---------------------------------------------------------------------------------- |
      | `data`       | <ApiLink name="lv_gltf_model_t" display="lv_gltf_model_t *" />                     |
      | `identifier` | <ApiLink name="size_t" />                                                          |
      | `shader`     | <ApiLink name="lv_gltf_compiled_shader_t" display="lv_gltf_compiled_shader_t *" /> |
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_data_copy_bounds_info" file="libs/gltf/gltf_data/lv_gltf_data_internal.h" line="207" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_data/lv_gltf_data_internal.h#L207">
      lv_gltf_data_copy_bounds_info [#lv_gltf_data_copy_bounds_info]

      Copy the bounds information from one GLTF data object to another.

      ```c title=" " lineNumbers=1
      void lv_gltf_data_copy_bounds_info(lv_gltf_model_t *to, lv_gltf_model_t *from)
      ```

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

      | Name   | Type                                                           | Description                                          |
      | ------ | -------------------------------------------------------------- | ---------------------------------------------------- |
      | `to`   | <ApiLink name="lv_gltf_model_t" display="lv_gltf_model_t *" /> | Pointer to the destination lv\_gltf\_data\_t object. |
      | `from` | <ApiLink name="lv_gltf_model_t" display="lv_gltf_model_t *" /> | Pointer to the source lv\_gltf\_data\_t object.      |
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_data_rgb_to_bgr" file="libs/gltf/gltf_data/lv_gltf_data_internal.h" line="216" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_data/lv_gltf_data_internal.h#L216">
      lv_gltf_data_rgb_to_bgr [#lv_gltf_data_rgb_to_bgr]

      Swap the red and blue channels in a pixel buffer.

      ```c title=" " lineNumbers=1
      void lv_gltf_data_rgb_to_bgr(uint8_t *pixel_buffer, size_t byte_total_count, bool has_alpha)
      ```

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

      | Name               | Type                                           | Description                                                         |
      | ------------------ | ---------------------------------------------- | ------------------------------------------------------------------- |
      | `pixel_buffer`     | <ApiLink name="uint8_t" display="uint8_t *" /> | Pointer to the pixel buffer containing the image data.              |
      | `byte_total_count` | <ApiLink name="size_t" />                      | The total number of bytes in the pixel buffer.                      |
      | `has_alpha`        | <ApiLink name="bool" />                        | Flag indicating whether the pixel buffer includes an alpha channel. |
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_model_add_viewer" file="libs/gltf/gltf_data/lv_gltf_data_internal.h" line="220" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_data/lv_gltf_data_internal.h#L220">
      lv_gltf_model_add_viewer [#lv_gltf_model_add_viewer]

      ```c title=" " lineNumbers=1
      lv_result_t lv_gltf_model_add_viewer(lv_gltf_model_t *model, lv_obj_t *viewer)
      ```

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

      | Name     | Type                                                           |
      | -------- | -------------------------------------------------------------- |
      | `model`  | <ApiLink name="lv_gltf_model_t" display="lv_gltf_model_t *" /> |
      | `viewer` | <ApiLink name="lv_obj_t" display="lv_obj_t *" />               |
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_model_remove_viewer" file="libs/gltf/gltf_data/lv_gltf_data_internal.h" line="221" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_data/lv_gltf_data_internal.h#L221">
      lv_gltf_model_remove_viewer [#lv_gltf_model_remove_viewer]

      ```c title=" " lineNumbers=1
      void lv_gltf_model_remove_viewer(lv_gltf_model_t *model, lv_obj_t *target_viewer)
      ```

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

      | Name            | Type                                                           |
      | --------------- | -------------------------------------------------------------- |
      | `model`         | <ApiLink name="lv_gltf_model_t" display="lv_gltf_model_t *" /> |
      | `target_viewer` | <ApiLink name="lv_obj_t" display="lv_obj_t *" />               |
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_model_invalidate" file="libs/gltf/gltf_data/lv_gltf_data_internal.h" line="222" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_data/lv_gltf_data_internal.h#L222">
      lv_gltf_model_invalidate [#lv_gltf_model_invalidate]

      ```c title=" " lineNumbers=1
      void lv_gltf_model_invalidate(lv_gltf_model_t *model)
      ```

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

      | Name    | Type                                                           |
      | ------- | -------------------------------------------------------------- |
      | `model` | <ApiLink name="lv_gltf_model_t" display="lv_gltf_model_t *" /> |
    </ApiMember>
  </ApiTab>
</ApiTabs>

Structs [#structs]

<ApiMember kind="struct" name="IndirectDrawCommand">
  IndirectDrawCommand [#indirectdrawcommand]

  | Member          | Type     | Description |
  | --------------- | -------- | ----------- |
  | `count`         | `GLuint` |             |
  | `instanceCount` | `GLuint` |             |
  | `firstIndex`    | `GLuint` |             |
  | `baseVertex`    | `GLint`  |             |
  | `baseInstance`  | `GLuint` |             |
</ApiMember>

<ApiMember kind="struct" name="lv_gltf_primitive_t">
  lv_gltf_primitive_t [#lv_gltf_primitive_t]

  | Member                                  | Type                                   | Description |
  | --------------------------------------- | -------------------------------------- | ----------- |
  | `draw`                                  | <ApiLink name="IndirectDrawCommand" /> |             |
  | `primitiveType`                         | `GLenum`                               |             |
  | `indexType`                             | `GLenum`                               |             |
  | `vertexArray`                           | `GLuint`                               |             |
  | `vertexBuffer`                          | `GLuint`                               |             |
  | `indexBuffer`                           | `GLuint`                               |             |
  | `materialUniformsIndex`                 | `GLuint`                               |             |
  | `albedoTexture`                         | `GLuint`                               |             |
  | `emissiveTexture`                       | `GLuint`                               |             |
  | `metalRoughTexture`                     | `GLuint`                               |             |
  | `occlusionTexture`                      | `GLuint`                               |             |
  | `normalTexture`                         | `GLuint`                               |             |
  | `diffuseTransmissionTexture`            | `GLuint`                               |             |
  | `diffuseTransmissionColorTexture`       | `GLuint`                               |             |
  | `transmissionTexture`                   | `GLuint`                               |             |
  | `transmissionTexcoordIndex`             | `GLuint`                               |             |
  | `baseColorTexcoordIndex`                | `GLint`                                |             |
  | `emissiveTexcoordIndex`                 | `GLint`                                |             |
  | `metallicRoughnessTexcoordIndex`        | `GLint`                                |             |
  | `occlusionTexcoordIndex`                | `GLint`                                |             |
  | `normalTexcoordIndex`                   | `GLint`                                |             |
  | `diffuseTransmissionTexcoordIndex`      | `GLint`                                |             |
  | `diffuseTransmissionColorTexcoordIndex` | `GLint`                                |             |
  | `clearcoatTexture`                      | `GLint`                                |             |
  | `clearcoatRoughnessTexture`             | `GLint`                                |             |
  | `clearcoatNormalTexture`                | `GLint`                                |             |
  | `clearcoatTexcoordIndex`                | `GLint`                                |             |
  | `clearcoatRoughnessTexcoordIndex`       | `GLint`                                |             |
  | `clearcoatNormalTexcoordIndex`          | `GLint`                                |             |
  | `thicknessTexture`                      | `GLuint`                               |             |
  | `thicknessTexcoordIndex`                | `GLint`                                |             |
  | `diffuseTexture`                        | `GLuint`                               |             |
  | `diffuseTexcoordIndex`                  | `GLint`                                |             |
  | `specularGlossinessTexture`             | `GLuint`                               |             |
  | `specularGlossinessTexcoordIndex`       | `GLint`                                |             |
</ApiMember>

<ApiMember kind="struct" name="lv_gltf_uniform_locations_t">
  lv_gltf_uniform_locations_t [#lv_gltf_uniform_locations_t]

  | Member                                    | Type    | Description |
  | ----------------------------------------- | ------- | ----------- |
  | `camera`                                  | `GLint` |             |
  | `view_projection_matrix`                  | `GLint` |             |
  | `model_matrix`                            | `GLint` |             |
  | `view_matrix`                             | `GLint` |             |
  | `projection_matrix`                       | `GLint` |             |
  | `env_intensity`                           | `GLint` |             |
  | `env_diffuse_sampler`                     | `GLint` |             |
  | `env_specular_sampler`                    | `GLint` |             |
  | `env_sheen_sampler`                       | `GLint` |             |
  | `env_ggx_lut_sampler`                     | `GLint` |             |
  | `env_charlie_lut_sampler`                 | `GLint` |             |
  | `env_mip_count`                           | `GLint` |             |
  | `exposure`                                | `GLint` |             |
  | `roughness_factor`                        | `GLint` |             |
  | `base_color_factor`                       | `GLint` |             |
  | `base_color_sampler`                      | `GLint` |             |
  | `base_color_uv_set`                       | `GLint` |             |
  | `base_color_uv_transform`                 | `GLint` |             |
  | `emissive_factor`                         | `GLint` |             |
  | `emissive_sampler`                        | `GLint` |             |
  | `emissive_uv_set`                         | `GLint` |             |
  | `emissive_uv_transform`                   | `GLint` |             |
  | `emissive_strength`                       | `GLint` |             |
  | `metallic_factor`                         | `GLint` |             |
  | `metallic_roughness_sampler`              | `GLint` |             |
  | `metallic_roughness_uv_set`               | `GLint` |             |
  | `metallic_roughness_uv_transform`         | `GLint` |             |
  | `occlusion_strength`                      | `GLint` |             |
  | `occlusion_sampler`                       | `GLint` |             |
  | `occlusion_uv_set`                        | `GLint` |             |
  | `occlusion_uv_transform`                  | `GLint` |             |
  | `normal_scale`                            | `GLint` |             |
  | `normal_sampler`                          | `GLint` |             |
  | `normal_uv_set`                           | `GLint` |             |
  | `normal_uv_transform`                     | `GLint` |             |
  | `clearcoat_factor`                        | `GLint` |             |
  | `clearcoat_roughness_factor`              | `GLint` |             |
  | `clearcoat_sampler`                       | `GLint` |             |
  | `clearcoat_uv_set`                        | `GLint` |             |
  | `clearcoat_uv_transform`                  | `GLint` |             |
  | `clearcoat_roughness_sampler`             | `GLint` |             |
  | `clearcoat_roughness_uv_set`              | `GLint` |             |
  | `clearcoat_roughness_uv_transform`        | `GLint` |             |
  | `clearcoat_normal_scale`                  | `GLint` |             |
  | `clearcoat_normal_sampler`                | `GLint` |             |
  | `clearcoat_normal_uv_set`                 | `GLint` |             |
  | `clearcoat_normal_uv_transform`           | `GLint` |             |
  | `thickness`                               | `GLint` |             |
  | `thickness_sampler`                       | `GLint` |             |
  | `thickness_uv_set`                        | `GLint` |             |
  | `thickness_uv_transform`                  | `GLint` |             |
  | `diffuse_transmission_sampler`            | `GLint` |             |
  | `diffuse_transmission_uv_set`             | `GLint` |             |
  | `diffuse_transmission_uv_transform`       | `GLint` |             |
  | `diffuse_transmission_color_sampler`      | `GLint` |             |
  | `diffuse_transmission_color_uv_set`       | `GLint` |             |
  | `diffuse_transmission_color_uv_transform` | `GLint` |             |
  | `sheen_color_factor`                      | `GLint` |             |
  | `sheen_roughness_factor`                  | `GLint` |             |
  | `specular_color_factor`                   | `GLint` |             |
  | `specular_factor`                         | `GLint` |             |
  | `diffuse_transmission_color_factor`       | `GLint` |             |
  | `diffuse_transmission_factor`             | `GLint` |             |
  | `ior`                                     | `GLint` |             |
  | `alpha_cutoff`                            | `GLint` |             |
  | `dispersion`                              | `GLint` |             |
  | `screen_size`                             | `GLint` |             |
  | `transmission_factor`                     | `GLint` |             |
  | `transmission_sampler`                    | `GLint` |             |
  | `transmission_uv_set`                     | `GLint` |             |
  | `transmission_uv_transform`               | `GLint` |             |
  | `transmission_framebuffer_sampler`        | `GLint` |             |
  | `transmission_framebuffer_size`           | `GLint` |             |
  | `attenuation_distance`                    | `GLint` |             |
  | `attenuation_color`                       | `GLint` |             |
  | `joints_sampler`                          | `GLint` |             |
  | `diffuse_factor`                          | `GLint` |             |
  | `glossiness_factor`                       | `GLint` |             |
  | `diffuse_sampler`                         | `GLint` |             |
  | `diffuse_uv_set`                          | `GLint` |             |
  | `diffuse_uv_transform`                    | `GLint` |             |
  | `specular_glossiness_sampler`             | `GLint` |             |
  | `specular_glossiness_uv_set`              | `GLint` |             |
  | `specular_glossiness_uv_transform`        | `GLint` |             |
</ApiMember>

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

  | Member         | Type                       | Description |
  | -------------- | -------------------------- | ----------- |
  | `textures_map` | <ApiLink name="lv_rb_t" /> |             |
</ApiMember>

<ApiMember kind="struct" name="lv_gltf_compiled_shader_t">
  lv_gltf_compiled_shader_t [#lv_gltf_compiled_shader_t]

  | Member     | Type                                           | Description |
  | ---------- | ---------------------------------------------- | ----------- |
  | `uniforms` | <ApiLink name="lv_gltf_uniform_locations_t" /> |             |
  | `program`  | `GLuint`                                       |             |
</ApiMember>

<TypeUsedBy name="lv_gltf_compiled_shader_t" count="1">
  * `lv_gltf_store_compiled_shader` — param `shader`
</TypeUsedBy>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_conf_internal.h&#x22;, &#x22;lv_opengl_shader_internal.h&#x22;, &#x22;lv_types.h&#x22;]" includedBy="[&#x22;lv_gltf_data_internal.hpp&#x22;, &#x22;lv_gltf_view_internal.h&#x22;]" transitiveIncludes="[&#x22;lv_area.h&#x22;, &#x22;lv_assert.h&#x22;, &#x22;lv_color.h&#x22;, &#x22;lv_color_op.h&#x22;, &#x22;lv_conf_kconfig.h&#x22;, &#x22;lv_log.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_mem.h&#x22;, &#x22;lv_opengles_debug.h&#x22;, &#x22;lv_opengles_private.h&#x22;, &#x22;lv_palette.h&#x22;, &#x22;lv_rb.h&#x22;, &#x22;lv_rb_private.h&#x22;, &#x22;lv_string.h&#x22;]" />
