HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
tt::PixelMap< T > Struct Template Reference

#include <TTauri/Foundation/PixelMap.hpp>

Public Member Functions

 PixelMap () noexcept
 Construct an empty pixel-map.
 
 PixelMap (T *pixels, ssize_t width, ssize_t height, ssize_t stride) noexcept
 Construct an pixel-map from memory received from an API.
 
 gsl_suppress (r.11) PixelMap(ssize_t width
 Construct an pixel-map.
 
ssize_t height width (width)
 
ssize_t height height (height)
 
ssize_t height stride (width)
 
ssize_t height selfAllocated (true)
 
 PixelMap (ivec extent) noexcept
 Construct an pixel-map.
 
 PixelMap (T *pixels, ssize_t width, ssize_t height) noexcept
 Construct an pixel-map from memory received from an API.
 
 PixelMap (T *pixels, ivec extent) noexcept
 Construct an pixel-map from memory received from an API.
 
 PixelMap (T *pixels, ivec extent, ssize_t stride) noexcept
 Construct an pixel-map from memory received from an API.
 
 gsl_suppress2 (r.11, i.11) ~PixelMap()
 
 PixelMap (PixelMap const &other)=delete
 Disallowing copying so that life-time of selfAllocated pixels is easy to understand.
 
PixelMap copy () const noexcept
 
 PixelMap (PixelMap &&other) noexcept
 
 operator bool () const noexcept
 
PixelMapoperator= (PixelMap const &other)=delete
 Disallowing copying so that life-time of selfAllocated pixels is easy to understand.
 

Data Fields

T * pixels
 Pointer to a 2D canvas of pixels.
 
ssize_t width
 Number of horizontal pixels.
 
ssize_t height
 Number of vertical pixels.
 
ssize_t stride
 Number of pixel element until the next row.
 
bool selfAllocated = false
 True if the memory was allocated by this class, false if the canvas was received from another API.
 
ssize_t height noexcept: pixels(new T[width * height])
 

Detailed Description

template<typename T>
struct tt::PixelMap< T >

A 2D canvas of pixels.

This class may either allocate its own memory, or gives access to memory allocated by another API, such as a Vulkan texture.

Constructor & Destructor Documentation

◆ PixelMap() [1/7]

template<typename T >
tt::PixelMap< T >::PixelMap ( )
inlinenoexcept

Construct an empty pixel-map.

◆ PixelMap() [2/7]

template<typename T >
tt::PixelMap< T >::PixelMap ( T * pixels,
ssize_t width,
ssize_t height,
ssize_t stride )
inlinenoexcept

Construct an pixel-map from memory received from an API.

Parameters
pixelA pointer to pixels received from the API.
widthThe width of the image.
heightThe height of the image.
strideNumber of pixel elements until the next row.

◆ PixelMap() [3/7]

template<typename T >
tt::PixelMap< T >::PixelMap ( ivec extent)
inlinenoexcept

Construct an pixel-map.

This constructor will allocate its own memory.

Parameters
extentThe width and height of the image.

◆ PixelMap() [4/7]

template<typename T >
tt::PixelMap< T >::PixelMap ( T * pixels,
ssize_t width,
ssize_t height )
inlinenoexcept

Construct an pixel-map from memory received from an API.

Parameters
pixelA pointer to pixels received from the API.
widthThe width of the image.
heightThe height of the image.

◆ PixelMap() [5/7]

template<typename T >
tt::PixelMap< T >::PixelMap ( T * pixels,
ivec extent )
inlinenoexcept

Construct an pixel-map from memory received from an API.

Parameters
pixelA pointer to pixels received from the API.
extentThe width and height of the image.

◆ PixelMap() [6/7]

template<typename T >
tt::PixelMap< T >::PixelMap ( T * pixels,
ivec extent,
ssize_t stride )
inlinenoexcept

Construct an pixel-map from memory received from an API.

Parameters
pixelA pointer to pixels received from the API.
extentThe width and height of the image.
strideNumber of pixel elements until the next row.

◆ PixelMap() [7/7]

template<typename T >
tt::PixelMap< T >::PixelMap ( PixelMap< T > const & other)
delete

Disallowing copying so that life-time of selfAllocated pixels is easy to understand.

Member Function Documentation

◆ gsl_suppress()

template<typename T >
tt::PixelMap< T >::gsl_suppress ( r. 11)

Construct an pixel-map.

This constructor will allocate its own memory.

Parameters
widthThe width of the image.
heightThe height of the image.

◆ operator=()

template<typename T >
PixelMap & tt::PixelMap< T >::operator= ( PixelMap< T > const & other)
delete

Disallowing copying so that life-time of selfAllocated pixels is easy to understand.

Field Documentation

◆ height

template<typename T >
ssize_t tt::PixelMap< T >::height

Number of vertical pixels.

◆ pixels

template<typename T >
T* tt::PixelMap< T >::pixels

Pointer to a 2D canvas of pixels.

◆ selfAllocated

template<typename T >
bool tt::PixelMap< T >::selfAllocated = false

True if the memory was allocated by this class, false if the canvas was received from another API.

◆ stride

template<typename T >
ssize_t tt::PixelMap< T >::stride

Number of pixel element until the next row.

This is used when the alignment of each row is different from the width of the canvas.

◆ width

template<typename T >
ssize_t tt::PixelMap< T >::width

Number of horizontal pixels.


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