YourGameLib
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
yourgame::util::Image Class Reference

#include <image.h>

Public Types

enum class  Layout { RGBA }
 

Public Member Functions

 Image (Image const &)=delete
 
Imageoperator= (Image const &)=delete
 
void premultiplyAlpha ()
 
void updateRaw (const uint8_t *data, int width, int height, Layout layout=Layout::RGBA)
 
const uint8_t * getData () const
 
int getWidth () const
 
int getHeight () const
 
Layout getLayout () const
 
int getNumChannels () const
 
size_t getNumDemandedBytes () const
 

Static Public Member Functions

static ImagefromMemoryEncoded (const uint8_t *data, size_t numBytes, bool flipVertically=false, Layout layoutDst=Layout::RGBA)
 
static ImagefromMemoryRaw (const uint8_t *data, int width, int height, Layout layout=Layout::RGBA)
 
static ImagefromEmpty (int width, int height, Layout layout=Layout::RGBA)
 
static std::array< int, 3 > decodeImageInfo (const uint8_t *data, size_t numBytes)
 
static int getNumChannelsFromLayout (Layout layout)
 

Member Enumeration Documentation

◆ Layout

enum class yourgame::util::Image::Layout
strong
Enumerator
RGBA 

Constructor & Destructor Documentation

◆ Image()

yourgame::util::Image::Image ( Image const &  )
delete

Member Function Documentation

◆ decodeImageInfo()

std::array< int, 3 > yourgame::util::Image::decodeImageInfo ( const uint8_t *  data,
size_t  numBytes 
)
static

◆ fromEmpty()

Image * yourgame::util::Image::fromEmpty ( int  width,
int  height,
Layout  layout = Layout::RGBA 
)
static

◆ fromMemoryEncoded()

Image * yourgame::util::Image::fromMemoryEncoded ( const uint8_t *  data,
size_t  numBytes,
bool  flipVertically = false,
Layout  layoutDst = Layout::RGBA 
)
static

◆ fromMemoryRaw()

Image * yourgame::util::Image::fromMemoryRaw ( const uint8_t *  data,
int  width,
int  height,
Layout  layout = Layout::RGBA 
)
static

◆ getData()

const uint8_t * yourgame::util::Image::getData ( ) const

◆ getHeight()

int yourgame::util::Image::getHeight ( ) const

◆ getLayout()

Image::Layout yourgame::util::Image::getLayout ( ) const

◆ getNumChannels()

int yourgame::util::Image::getNumChannels ( ) const

◆ getNumChannelsFromLayout()

int yourgame::util::Image::getNumChannelsFromLayout ( Layout  layout)
static

◆ getNumDemandedBytes()

size_t yourgame::util::Image::getNumDemandedBytes ( ) const

◆ getWidth()

int yourgame::util::Image::getWidth ( ) const

◆ operator=()

Image & yourgame::util::Image::operator= ( Image const &  )
delete

◆ premultiplyAlpha()

void yourgame::util::Image::premultiplyAlpha ( )

◆ updateRaw()

void yourgame::util::Image::updateRaw ( const uint8_t *  data,
int  width,
int  height,
Layout  layout = Layout::RGBA 
)

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