CppNCorr
C++ ncorr Digital Image Correlation engine
Loading...
Searching...
No Matches
ncorr::ImageBuffer Struct Reference

Thin, non-owning view over a raw image in memory. More...

#include <session.h>

Public Member Functions

 ImageBuffer ()=default
 Default-construct an empty (invalid) buffer.
 
 ImageBuffer (const std::uint8_t *data_, int width_, int height_, int channels_=1)
 Construct an image buffer view.
 
bool valid () const
 
std::size_t size_bytes () const
 

Public Attributes

const std::uint8_t * data = nullptr
 Pointer to the first byte of the (row-major, interleaved) pixel data.
 
int width = 0
 Image width in pixels.
 
int height = 0
 Image height in pixels.
 
int channels = 1
 Number of interleaved channels per pixel (1 = grayscale, 3 = BGR, ...).
 

Detailed Description

Thin, non-owning view over a raw image in memory.

Wraps a contiguous pixel buffer plus its geometry. The buffer is interpreted as row-major, with channels interleaved per pixel (e.g. BGR for 3-channel data, matching OpenCV's default layout). 8-bit unsigned samples are assumed.

The struct does NOT own data; the caller must keep the underlying storage alive for the duration of any call that receives the ImageBuffer.

Definition at line 40 of file session.h.

Constructor & Destructor Documentation

◆ ImageBuffer() [1/2]

ncorr::ImageBuffer::ImageBuffer ( )
default

Default-construct an empty (invalid) buffer.

◆ ImageBuffer() [2/2]

ncorr::ImageBuffer::ImageBuffer ( const std::uint8_t *  data_,
int  width_,
int  height_,
int  channels_ = 1 
)
inline

Construct an image buffer view.

Parameters
data_Pointer to row-major interleaved 8-bit pixel data.
width_Width in pixels.
height_Height in pixels.
channels_Channels per pixel (default 1 = grayscale).

Definition at line 60 of file session.h.

Member Function Documentation

◆ size_bytes()

std::size_t ncorr::ImageBuffer::size_bytes ( ) const
inline
Returns
total number of bytes the buffer is expected to span.

Definition at line 67 of file session.h.

◆ valid()

bool ncorr::ImageBuffer::valid ( ) const
inline
Returns
true if the buffer is non-null and has positive dimensions.

Definition at line 64 of file session.h.

Member Data Documentation

◆ channels

int ncorr::ImageBuffer::channels = 1

Number of interleaved channels per pixel (1 = grayscale, 3 = BGR, ...).

Definition at line 48 of file session.h.

◆ data

const std::uint8_t* ncorr::ImageBuffer::data = nullptr

Pointer to the first byte of the (row-major, interleaved) pixel data.

Definition at line 42 of file session.h.

◆ height

int ncorr::ImageBuffer::height = 0

Image height in pixels.

Definition at line 46 of file session.h.

◆ width

int ncorr::ImageBuffer::width = 0

Image width in pixels.

Definition at line 44 of file session.h.


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