Skip to content

Struct cuvis_imbuffer_t

ClassList > cuvis_imbuffer_t

image buffer data structure with meta-data More...

  • #include <cuvis.h>

Public Attributes

Type Name
uint32_t bytes
uint16_t channels
CUVIS_IMBUFFER_FORMAT format
the buffer format
uint32_t height
uint32_t length
uint8_t const * raw
uint32_t const * wavelength
the wavelength vector
uint32_t width

Detailed Description

The image buffer data structure holds a anonymous raw data pointer, that can be interpreted to give a meaningful data array with the help of the other members: The format gives the information of the data type, the width, length, and channels give the number of elements in the array.

The wavelength property is only set for hyperspectral cubes but not for normal images. If it exists, it is an array with the number of channels

Example:

// format = CUVIS_IMBUFFER_FORMAT_UINT16
// x in [0, width)
// y in [0,   height)
// chn in [0, channels)
unsigned index = (y * width + x) * channels + chn;
uint16_t value = ((uint16_t*) raw)[index];
unsigned lambda = cube.wavelength[chn];

see also: IMBUFFER_GET

Public Attributes Documentation

variable bytes

uint32_t cuvis_imbuffer_t::bytes;

number of bytes per data element


variable channels

uint16_t cuvis_imbuffer_t::channels;

number of channels


variable format

the buffer format

CUVIS_IMBUFFER_FORMAT cuvis_imbuffer_t::format;

The buffer format defines what the member raw can be casted into.


variable height

uint32_t cuvis_imbuffer_t::height;

height of buffer


variable length

uint32_t cuvis_imbuffer_t::length;

total number of bytes in array


variable raw

uint8_t const* cuvis_imbuffer_t::raw;

the memory reference of the cube. Valid as long as the parent element (e.g. measurement) is valid and unchanged.


variable wavelength

the wavelength vector

uint32_t const* cuvis_imbuffer_t::wavelength;

If the cuvis_imbuffer_t is not a hyperspectral cube, the value will be nullptr For cubes this is an array of length channels, the elements define the cube's wavelength in nanometers.


variable width

uint32_t cuvis_imbuffer_t::width;

width of buffer



The documentation for this class was generated from the following file docs/_api_sources/cuvis.h