lv_opengles_private.h

API reference for lv_opengles_private.h

Report on GitHub

Functions

lv_opengles_render_params_init

Initialize the render parameters with default values

 
void lv_opengles_render_params_init(lv_opengles_render_params_t *params)
Parameters
NameTypeDescription
paramslv_opengles_render_params_t *pointer to an initialized lv_opengles_render_params_t struct

lv_opengles_render

Render the content of the window/framebuffer using OpenGL

 
void lv_opengles_render(const lv_opengles_render_params_t *params)
Parameters
NameTypeDescription
paramsconst lv_opengles_render_params_t *pointer to an initialized lv_opengles_render_params_t struct

lv_opengles_render_texture_cf

Render a texture holding pixels of an LVGL color format, using alternate blending mode. The channel order and the grayscale handling are derived from cf.

 
void lv_opengles_render_texture_cf(unsigned int texture, const lv_area_t *texture_area, lv_opa_t opa, int32_t disp_w, int32_t disp_h, const lv_area_t *texture_clip_area, bool h_flip, bool v_flip, lv_color_format_t cf)
Parameters
NameTypeDescription
textureunsigned intOpenGL texture ID
texture_areaconst lv_area_t *the area in the window to render the texture in
opalv_opa_topacity to blend the texture with existing contents
disp_wint32_twidth of the window/framebuffer being rendered to
disp_hint32_theight of the window/framebuffer being rendered to
texture_clip_areaconst lv_area_t *the area of the texture to draw
h_flipboolhorizontal flip
v_flipboolvertical flip
cflv_color_format_tthe LVGL color format the texture was uploaded from

lv_opengles_regular_viewport

Set the OpenGL viewport, with vertical co-ordinate conversion

 
void lv_opengles_regular_viewport(int32_t x, int32_t y, int32_t w, int32_t h)
Parameters
NameTypeDescription
xint32_tx position of the viewport
yint32_ty position of the viewport
wint32_twidth of the viewport
hint32_theight of the viewport

lv_opengles_render_display

 
void lv_opengles_render_display(lv_display_t *display, const lv_opengles_render_params_t *params)
Parameters

lv_opengles_render_texture_internal

 
void lv_opengles_render_texture_internal(unsigned int texture, const lv_area_t *texture_area, lv_opa_t opa, int32_t disp_w, int32_t disp_h, const lv_area_t *texture_clip_area, bool h_flip, bool v_flip)
Parameters
NameType
textureunsigned int
texture_areaconst lv_area_t *
opalv_opa_t
disp_wint32_t
disp_hint32_t
texture_clip_areaconst lv_area_t *
h_flipbool
v_flipbool

lv_opengles_render_display_texture_internal

 
void lv_opengles_render_display_texture_internal(lv_display_t *display, bool h_flip, bool v_flip)
Parameters
NameType
displaylv_display_t *
h_flipbool
v_flipbool

lv_opengles_gl_format_from_color_format

Get the glTexImage2D arguments to upload a buffer of an LVGL color format with

 
lv_result_t lv_opengles_gl_format_from_color_format(lv_color_format_t cf, lv_opengles_gl_format_t *gl_format)
Parameters
NameTypeDescription
cflv_color_format_tthe LVGL color format
gl_formatlv_opengles_gl_format_t *pointer to the struct to fill

Returns: lv_result_t — LV_RESULT_OK on success, LV_RESULT_INVALID if cf has no OpenGL equivalent

lv_opengles_color_format_is_rb_swap

 
bool lv_opengles_color_format_is_rb_swap(lv_color_format_t cf)
Parameters

lv_opengles_color_format_is_premultiplied

 
bool lv_opengles_color_format_is_premultiplied(lv_color_format_t cf)
Parameters

lv_opengles_texture_upload_buf

Upload a pixel buffer into an OpenGL texture

 
lv_result_t lv_opengles_texture_upload_buf(unsigned int texture_id, const void *buf, int32_t w, int32_t h, uint32_t stride, lv_color_format_t cf)
Parameters
NameTypeDescription
texture_idunsigned intthe OpenGL texture ID to upload into
bufconst void *the pixel buffer. May be NULL.. Can be NULL to only define the size and the format
wint32_twidth of the buffer in pixels
hint32_theight of the buffer in pixels
strideuint32_tstride of the buffer in bytes. Ignored when buf is NULL
cflv_color_format_tthe LVGL color format of the buffer

Returns: lv_result_t — LV_RESULT_OK on success, LV_RESULT_INVALID if cf has no OpenGL equivalent

lv_opengles_texture_upload_display_buf

Upload the rendered buffer of a display into an OpenGL texture. The size and the color format are taken from the display.

 
lv_result_t lv_opengles_texture_upload_display_buf(unsigned int texture_id, lv_display_t *display, const void *buf)
Parameters
NameTypeDescription
texture_idunsigned intthe OpenGL texture ID to upload into
displaylv_display_t *the display the buffer belongs to
bufconst void *the pixel buffer. May be NULL.. Can be NULL to only define the size and the format

Returns: lv_result_t — LV_RESULT_OK on success, LV_RESULT_INVALID if the color format of the display has no OpenGL equivalent

Structs

struct

lv_opengles_render_params_t

MemberTypeDescription
textureunsigned int
texture_areaconst lv_area_t *
opalv_opa_t
disp_wint32_t
disp_hint32_t
texture_clip_areaconst lv_area_t *
h_flipbool
v_flipbool
rb_swapbool
fill_colorlv_color_t
blend_optbool
matrixconst lv_matrix_t *
cflv_color_format_t
Used by 3 functions
  • lv_opengles_render_params_init — param params
  • lv_opengles_render — param params
  • lv_opengles_render_display — param params
struct

lv_opengles_gl_format_t

The glTexImage2D arguments describing an LVGL color format

MemberTypeDescription
internal_formatint32_tthe internalformat argument of glTexImage2D
formatuint32_tthe format argument of glTexImage2D
typeuint32_tthe type argument of glTexImage2D
rb_swapboolthe red and blue channels have to be swapped while rendering
premultipliedboolthe color channels are multiplied with the alpha channel already
Used by 1 function
  • lv_opengles_gl_format_from_color_format — param gl_format

Macros

GL_BGRA

 
#define GL_BGRA GL_BGRA_EXT

GL_TEXTURE_MAX_LEVEL

 
#define GL_TEXTURE_MAX_LEVEL GL_TEXTURE_MAX_LEVEL_APPLE

GL_UNPACK_ROW_LENGTH

 
#define GL_UNPACK_ROW_LENGTH GL_UNPACK_ROW_LENGTH_EXT

glGenVertexArrays

 
#define glGenVertexArrays glGenVertexArraysOES

glBindVertexArray

 
#define glBindVertexArray glBindVertexArrayOES

glDeleteVertexArrays

 
#define glDeleteVertexArrays glDeleteVertexArraysOES

glTexStorage2D

 
#define glTexStorage2D glTexStorage2DEXT

GL_RGBA32F

 
#define GL_RGBA32F 0x8814

GL_NUM_EXTENSIONS

 
#define GL_NUM_EXTENSIONS 0x821D

GL_RGB8

 
#define GL_RGB8 0x8051

GL_RGBA8

 
#define GL_RGBA8 0x8058

GL_R8

 
#define GL_R8 GL_LUMINANCE

GL_RED

 
#define GL_RED GL_LUMINANCE

LV_GL_PREFERRED_DEPTH

 
#define LV_GL_PREFERRED_DEPTH GL_DEPTH_COMPONENT16

Dependencies

Last updated on

On this page