HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions
tt::pixel_map< T > Class Template Reference

#include <ttauri/pixel_map.hpp>

Public Member Functions

 pixel_map () noexcept
 Construct an empty pixel-map.
 
 pixel_map (T *pixels, ssize_t width, ssize_t height, ssize_t stride) noexcept
 Construct an pixel-map from memory received from an API.
 
 pixel_map (T *pixels, ssize_t width, ssize_t height) noexcept
 Construct an pixel-map from memory received from an API.
 
 pixel_map (ssize_t width, ssize_t height, ssize_t stride) noexcept
 Construct an pixel-map from memory received from an API.
 
 pixel_map (ssize_t width, ssize_t height) noexcept
 Construct an pixel-map from memory received from an API.
 
 pixel_map (pixel_map const &other)=delete
 Disallowing copying so that life-time of selfAllocated pixels is easy to understand.
 
pixel_map copy () const noexcept
 
 pixel_map (pixel_map &&other) noexcept
 
 operator bool () const noexcept
 
ssize_t width () const noexcept
 
ssize_t height () const noexcept
 
ssize_t stride () const noexcept
 
size_t hash () const noexcept
 
pixel_mapoperator= (pixel_map const &other)=delete
 Disallowing copying so that life-time of selfAllocated pixels is easy to understand.
 
pixel_mapoperator= (pixel_map &&other) noexcept
 
extent2 extent () const noexcept
 
pixel_map submap (ssize_t x, ssize_t y, ssize_t width, ssize_t height) const noexcept
 Get a (smaller) view of the map.
 
pixel_map submap (aarectangle rectangle) const noexcept
 
pixel_row< T > const operator[] (ssize_t rowNr) const noexcept
 
pixel_row< T > operator[] (ssize_t rowNr) noexcept
 
pixel_row< T > const at (ssize_t rowNr) const noexcept
 
pixel_row< T > at (ssize_t rowNr) noexcept
 
void update_hash () noexcept
 Update the hash value of the pixmap.
 

Detailed Description

template<typename T>
class tt::pixel_map< 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

◆ pixel_map() [1/6]

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

Construct an empty pixel-map.

◆ pixel_map() [2/6]

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

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

Parameters
pixelsA 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.

◆ pixel_map() [3/6]

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

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

Parameters
pixelsA 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.

◆ pixel_map() [4/6]

template<typename T >
tt::pixel_map< T >::pixel_map ( ssize_t width,
ssize_t height,
ssize_t stride )
inlinenoexcept

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

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

◆ pixel_map() [5/6]

template<typename T >
tt::pixel_map< T >::pixel_map ( ssize_t width,
ssize_t height )
inlinenoexcept

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

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

◆ pixel_map() [6/6]

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

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

Member Function Documentation

◆ operator=()

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

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

◆ submap()

template<typename T >
pixel_map tt::pixel_map< T >::submap ( ssize_t x,
ssize_t y,
ssize_t width,
ssize_t height ) const
inlinenoexcept

Get a (smaller) view of the map.

Parameters
xx-offset in the current pixel-map
yy-offset in the current pixel-map
widthwidth of the returned image.
heightheight of the returned image.
Returns
A new pixel-map that point to the same memory as the current pixel-map.

◆ update_hash()

template<typename T >
void tt::pixel_map< T >::update_hash ( )
inlinenoexcept

Update the hash value of the pixmap.

Since this is an expensive operation the calculation must be called explicitly.


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