Raylib C++  1.0.0
Encapsulates the raylib library
Static Public Member Functions | List of all members
raylib::helper::ImageHelper Class Reference

Helper class for image manipulation NOTE: Image software-rendering functions (CPU) More...

#include <ImageHelper.hpp>

Collaboration diagram for raylib::helper::ImageHelper:
Collaboration graph

Static Public Member Functions

static raylib::image::RlImage load (const std::string &fileName)
 Load image from file into CPU memory (RAM) More...
 
static raylib::image::RlImage loadRaw (const std::string &fileName, int width, int height, int format, int headerSize)
 Load image from RAW file data. More...
 
static raylib::image::RlImage loadAnim (const std::string &fileName)
 Load image sequence from file (frames appended to image.data) More...
 
static raylib::image::RlImage loadFromMemory (const std::string &fileType, const unsigned char *fileData, int dataSize)
 Load image from memory buffer. More...
 
static raylib::image::RlImage loadFromTexture (const Texture2D &texture)
 Load image from GPU texture data. More...
 
static raylib::image::RlImage loadFromScreen ()
 Load image from screen buffer and (screenshot) More...
 
static raylib::image::RlImage fromText (const std::string &text, int fontSize, const RlColor &color)
 Create an image from text (default font) More...
 
static raylib::image::RlImage fromText (const raylib::text::RlFont &font, const std::string &text, float fontSize, float spacing, const RlColor &tint)
 Create an image from text (custom sprite font) More...
 
static raylib::image::RlImage genImageFontAtlas (const GlyphInfo *chars, Rectangle **recs, int glyphCount, int fontSize, int padding, int packMethod)
 Create an image from font (custom sprite font) More...
 

Detailed Description

Helper class for image manipulation NOTE: Image software-rendering functions (CPU)

Member Function Documentation

◆ fromText() [1/2]

raylib::image::RlImage raylib::helper::ImageHelper::fromText ( const raylib::text::RlFont font,
const std::string &  text,
float  fontSize,
float  spacing,
const RlColor tint 
)
static

Create an image from text (custom sprite font)

Parameters
fontthe font
textthe text
fontSizethe font size
spacingthe spacing
tintthe tint
Returns
the image
Here is the call graph for this function:

◆ fromText() [2/2]

raylib::image::RlImage raylib::helper::ImageHelper::fromText ( const std::string &  text,
int  fontSize,
const RlColor color 
)
static

Create an image from text (default font)

Parameters
textthe text
fontSizethe font size
colorthe color
Returns
the image
Here is the call graph for this function:

◆ genImageFontAtlas()

raylib::image::RlImage raylib::helper::ImageHelper::genImageFontAtlas ( const GlyphInfo *  chars,
Rectangle **  recs,
int  glyphCount,
int  fontSize,
int  padding,
int  packMethod 
)
static

Create an image from font (custom sprite font)

Parameters
charsthe chars
recsthe recs
glyphCountthe glyph count
fontSizethe font size
paddingthe padding
packMethodthe pack method
Returns
the image

◆ load()

raylib::image::RlImage raylib::helper::ImageHelper::load ( const std::string &  fileName)
static

Load image from file into CPU memory (RAM)

Parameters
fileNamethe file name
Returns
the image

◆ loadAnim()

raylib::image::RlImage raylib::helper::ImageHelper::loadAnim ( const std::string &  fileName)
static

Load image sequence from file (frames appended to image.data)

Parameters
fileNamethe file name
Returns
the image

◆ loadFromMemory()

raylib::image::RlImage raylib::helper::ImageHelper::loadFromMemory ( const std::string &  fileType,
const unsigned char *  fileData,
int  dataSize 
)
static

Load image from memory buffer.

Parameters
fileTypethe file type
fileDatathe file data
dataSizethe data size
Returns
the image

◆ loadFromScreen()

raylib::image::RlImage raylib::helper::ImageHelper::loadFromScreen ( )
static

Load image from screen buffer and (screenshot)

Returns
the image

◆ loadFromTexture()

raylib::image::RlImage raylib::helper::ImageHelper::loadFromTexture ( const Texture2D &  texture)
static

Load image from GPU texture data.

Parameters
texturethe texture
Returns
the image

◆ loadRaw()

raylib::image::RlImage raylib::helper::ImageHelper::loadRaw ( const std::string &  fileName,
int  width,
int  height,
int  format,
int  headerSize 
)
static

Load image from RAW file data.

Parameters
fileNamethe file name
widththe width
heightthe height
formatthe format
headerSizethe header size
Returns
the image

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