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

#include <PictureData.h>

Public Member Functions

 PictureData ()
 Creates an empty picture.
 
 PictureData (math::Vector2S sizePx, std::size_t numPicComponents, EPicturePixelComponent componentType)
 Creates a picture with allocated buffer. Use setPixels(const PixelData*, std::size_t) to supply pixel data.
 
template<typename PixelData >
 PictureData (math::Vector2S sizePx, std::size_t numPicComponents, EPicturePixelComponent componentType, const PixelData *pixelData, std::size_t pixelDataSize)
 Creates a picture filled with pixel data.
 
 PictureData (PictureData &&other)
 
const math::Vector2SgetSizePx () const
 
std::size_t getWidthPx () const
 
std::size_t getHeightPx () const
 
std::size_t numComponents () const
 
EPicturePixelComponent getComponentType () const
 
TSpan< std::byte > getBytes ()
 
TSpanView< std::byte > getBytes () const
 
bool isEmpty () const
 
template<typename PixelData >
void setPixels (const PixelData *pixelData, std::size_t numPixelDataElements)
 Set pixel data directly. This method also supports packed pixel data. For example, if RGBA is packed into an int32, PixelData would be int32 which can contain 4 components. It is up to the user to provide suitably-sized pixelData.
 
template<typename FrameComponent , std::size_t N>
TFrame< FrameComponent, N > toFrame () const
 
PictureDataoperator= (PictureData &&rhs)
 

Detailed Description

Raw data storage of a picture. Has limited ability on pixel data manipulation. It is recommended to convert to TFrame via toFrame() for operations on pixel data.

Constructor & Destructor Documentation

◆ PictureData() [1/4]

ph::PictureData::PictureData ( )
inline

Creates an empty picture.

◆ PictureData() [2/4]

ph::PictureData::PictureData ( math::Vector2S sizePx,
std::size_t numPicComponents,
EPicturePixelComponent componentType )
inline

Creates a picture with allocated buffer. Use setPixels(const PixelData*, std::size_t) to supply pixel data.

◆ PictureData() [3/4]

template<typename PixelData >
ph::PictureData::PictureData ( math::Vector2S sizePx,
std::size_t numPicComponents,
EPicturePixelComponent componentType,
const PixelData * pixelData,
std::size_t pixelDataSize )
inline

Creates a picture filled with pixel data.

◆ PictureData() [4/4]

ph::PictureData::PictureData ( PictureData && other)
inline

Member Function Documentation

◆ getBytes() [1/2]

TSpan< std::byte > ph::PictureData::getBytes ( )
inline

◆ getBytes() [2/2]

TSpanView< std::byte > ph::PictureData::getBytes ( ) const
inline

◆ getComponentType()

EPicturePixelComponent ph::PictureData::getComponentType ( ) const
inline

◆ getHeightPx()

std::size_t ph::PictureData::getHeightPx ( ) const
inline

◆ getSizePx()

const math::Vector2S & ph::PictureData::getSizePx ( ) const
inline

◆ getWidthPx()

std::size_t ph::PictureData::getWidthPx ( ) const
inline

◆ isEmpty()

bool ph::PictureData::isEmpty ( ) const
inline

◆ numComponents()

std::size_t ph::PictureData::numComponents ( ) const
inline

◆ operator=()

PictureData & ph::PictureData::operator= ( PictureData && rhs)
inline

◆ setPixels()

template<typename PixelData >
void ph::PictureData::setPixels ( const PixelData * pixelData,
std::size_t numPixelDataElements )
inline

Set pixel data directly. This method also supports packed pixel data. For example, if RGBA is packed into an int32, PixelData would be int32 which can contain 4 components. It is up to the user to provide suitably-sized pixelData.

◆ toFrame()

template<typename FrameComponent , std::size_t N>
TFrame< FrameComponent, N > ph::PictureData::toFrame ( ) const
inline

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