Castor3D 0.16.0
Multiplatform 3D engine
Friends | List of all members
castor::Image Class Reference

#include <Image.hpp>

Inheritance diagram for castor::Image:
Inheritance graph
[legend]
Collaboration diagram for castor::Image:
Collaboration graph
[legend]

Public Member Functions

Construction/Destruction.
CU_API Image (String const &name, Path const &path, Size const &size, PixelFormat format, ByteArray const &buffer, PixelFormat bufferFormat)
 
CU_API Image (String const &name, Path const &path, Size const &size, PixelFormat format=PixelFormat::eR8G8B8A8_UNORM, uint8_t const *buffer=nullptr, PixelFormat bufferFormat=PixelFormat::eR8G8B8A8_UNORM)
 
CU_API Image (String const &name, Path const &path, PxBufferBase const &buffer)
 
CU_API Image (String const &name, Path const &path, ImageLayout layout, PxBufferBaseUPtr buffer=nullptr)
 
template<PixelFormat PFSrc, PixelFormat PFDst>
 Image (String name, Path path, Size const &size, uint8_t const *buffer=nullptr)
 
 Image (String const &name, Size const &size, PixelFormat format, uint8_t const *buffer, PixelFormat bufferFormat)
 
 Image (String const &name, Size const &size, PixelFormat format, ByteArray const &buffer, PixelFormat bufferFormat)
 
 Image (String const &name, PxBufferBase const &buffer)
 
 Image (String const &name, ImageLayout layout, PxBufferBaseUPtr buffer)
 
virtual CU_API ~Image () noexcept=default
 
Copy/Move.
CU_API Image (Image const &image)
 
CU_API Image (Image &&image) noexcept=default
 
CU_API Imageoperator= (Image const &image)
 
CU_API Imageoperator= (Image &&image) noexcept=default
 
- Public Member Functions inherited from castor::NamedBaseT< T >
 NamedBaseT (T name) noexcept
 Constructor.
 
T const & getName () const noexcept
 Retrieves the name.
 
void rename (T name) noexcept
 

Friends

class Font
 

Modification.

CU_API PxBufferBaseUPtr updateLayerLayout (Size const &extent, PixelFormat format)
 
CU_API Imageresample (Size const &size)
 Resizes the image to the given resolution.
 
CU_API Image getResampled (Size const &size) const
 Resizes the image to the given resolution.
 
CU_API Imagefill (RgbColour const &colour)
 Fills all image pixels with the given colour.
 
CU_API Imagefill (RgbaColour const &colour)
 Fills all image pixels with the given colour.
 
CU_API ImagesetPixel (uint32_t x, uint32_t y, uint8_t const *pixel, PixelFormat format)
 Fills the wanted pixel with the given buffer.
 
CU_API ImagesetPixel (uint32_t x, uint32_t y, RgbColour const &colour)
 sets the colour of the wanted pixel to the given one
 
CU_API ImagesetPixel (uint32_t x, uint32_t y, RgbaColour const &colour)
 sets the colour of the wanted pixel to the given one
 
template<PixelFormat PF>
ImagesetPixel (uint32_t x, uint32_t y, Pixel< PF > const &pixel)
 set the wanted pixel to the given pixel
 
CU_API Imageflip ()
 Swaps the image lines.
 
uint32_t getLevels () const noexcept
 
Size getDimensions () const noexcept
 
std::size_t getSize (uint32_t level=0u) const noexcept
 
uint32_t getWidth () const noexcept
 
uint32_t getHeight () const noexcept
 
Path getPath () const noexcept
 
ImageLayout::Buffer getBuffer ()
 
ImageLayout::ConstBuffer getBuffer () const
 
ImageLayout::Buffer getBuffer (uint32_t index)
 
ImageLayout::ConstBuffer getBuffer (uint32_t index) const
 
ImageLayout::Buffer getBuffer (uint32_t index, uint32_t level)
 
ImageLayout::ConstBuffer getBuffer (uint32_t index, uint32_t level) const
 
bool hasBuffer () const noexcept
 
PxBufferBase const & getPxBuffer () const noexcept
 
PxBufferBasegetPxBuffer () noexcept
 
PxBufferBaseRPtr getPixels () const noexcept
 
ImageLayout const & getLayout () const noexcept
 
ImageLayoutgetLayout () noexcept
 
PixelFormat getPixelFormat () const noexcept
 
void initialise () const noexcept
 
void cleanup () const noexcept
 
static CU_API PxBufferBaseUPtr resample (Size const &size, PxBufferBaseUPtr buffer)
 

Additional Inherited Members

- Protected Attributes inherited from castor::NamedBaseT< T >
m_name
 

Constructor & Destructor Documentation

◆ Image() [1/11]

CU_API castor::Image::Image ( String const & name,
Path const & path,
Size const & size,
PixelFormat format,
ByteArray const & buffer,
PixelFormat bufferFormat )

◆ Image() [2/11]

CU_API castor::Image::Image ( String const & name,
Path const & path,
Size const & size,
PixelFormat format = PixelFormat::eR8G8B8A8_UNORM,
uint8_t const * buffer = nullptr,
PixelFormat bufferFormat = PixelFormat::eR8G8B8A8_UNORM )

◆ Image() [3/11]

CU_API castor::Image::Image ( String const & name,
Path const & path,
PxBufferBase const & buffer )

◆ Image() [4/11]

CU_API castor::Image::Image ( String const & name,
Path const & path,
ImageLayout layout,
PxBufferBaseUPtr buffer = nullptr )

◆ Image() [5/11]

template<PixelFormat PFSrc, PixelFormat PFDst>
castor::Image::Image ( String name,
Path path,
Size const & size,
uint8_t const * buffer = nullptr )
inline

References CU_CheckInvariants.

◆ Image() [6/11]

castor::Image::Image ( String const & name,
Size const & size,
PixelFormat format,
uint8_t const * buffer,
PixelFormat bufferFormat )
inline

◆ Image() [7/11]

castor::Image::Image ( String const & name,
Size const & size,
PixelFormat format,
ByteArray const & buffer,
PixelFormat bufferFormat )
inline

◆ Image() [8/11]

castor::Image::Image ( String const & name,
PxBufferBase const & buffer )
inline

◆ Image() [9/11]

castor::Image::Image ( String const & name,
ImageLayout layout,
PxBufferBaseUPtr buffer )
inline

◆ ~Image()

virtual CU_API castor::Image::~Image ( )
virtualdefaultnoexcept

◆ Image() [10/11]

CU_API castor::Image::Image ( Image const & image)

◆ Image() [11/11]

CU_API castor::Image::Image ( Image && image)
defaultnoexcept

Member Function Documentation

◆ cleanup()

void castor::Image::cleanup ( ) const
inlinenoexcept

◆ fill() [1/2]

CU_API Image & castor::Image::fill ( RgbaColour const & colour)

Fills all image pixels with the given colour.

Parameters
[in]colourThe fill colour
Returns
A reference to the image

◆ fill() [2/2]

CU_API Image & castor::Image::fill ( RgbColour const & colour)

Fills all image pixels with the given colour.

Parameters
[in]colourThe fill colour
Returns
A reference to the image

◆ flip()

CU_API Image & castor::Image::flip ( )

Swaps the image lines.

Returns
A reference to the image

◆ getBuffer() [1/6]

ImageLayout::Buffer castor::Image::getBuffer ( )
inline

References CU_Require, and castor::makeArrayView().

Here is the call graph for this function:

◆ getBuffer() [2/6]

ImageLayout::ConstBuffer castor::Image::getBuffer ( ) const
inline

References CU_Require, and castor::makeArrayView().

Here is the call graph for this function:

◆ getBuffer() [3/6]

ImageLayout::Buffer castor::Image::getBuffer ( uint32_t index)
inline

References CU_Require, and castor::getLayerBuffer().

Here is the call graph for this function:

◆ getBuffer() [4/6]

ImageLayout::ConstBuffer castor::Image::getBuffer ( uint32_t index) const
inline

References CU_Require, and castor::getLayerBuffer().

Here is the call graph for this function:

◆ getBuffer() [5/6]

ImageLayout::Buffer castor::Image::getBuffer ( uint32_t index,
uint32_t level )
inline

References CU_Require, and castor::getLayerMipBuffer().

Here is the call graph for this function:

◆ getBuffer() [6/6]

ImageLayout::ConstBuffer castor::Image::getBuffer ( uint32_t index,
uint32_t level ) const
inline

References CU_Require, and castor::getLayerMipBuffer().

Here is the call graph for this function:

◆ getDimensions()

Size castor::Image::getDimensions ( ) const
inlinenoexcept

◆ getHeight()

uint32_t castor::Image::getHeight ( ) const
inlinenoexcept

◆ getLayout() [1/2]

ImageLayout const & castor::Image::getLayout ( ) const
inlinenoexcept

◆ getLayout() [2/2]

ImageLayout & castor::Image::getLayout ( )
inlinenoexcept

◆ getLevels()

uint32_t castor::Image::getLevels ( ) const
inlinenoexcept

name Getters.

◆ getPath()

Path castor::Image::getPath ( ) const
inlinenoexcept

◆ getPixelFormat()

PixelFormat castor::Image::getPixelFormat ( ) const
inlinenoexcept

◆ getPixels()

PxBufferBaseRPtr castor::Image::getPixels ( ) const
inlinenoexcept

◆ getPxBuffer() [1/2]

PxBufferBase const & castor::Image::getPxBuffer ( ) const
inlinenoexcept

References CU_Require.

Referenced by castor3d::TextureSource::getBuffer(), castor3d::TextureSource::getBuffer(), and castor3d::TextureSource::hasBuffer().

Here is the caller graph for this function:

◆ getPxBuffer() [2/2]

PxBufferBase & castor::Image::getPxBuffer ( )
inlinenoexcept

References CU_Require.

◆ getResampled()

CU_API Image castor::Image::getResampled ( Size const & size) const
inline

Resizes the image to the given resolution.

Parameters
[in]sizeThe new resolution
Returns
A reference to the image

References resample().

Here is the call graph for this function:

◆ getSize()

std::size_t castor::Image::getSize ( uint32_t level = 0u) const
inlinenoexcept

◆ getWidth()

uint32_t castor::Image::getWidth ( ) const
inlinenoexcept

◆ hasBuffer()

bool castor::Image::hasBuffer ( ) const
inlinenoexcept

◆ initialise()

void castor::Image::initialise ( ) const
inlinenoexcept

◆ operator=() [1/2]

CU_API Image & castor::Image::operator= ( Image && image)
defaultnoexcept

◆ operator=() [2/2]

CU_API Image & castor::Image::operator= ( Image const & image)

◆ resample() [1/2]

CU_API Image & castor::Image::resample ( Size const & size)

Resizes the image to the given resolution.

Parameters
[in]sizeThe new resolution
Returns
A reference to the image

Referenced by getResampled().

Here is the caller graph for this function:

◆ resample() [2/2]

static CU_API PxBufferBaseUPtr castor::Image::resample ( Size const & size,
PxBufferBaseUPtr buffer )
static

◆ setPixel() [1/4]

template<PixelFormat PF>
Image & castor::Image::setPixel ( uint32_t x,
uint32_t y,
Pixel< PF > const & pixel )
inline

set the wanted pixel to the given pixel

Parameters
[in]x,yThe pixel coordinates
[in]pixelThe pixel
Returns
A reference to the image

References castor::convertPixel(), CU_CheckInvariants, CU_Require, and castor::getPixelFormat().

Here is the call graph for this function:

◆ setPixel() [2/4]

CU_API Image & castor::Image::setPixel ( uint32_t x,
uint32_t y,
RgbaColour const & colour )

sets the colour of the wanted pixel to the given one

Parameters
[in]x,yThe pixel coordinates
[in]colourThe colour
Returns
A reference to the image

◆ setPixel() [3/4]

CU_API Image & castor::Image::setPixel ( uint32_t x,
uint32_t y,
RgbColour const & colour )

sets the colour of the wanted pixel to the given one

Parameters
[in]x,yThe pixel coordinates
[in]colourThe colour
Returns
A reference to the image

◆ setPixel() [4/4]

CU_API Image & castor::Image::setPixel ( uint32_t x,
uint32_t y,
uint8_t const * pixel,
PixelFormat format )

Fills the wanted pixel with the given buffer.

Parameters
[in]x,yThe pixel coordinates
[in]pixelThe buffer
[in]formatThe buffer's pixel format
Returns
A reference to the image

◆ updateLayerLayout()

CU_API PxBufferBaseUPtr castor::Image::updateLayerLayout ( Size const & extent,
PixelFormat format )

Friends And Related Symbol Documentation

◆ Font

friend class Font
friend

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