libcamera v0.7.0+1-4ceceb68
Supporting cameras in Linux since 2019
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
libcamera::eGLImage Class Reference

Helper class for managing EGL image resources. More...

#include <egl.h>

Public Member Functions

 eGLImage (uint32_t width, uint32_t height, uint32_t stride, GLenum texture_unit, uint32_t texture_unit_uniform_id)
 Construct an eGLImage with explicit stride.
 
 ~eGLImage ()
 Destroy the eGLImage.
 

Public Attributes

uint32_t width_
 
uint32_t height_
 
uint32_t stride_
 
uint32_t offset_
 
uint32_t framesize_
 
uint32_t texture_unit_uniform_id_
 
GLenum texture_unit_
 
GLuint texture_
 
GLuint fbo_
 
EGLImageKHR image_
 

Detailed Description

Helper class for managing EGL image resources.

The eGLImage class encapsulates OpenGL ES texture and framebuffer objects along with their associated EGL image. It aggregates handles, descriptors, and routines for managing textures that can be associated with shader uniform IDs.

This class is particularly useful for managing DMA-BUF backed textures in zero-copy rendering pipelines, where textures are bound to specific texture units and can be used as both input textures and render targets.

Constructor & Destructor Documentation

◆ eGLImage()

libcamera::eGLImage::eGLImage ( uint32_t  width,
uint32_t  height,
uint32_t  stride,
GLenum  texture_unit,
uint32_t  texture_unit_uniform_id 
)
inline

Construct an eGLImage with explicit stride.

Parameters
[in]widthImage width in pixels
[in]heightImage height in pixels
[in]strideRow stride in bytes
[in]texture_unitOpenGL texture unit
[in]texture_unit_uniform_idShader uniform ID

◆ ~eGLImage()

libcamera::eGLImage::~eGLImage ( )
inline

Destroy the eGLImage.

Cleans up OpenGL resources by deleting the framebuffer object and texture.

Member Data Documentation

◆ fbo_

GLuint libcamera::eGLImage::fbo_

OpenGL frame buffer object ID

◆ framesize_

uint32_t libcamera::eGLImage::framesize_

Total frame size in bytes (stride * height)

◆ height_

uint32_t libcamera::eGLImage::height_

Image height in pixels

◆ image_

EGLImageKHR libcamera::eGLImage::image_

EGL Image handle

◆ offset_

uint32_t libcamera::eGLImage::offset_

Buffer offset (reserved for future use)

◆ stride_

uint32_t libcamera::eGLImage::stride_

Row stride in bytes

◆ texture_

GLuint libcamera::eGLImage::texture_

OpenGL texture object ID

◆ texture_unit_

GLenum libcamera::eGLImage::texture_unit_

Texture unit associated with this image eg (GL_TEXTURE0)

◆ texture_unit_uniform_id_

uint32_t libcamera::eGLImage::texture_unit_uniform_id_

Shader uniform id for texture unit

◆ width_

uint32_t libcamera::eGLImage::width_

Image width in pixels


The documentation for this class was generated from the following file: