Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::IndexedUIntBuffer Class Referencefinal

A general unsigned integer buffer for integers with any number of bits. More...

#include <IndexedUIntBuffer.h>

Public Member Functions

 IndexedUIntBuffer ()
 
void declareUIntFormat (std::size_t numBitsPerUInt)
 
void declareUIntFormatByMaxValue (uint64 maxValue)
 
template<std::integral IntegerType>
void declareUIntFormat ()
 
void allocate (std::size_t numUInts)
 
template<std::integral IntegerType>
void setUInt (std::size_t index, IntegerType value)
 Set a single integer.
 
template<typename ValueType >
void setUInts (const ValueType *values, std::size_t numValues, std::size_t dstBeginValueIndex=0)
 Set integers to a range of indices. This method handles all types, including both integer and floating-point types. If ValueType matches the buffer's integer format (unsigned and with same bit count), it will be a direct memory copy.
 
void setUInts (const std::byte *srcBytes, std::size_t numBytes, std::size_t dstOffset=0)
 
uint64 getUInt (std::size_t index) const
 
std::size_t numUInts () const
 
std::size_t memoryUsage () const
 
bool isAllocated () const
 
uint64 getMaxAllowedValue () const
 
std::byte * getData ()
 Access to the underlying raw byte buffer.
 
const std::byte * getData () const
 

Detailed Description

A general unsigned integer buffer for integers with any number of bits.

Constructor & Destructor Documentation

◆ IndexedUIntBuffer()

ph::IndexedUIntBuffer::IndexedUIntBuffer ( )

Member Function Documentation

◆ allocate()

void ph::IndexedUIntBuffer::allocate ( std::size_t numUInts)

◆ declareUIntFormat() [1/2]

template<std::integral IntegerType>
void ph::IndexedUIntBuffer::declareUIntFormat ( )
inline

◆ declareUIntFormat() [2/2]

void ph::IndexedUIntBuffer::declareUIntFormat ( std::size_t numBitsPerUInt)

◆ declareUIntFormatByMaxValue()

void ph::IndexedUIntBuffer::declareUIntFormatByMaxValue ( uint64 maxValue)

◆ getData() [1/2]

std::byte * ph::IndexedUIntBuffer::getData ( )
inline

Access to the underlying raw byte buffer.

◆ getData() [2/2]

const std::byte * ph::IndexedUIntBuffer::getData ( ) const
inline

◆ getMaxAllowedValue()

uint64 ph::IndexedUIntBuffer::getMaxAllowedValue ( ) const
inline
Returns
The largest possible integer that can be stored in this buffer.

◆ getUInt()

uint64 ph::IndexedUIntBuffer::getUInt ( std::size_t index) const
inline

◆ isAllocated()

bool ph::IndexedUIntBuffer::isAllocated ( ) const
inline

◆ memoryUsage()

std::size_t ph::IndexedUIntBuffer::memoryUsage ( ) const
inline

◆ numUInts()

std::size_t ph::IndexedUIntBuffer::numUInts ( ) const
inline

◆ setUInt()

template<std::integral IntegerType>
void ph::IndexedUIntBuffer::setUInt ( std::size_t index,
IntegerType value )
inline

Set a single integer.

◆ setUInts() [1/2]

void ph::IndexedUIntBuffer::setUInts ( const std::byte * srcBytes,
std::size_t numBytes,
std::size_t dstOffset = 0 )

◆ setUInts() [2/2]

template<typename ValueType >
void ph::IndexedUIntBuffer::setUInts ( const ValueType * values,
std::size_t numValues,
std::size_t dstBeginValueIndex = 0 )
inline

Set integers to a range of indices. This method handles all types, including both integer and floating-point types. If ValueType matches the buffer's integer format (unsigned and with same bit count), it will be a direct memory copy.


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