Berserk
|
Hardware-independent image representation. More...
#include <Image.hpp>
Public Types | |
enum class | FileFormat { Png , Jpg , Bmp } |
Formats to save image. More... | |
using | Format = RHITextureFormat |
Public Member Functions | |
BRK_API | Image ()=default |
BRK_API | Image (uint32 width, uint32 height, Format format) |
BRK_API | Image (uint32 width, uint32 height, uint32 stride, uint32 pixelSize, Format format, Ref< Data > pixelData) |
BRK_API | Image (const Image &)=default |
BRK_API | Image (Image &&) noexcept=default |
BRK_API | ~Image ()=default |
BRK_API Image & | operator= (const Image &)=default |
BRK_API Image & | operator= (Image &&) noexcept=default |
BRK_API Image | Resize (uint32 newWidth, uint32 newHeight) const |
BRK_API bool | Empty () const |
BRK_API uint32 | GetWidth () const |
BRK_API uint32 | GetHeight () const |
BRK_API uint32 | GetStride () const |
BRK_API uint32 | GetPixelSize () const |
BRK_API uint32 | GetSizeBytes () const |
BRK_API Format | GetFormat () const |
BRK_API const Ref< Data > & | GetPixelData () const |
BRK_API bool | SaveRgba (const String &filepath, FileFormat fileFormat, int quality=100) const |
Save rgba image to the file. More... | |
Static Public Member Functions | |
static BRK_API Image | LoadRgba (const String &path, uint32 channels=4) |
Load rgba image from the disc. More... | |
Hardware-independent image representation.
Image class allows to load/save image data, get access to the pixels, manipulate, transform, change data, pass pixel data to rendering-hardware for the rendering.
using Image::Format = RHITextureFormat |
|
strong |
|
default |
BRK_NS_BEGIN Image::Image | ( | uint32 | width, |
uint32 | height, | ||
Format | format | ||
) |
Image::Image | ( | uint32 | width, |
uint32 | height, | ||
uint32 | stride, | ||
uint32 | pixelSize, | ||
Format | format, | ||
Ref< Data > | pixelData | ||
) |
|
default |
|
inline |
Load rgba image from the disc.
path | Path to the image file |
channels | Number of channels to load; must be within {1,2,3,4} |
bool Image::SaveRgba | ( | const String & | filepath, |
FileFormat | fileFormat, | ||
int | quality = 100 |
||
) | const |