libcamera v0.7.2 Supporting cameras in Linux since 2019

Loading...
Searching...
No Matches
libcamera::eGLImage Class Reference

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

`#include <egl.h>`

## Public Member Functions
| eGLImage (GLint format, 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
GLint | format_
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_
bool | dmabuf_import_failed_ = false

## 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 | ( | GLint | format,
|  | 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] | format | Image GL format
  [in] | width | Image width in pixels
  [in] | height | Image height in pixels
  [in] | stride | Row stride in bytes
  [in] | texture_unit | OpenGL texture unit
  [in] | texture_unit_uniform_id | Shader uniform ID

## ◆ ~eGLImage()

libcamera::eGLImage::~eGLImage | ( |  | ) |
| inline

Destroy the eGLImage.

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

## Member Data Documentation

## ◆ dmabuf_import_failed_

bool libcamera::eGLImage::dmabuf_import_failed_ = false

Previous image import failed

## ◆ fbo_

GLuint libcamera::eGLImage::fbo_

OpenGL frame buffer object ID

## ◆ format_

GLint libcamera::eGLImage::format_

Image GL format

## ◆ framesize_

uint32_t libcamera::eGLImage::framesize_

Total frame size in bytes (stride * height)

## ◆ height_

uint32_t libcamera::eGLImage::height_

Image height in pixels

## ◆ 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:

- include/libcamera/internal/egl.h