Image Utils#

namespace trt_edgellm
namespace rt
namespace imageUtils

Enums

enum class InterpolationMode#

Interpolation filter for :func:resizeImage.

Values:

enumerator kLINEAR#

Bilinear.

enumerator kBICUBIC#

Catmull-Rom cubic.

class ImageData#
#include <imageUtils.h>

Image data container (image or video frame stack)

Wraps a uint8 RGB tensor with the unified 4D layout [frames, height, width, channels]. Single still images are represented as frames == 1; video frame stacks have frames > 1. Channels must be 3.

Public Functions

ImageData() noexcept = default#

Default constructor (creates uninitialized ImageData)

ImageData(rt::Tensor &&data)#

Construct image data.

Parameters:

data – Image tensor with shape [T, H, W, C]. Single-frame still images use T=1.

Throws:

std::runtime_error – if tensor content not UINT8, tensor shape not 4D, or number of channels not 3

unsigned char *data() const noexcept#

Get raw image data pointer.

Returns:

Pointer to image data

inline int64_t bytesPerFrame() const noexcept#

Bytes occupied by a single frame (height * width * channels), assuming UINT8 storage.

Returns:

Byte count per frame.

Public Members

std::shared_ptr<rt::Tensor> buffer#

Image data buffer (4D [T, H, W, C], UINT8, channels == 3)

int64_t width = {0}#

Image width.

int64_t height = {0}#

Image height.

int64_t channels = {0}#

Number of channels (e.g., 3 for RGB)

int64_t frames = {1}#

Number of frames (T). 1 for static images, >1 for video.

double fps = {1.0}#

Video sample fps (used to compute MRoPE timestamps); ignored when frames == 1.