API Documentation
Public Member Functions | List of all members
nkImages::ImageView Class Referencefinal

Holds all information required for an image, with no ownership over the data. More...

Inheritance diagram for nkImages::ImageView:
nkImages::ImageBase

Public Member Functions

 ImageView () noexcept=delete
 
 ImageView (const Image &image) noexcept
 
 ImageView (const nkMemory::BufferView< unsigned char > &dataView) noexcept
 
 ImageView (const nkMemory::BufferView< unsigned char > dataView, unsigned int width, unsigned int height, unsigned int depth, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize=0, unsigned int rowByteSize=0, unsigned int sliceByteSize=0) noexcept
 
 ImageView (const nkMemory::BufferView< unsigned char > dataView, unsigned int width, unsigned int height, unsigned int depth, unsigned int arraySize, unsigned int mips, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize=0) noexcept
 
 ImageView (const ImageView &other) noexcept
 
 ImageView (const ImageView &other, unsigned int slice) noexcept
 
 ImageView (const ImageView &other, unsigned int slice, unsigned int mip) noexcept
 
 ImageView (ImageView &&other) noexcept
 
virtual ~ImageView ()
 
virtual unsigned char * getDataPtr () const override
 
virtual unsigned long long getDataByteSize () const override
 
virtual nkMemory::BufferView getDataBuffer () const override
 
virtual bool isView () const override
 
ImageViewoperator= (const ImageView &other) noexcept
 
ImageViewoperator= (ImageView &&other) noexcept
 
- Public Member Functions inherited from nkImages::ImageBase
 ImageBase () noexcept
 
 ImageBase (unsigned int width, unsigned int height, unsigned int depth, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize=0, unsigned int rowByteSize=0, unsigned int sliceByteSize=0) noexcept
 
 ImageBase (unsigned int width, unsigned int height, unsigned int depth, unsigned int arraySize, unsigned int mips, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize=0) noexcept
 
 ImageBase (nkMemory::BufferCast< ImageDescriptor > &&images, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize, bool alphaPremultiplied=false, bool cubeMap=false) noexcept
 
 ImageBase (const ImageBase &other) noexcept
 
 ImageBase (ImageBase &&other) noexcept
 
virtual ~ImageBase ()
 
unsigned int getWidth (unsigned int mip=0u) const
 
unsigned int getHeight (unsigned int mip=0u) const
 
unsigned int getDepthOrArraySize (unsigned int mip=0u) const
 
unsigned int getMipCount () const
 
PIXEL_FORMAT getFormat () const
 
unsigned int getPixelByteSize () const
 
unsigned int getRowByteSize (unsigned int mip=0u) const
 
unsigned int getSliceByteSize (unsigned int mip=0u) const
 
bool getAlphaPremultiplied () const
 
bool getCubeMap () const
 
bool isArray () const
 
void setFormat (PIXEL_FORMAT value)
 
void setPixelOrBlockByteSize (unsigned int value)
 
void setAlphaPremultiplied (bool value)
 
void setCubeMap (bool value)
 
nkMaths::Vector getPixel (unsigned int x, unsigned int y, unsigned int z=0u, unsigned int mip=0u) const
 
void setPixel (nkMaths::Vector v, unsigned int x, unsigned int y, unsigned int z=0u, unsigned int mip=0u)
 
Image decompress (const AlignmentDescriptor &alignmentDescriptor=AlignmentDescriptor()) const
 
ImageBaseoperator= (const ImageBase &other) noexcept
 
ImageBaseoperator= (ImageBase &&other) noexcept
 

Detailed Description

Holds all information required for an image, with no ownership over the data.

See ImageBase for more information.

Constructor & Destructor Documentation

◆ ImageView() [1/9]

nkImages::ImageView::ImageView ( )
deletenoexcept

Default constructor.

◆ ImageView() [2/9]

nkImages::ImageView::ImageView ( const Image image)
noexcept

View over image constructor.

Parameters
imageThe image to create a view over.

◆ ImageView() [3/9]

nkImages::ImageView::ImageView ( const nkMemory::BufferView< unsigned char > &  dataView)
noexcept

Data view constructor.

Parameters
dataViewThe view which data should be part of the image.

◆ ImageView() [4/9]

nkImages::ImageView::ImageView ( const nkMemory::BufferView< unsigned char >  dataView,
unsigned int  width,
unsigned int  height,
unsigned int  depth,
PIXEL_FORMAT  format,
unsigned int  pixelOrBlockByteSize = 0,
unsigned int  rowByteSize = 0,
unsigned int  sliceByteSize = 0 
)
noexcept

Aligned 2D image constructor.

Parameters
dataViewThe view over the data which should be part of the image.
widthThe width of the image, in pixels.
heightThe height of the image, in pixels.
depthThe depth of the image, in number of slices of width * height images.
formatThe format of the image.
pixelOrBlockByteSizeThe size of a pixel, in bytes.
rowByteSizeThe size of a row, in bytes.
sliceByteSizeThe size of a slice, in bytes.

◆ ImageView() [5/9]

nkImages::ImageView::ImageView ( const nkMemory::BufferView< unsigned char >  dataView,
unsigned int  width,
unsigned int  height,
unsigned int  depth,
unsigned int  arraySize,
unsigned int  mips,
PIXEL_FORMAT  format,
unsigned int  pixelOrBlockByteSize = 0 
)
noexcept

Tightly packed full constructor. Will derive all information for slices and mips based on width, height, depth and format given / pixelOrBlockSize given. Memory will be assumed as being tightly packed (no padding inside).

Parameters
dataViewThe view over the data which should be part of the image.
widthThe width of the image, in pixels.
heightThe height of the image, in pixels.
depthThe depth of the image, in number of slices of width * height images.
arraySizeThe number of slice in the image array.
mipsThe number of mips for each image slice.
formatThe pixel format of the image.
pixelOrBlockByteSizeThe size of a pixel or block, in bytes. Defaults to 0 to be automatically derived from the format.

◆ ImageView() [6/9]

nkImages::ImageView::ImageView ( const ImageView other)
noexcept

Copy constructor. Note that no memory will be copied, only a new view over it will be created.

Parameters
otherThe view to copy over.

◆ ImageView() [7/9]

nkImages::ImageView::ImageView ( const ImageView other,
unsigned int  slice 
)
noexcept

View over array slice constructor.

Parameters
otherThe view to take the slice view from.
sliceThe index of the slice to take a view over.

◆ ImageView() [8/9]

nkImages::ImageView::ImageView ( const ImageView other,
unsigned int  slice,
unsigned int  mip 
)
noexcept

View over array slice's mip constructor.

Parameters
otherThe view to take the slice view from.
sliceThe index of the slice to take a view over.
mipThe mip to take a view over.

◆ ImageView() [9/9]

nkImages::ImageView::ImageView ( ImageView &&  other)
noexcept

Move constructor.

Parameters
otherThe view to move.

◆ ~ImageView()

virtual nkImages::ImageView::~ImageView ( )
virtual

Destructor.

Member Function Documentation

◆ getDataPtr()

virtual unsigned char* nkImages::ImageView::getDataPtr ( ) const
overridevirtual
Returns
A pointer over the image data.

Implements nkImages::ImageBase.

◆ getDataByteSize()

virtual unsigned long long nkImages::ImageView::getDataByteSize ( ) const
overridevirtual
Returns
The total byte size of the image buffer.

Implements nkImages::ImageBase.

◆ getDataBuffer()

virtual nkMemory::BufferView nkImages::ImageView::getDataBuffer ( ) const
overridevirtual
Returns
A view over the raw image data.

Implements nkImages::ImageBase.

◆ isView()

virtual bool nkImages::ImageView::isView ( ) const
overridevirtual
Returns
Whether the image is a view over the data without ownership (true) or not (false).

Implements nkImages::ImageBase.

◆ operator=() [1/2]

ImageView& nkImages::ImageView::operator= ( const ImageView other)
noexcept

Copy assignment operator.

Parameters
otherThe view to copy and assign.

◆ operator=() [2/2]

ImageView& nkImages::ImageView::operator= ( ImageView &&  other)
noexcept

Move assignment operator.

Parameters
otherThe view to move and assign.

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