raylib-cpp
C++ object-oriented wrapper library for raylib.
Public Member Functions | Static Public Member Functions | List of all members
raylib::Image Class Reference

Public Member Functions

 Image ()
 
 Image (::Image image)
 
 Image (::Texture2D texture)
 
 Image (const std::string &fileName)
 
 Image (const std::string &fileName, int *frames)
 
 Image (const std::string &fileName, int width, int height, int format, int headerSize)
 
 Image (int width, int height, Color color=WHITE)
 
 ~Image ()
 
Image & AlphaCrop (float threshold)
 
Image & AlphaMask (Image alphaMask)
 
Image & AlphaPremultiply ()
 
Image & ClearBackground (::Color color=WHITE)
 
Image & ColorBrightness (int brightness)
 
Image & ColorContrast (float contrast)
 
Image & ColorGrayscale ()
 
Image & ColorInvert ()
 
Image & ColorReplace (::Color color, ::Color replace)
 
Image & ColorTint (::Color color=WHITE)
 
Image Copy ()
 
Image & Crop (::Rectangle crop)
 
Image & Dither (int rBpp, int gBpp, int bBpp, int aBpp)
 
Image & Draw (::Image &src, ::Rectangle srcRec, ::Rectangle dstRec, ::Color tint=WHITE)
 
Image & DrawCircle (::Vector2 center, int radius, ::Color color)
 
Image & DrawCircle (int centerX, int centerY, int radius, ::Color color)
 
Image & DrawLine (::Vector2 start, ::Vector2 end, ::Color color)
 
Image & DrawLine (int startPosX, int startPosY, int endPosX, int endPosY, ::Color color)
 
Image & DrawPixel (::Vector2 position, ::Color color)
 
Image & DrawPixel (int posX, int posY, ::Color color)
 
Image & DrawRectangle (::Rectangle rec, ::Color color=WHITE)
 
Image & DrawRectangle (int posX, int posY, int width, int height, ::Color color=WHITE)
 
Image & DrawRectangle (Vector2 position, Vector2 size, ::Color color=WHITE)
 
Image & DrawRectangleLines (::Rectangle rec, int thick, ::Color color)
 
Image & DrawText (::Font font, const std::string &text, ::Vector2 position, float fontSize, float spacing, ::Color tint=WHITE)
 
Image & DrawText (const std::string &text, ::Vector2 position, int fontSize, ::Color color=WHITE)
 
Image & DrawText (const std::string &text, int x, int y, int fontSize, ::Color color=WHITE)
 
Image & Export (const std::string &fileName)
 
Image & ExportAsCode (const std::string &fileName)
 
Image & FlipHorizontal ()
 
Image & FlipVertical ()
 
Image & Format (int newFormat)
 
Image FromImage (::Rectangle rec)
 
Rectangle GetAlphaBorder (float threshold)
 
void * GetData ()
 
int GetFormat ()
 
int GetHeight ()
 
inline ::Color * GetImageData ()
 
inline ::Vector4 * GetImageDataNormalized ()
 
int GetMipmaps ()
 
inline ::Color * GetPalette (int maxPaletteSize, int *extractCount)
 
int GetWidth ()
 
void Load (const std::string &fileName)
 
void LoadAnim (const std::string &fileName, int *frames)
 
void LoadRaw (const std::string &fileName, int width, int height, int format, int headerSize)
 
Image & Mipmaps ()
 
 operator Texture2D ()
 
Image & operator= (const ::Image &image)
 
Image & operator= (const Image &image)
 
Image & Resize (int newWidth, int newHeight)
 
Image & ResizeCanvas (int newWidth, int newHeight, int offsetX, int offsetY, Color color)
 
Image & ResizeNN (int newWidth, int newHeight)
 
Image & RotateCCW ()
 
Image & RotateCW ()
 
void set (::Image image)
 
void SetData (void *value)
 
void SetFormat (int value)
 
void SetHeight (int value)
 
void SetMipmaps (int value)
 
void SetWidth (int value)
 
Image & ToPOT (Color fillColor)
 
void Unload ()
 

Static Public Member Functions

static Image GenCellular (int width, int height, int tileSize)
 
static Image GenChecked (int width, int height, int checksX, int checksY, Color col1, Color col2)
 
static Image GenColor (int width, int height, Color color)
 
static Image GenGradientH (int width, int height, Color left, Color right)
 
static Image GenGradientRadial (int width, int height, float density, Color inner, Color outer)
 
static Image GenGradientV (int width, int height, Color top, Color bottom)
 
static Image GenPerlinNoise (int width, int height, int offsetX, int offsetY, float scale)
 
static Image GenWhiteNoise (int width, int height, float factor)
 
static Image GetScreenData ()
 
static Image Text (Font font, std::string text, float fontSize, float spacing, Color tint)
 
static Image Text (std::string text, int fontSize, Color color)
 

Detailed Description

Definition at line 16 of file Image.hpp.

Constructor & Destructor Documentation

◆ Image() [1/7]

raylib::Image::Image ( )
inline

Definition at line 18 of file Image.hpp.

Referenced by GetScreenData().

◆ Image() [2/7]

raylib::Image::Image ( ::Image  image)
inline

Definition at line 19 of file Image.hpp.

References set().

◆ Image() [3/7]

raylib::Image::Image ( const std::string &  fileName)
inline

Definition at line 22 of file Image.hpp.

References Load().

◆ Image() [4/7]

raylib::Image::Image ( const std::string &  fileName,
int  width,
int  height,
int  format,
int  headerSize 
)
inline

Definition at line 25 of file Image.hpp.

References LoadRaw().

◆ Image() [5/7]

raylib::Image::Image ( const std::string &  fileName,
int *  frames 
)
inline

Definition at line 28 of file Image.hpp.

References LoadAnim().

◆ Image() [6/7]

raylib::Image::Image ( ::Texture2D  texture)
inline

Definition at line 31 of file Image.hpp.

References set().

◆ Image() [7/7]

raylib::Image::Image ( int  width,
int  height,
Color  color = WHITE 
)
inline

Definition at line 34 of file Image.hpp.

References set().

◆ ~Image()

raylib::Image::~Image ( )
inline

Definition at line 82 of file Image.hpp.

References Unload().

Member Function Documentation

◆ AlphaCrop()

Image& raylib::Image::AlphaCrop ( float  threshold)
inline

Definition at line 157 of file Image.hpp.

◆ AlphaMask()

Image& raylib::Image::AlphaMask ( Image  alphaMask)
inline

Definition at line 152 of file Image.hpp.

◆ AlphaPremultiply()

Image& raylib::Image::AlphaPremultiply ( )
inline

Definition at line 162 of file Image.hpp.

◆ ClearBackground()

Image& raylib::Image::ClearBackground ( ::Color  color = WHITE)
inline

Definition at line 242 of file Image.hpp.

◆ ColorBrightness()

Image& raylib::Image::ColorBrightness ( int  brightness)
inline

Definition at line 225 of file Image.hpp.

◆ ColorContrast()

Image& raylib::Image::ColorContrast ( float  contrast)
inline

Definition at line 221 of file Image.hpp.

◆ ColorGrayscale()

Image& raylib::Image::ColorGrayscale ( )
inline

Definition at line 217 of file Image.hpp.

◆ ColorInvert()

Image& raylib::Image::ColorInvert ( )
inline

Definition at line 213 of file Image.hpp.

◆ ColorReplace()

Image& raylib::Image::ColorReplace ( ::Color  color,
::Color  replace 
)
inline

Definition at line 229 of file Image.hpp.

◆ ColorTint()

Image& raylib::Image::ColorTint ( ::Color  color = WHITE)
inline

Definition at line 209 of file Image.hpp.

◆ Copy()

Image raylib::Image::Copy ( )
inline

Definition at line 135 of file Image.hpp.

◆ Crop()

Image& raylib::Image::Crop ( ::Rectangle  crop)
inline

Definition at line 167 of file Image.hpp.

◆ Dither()

Image& raylib::Image::Dither ( int  rBpp,
int  gBpp,
int  bBpp,
int  aBpp 
)
inline

Definition at line 187 of file Image.hpp.

◆ Draw()

Image& raylib::Image::Draw ( ::Image &  src,
::Rectangle  srcRec,
::Rectangle  dstRec,
::Color  tint = WHITE 
)
inline

Definition at line 292 of file Image.hpp.

◆ DrawCircle() [1/2]

Image& raylib::Image::DrawCircle ( ::Vector2  center,
int  radius,
::Color  color 
)
inline

Definition at line 272 of file Image.hpp.

◆ DrawCircle() [2/2]

Image& raylib::Image::DrawCircle ( int  centerX,
int  centerY,
int  radius,
::Color  color 
)
inline

Definition at line 267 of file Image.hpp.

◆ DrawLine() [1/2]

Image& raylib::Image::DrawLine ( ::Vector2  start,
::Vector2  end,
::Color  color 
)
inline

Definition at line 262 of file Image.hpp.

◆ DrawLine() [2/2]

Image& raylib::Image::DrawLine ( int  startPosX,
int  startPosY,
int  endPosX,
int  endPosY,
::Color  color 
)
inline

Definition at line 257 of file Image.hpp.

◆ DrawPixel() [1/2]

Image& raylib::Image::DrawPixel ( ::Vector2  position,
::Color  color 
)
inline

Definition at line 252 of file Image.hpp.

◆ DrawPixel() [2/2]

Image& raylib::Image::DrawPixel ( int  posX,
int  posY,
::Color  color 
)
inline

Definition at line 247 of file Image.hpp.

◆ DrawRectangle() [1/3]

Image& raylib::Image::DrawRectangle ( ::Rectangle  rec,
::Color  color = WHITE 
)
inline

Definition at line 284 of file Image.hpp.

◆ DrawRectangle() [2/3]

Image& raylib::Image::DrawRectangle ( int  posX,
int  posY,
int  width,
int  height,
::Color  color = WHITE 
)
inline

Definition at line 276 of file Image.hpp.

◆ DrawRectangle() [3/3]

Image& raylib::Image::DrawRectangle ( Vector2  position,
Vector2  size,
::Color  color = WHITE 
)
inline

Definition at line 280 of file Image.hpp.

◆ DrawRectangleLines()

Image& raylib::Image::DrawRectangleLines ( ::Rectangle  rec,
int  thick,
::Color  color 
)
inline

Definition at line 288 of file Image.hpp.

◆ DrawText() [1/3]

Image& raylib::Image::DrawText ( ::Font  font,
const std::string &  text,
::Vector2  position,
float  fontSize,
float  spacing,
::Color  tint = WHITE 
)
inline

Definition at line 305 of file Image.hpp.

◆ DrawText() [2/3]

Image& raylib::Image::DrawText ( const std::string &  text,
::Vector2  position,
int  fontSize,
::Color  color = WHITE 
)
inline

Definition at line 297 of file Image.hpp.

◆ DrawText() [3/3]

Image& raylib::Image::DrawText ( const std::string &  text,
int  x,
int  y,
int  fontSize,
::Color  color = WHITE 
)
inline

Definition at line 301 of file Image.hpp.

◆ Export()

Image& raylib::Image::Export ( const std::string &  fileName)
inline

Definition at line 120 of file Image.hpp.

◆ ExportAsCode()

Image& raylib::Image::ExportAsCode ( const std::string &  fileName)
inline

Definition at line 124 of file Image.hpp.

◆ FlipHorizontal()

Image& raylib::Image::FlipHorizontal ( )
inline

Definition at line 196 of file Image.hpp.

◆ FlipVertical()

Image& raylib::Image::FlipVertical ( )
inline

Definition at line 192 of file Image.hpp.

◆ Format()

Image& raylib::Image::Format ( int  newFormat)
inline

Definition at line 147 of file Image.hpp.

◆ FromImage()

Image raylib::Image::FromImage ( ::Rectangle  rec)
inline

Definition at line 138 of file Image.hpp.

◆ GenCellular()

static Image raylib::Image::GenCellular ( int  width,
int  height,
int  tileSize 
)
inlinestatic

Definition at line 78 of file Image.hpp.

◆ GenChecked()

static Image raylib::Image::GenChecked ( int  width,
int  height,
int  checksX,
int  checksY,
Color  col1,
Color  col2 
)
inlinestatic

Definition at line 66 of file Image.hpp.

◆ GenColor()

static Image raylib::Image::GenColor ( int  width,
int  height,
Color  color 
)
inlinestatic

Definition at line 50 of file Image.hpp.

◆ GenGradientH()

static Image raylib::Image::GenGradientH ( int  width,
int  height,
Color  left,
Color  right 
)
inlinestatic

Definition at line 58 of file Image.hpp.

◆ GenGradientRadial()

static Image raylib::Image::GenGradientRadial ( int  width,
int  height,
float  density,
Color  inner,
Color  outer 
)
inlinestatic

Definition at line 62 of file Image.hpp.

◆ GenGradientV()

static Image raylib::Image::GenGradientV ( int  width,
int  height,
Color  top,
Color  bottom 
)
inlinestatic

Definition at line 54 of file Image.hpp.

◆ GenPerlinNoise()

static Image raylib::Image::GenPerlinNoise ( int  width,
int  height,
int  offsetX,
int  offsetY,
float  scale 
)
inlinestatic

Definition at line 74 of file Image.hpp.

◆ GenWhiteNoise()

static Image raylib::Image::GenWhiteNoise ( int  width,
int  height,
float  factor 
)
inlinestatic

Definition at line 70 of file Image.hpp.

◆ GetAlphaBorder()

Rectangle raylib::Image::GetAlphaBorder ( float  threshold)
inline

Definition at line 238 of file Image.hpp.

◆ GetData()

void* raylib::Image::GetData ( )
inline

Definition at line 129 of file Image.hpp.

◆ GetFormat()

int raylib::Image::GetFormat ( )
inline

Definition at line 133 of file Image.hpp.

◆ GetHeight()

int raylib::Image::GetHeight ( )
inline

Definition at line 131 of file Image.hpp.

◆ GetImageData()

inline ::Color* raylib::Image::GetImageData ( )
inline

Definition at line 310 of file Image.hpp.

◆ GetImageDataNormalized()

inline ::Vector4* raylib::Image::GetImageDataNormalized ( )
inline

Definition at line 314 of file Image.hpp.

◆ GetMipmaps()

int raylib::Image::GetMipmaps ( )
inline

Definition at line 132 of file Image.hpp.

◆ GetPalette()

inline ::Color* raylib::Image::GetPalette ( int  maxPaletteSize,
int *  extractCount 
)
inline

Definition at line 234 of file Image.hpp.

◆ GetScreenData()

static Image raylib::Image::GetScreenData ( )
inlinestatic

Definition at line 46 of file Image.hpp.

References Image().

◆ GetWidth()

int raylib::Image::GetWidth ( )
inline

Definition at line 130 of file Image.hpp.

◆ Load()

void raylib::Image::Load ( const std::string &  fileName)
inline

Definition at line 104 of file Image.hpp.

References set().

Referenced by Image().

◆ LoadAnim()

void raylib::Image::LoadAnim ( const std::string &  fileName,
int *  frames 
)
inline

Definition at line 112 of file Image.hpp.

References set().

Referenced by Image().

◆ LoadRaw()

void raylib::Image::LoadRaw ( const std::string &  fileName,
int  width,
int  height,
int  format,
int  headerSize 
)
inline

Definition at line 108 of file Image.hpp.

References set().

Referenced by Image().

◆ Mipmaps()

Image& raylib::Image::Mipmaps ( )
inline

Definition at line 183 of file Image.hpp.

◆ operator Texture2D()

raylib::Image::operator Texture2D ( )
inline

Definition at line 317 of file Image.hpp.

◆ operator=() [1/2]

Image& raylib::Image::operator= ( const ::Image &  image)
inline

Definition at line 86 of file Image.hpp.

References set().

◆ operator=() [2/2]

Image& raylib::Image::operator= ( const Image &  image)
inline

Definition at line 91 of file Image.hpp.

References set().

◆ Resize()

Image& raylib::Image::Resize ( int  newWidth,
int  newHeight 
)
inline

Definition at line 171 of file Image.hpp.

◆ ResizeCanvas()

Image& raylib::Image::ResizeCanvas ( int  newWidth,
int  newHeight,
int  offsetX,
int  offsetY,
Color  color 
)
inline

Definition at line 179 of file Image.hpp.

◆ ResizeNN()

Image& raylib::Image::ResizeNN ( int  newWidth,
int  newHeight 
)
inline

Definition at line 175 of file Image.hpp.

◆ RotateCCW()

Image& raylib::Image::RotateCCW ( )
inline

Definition at line 205 of file Image.hpp.

◆ RotateCW()

Image& raylib::Image::RotateCW ( )
inline

Definition at line 201 of file Image.hpp.

◆ set()

void raylib::Image::set ( ::Image  image)
inline

Definition at line 96 of file Image.hpp.

Referenced by Image(), Load(), LoadAnim(), LoadRaw(), and operator=().

◆ SetData()

void raylib::Image::SetData ( void *  value)
inline

Definition at line 129 of file Image.hpp.

◆ SetFormat()

void raylib::Image::SetFormat ( int  value)
inline

Definition at line 133 of file Image.hpp.

◆ SetHeight()

void raylib::Image::SetHeight ( int  value)
inline

Definition at line 131 of file Image.hpp.

◆ SetMipmaps()

void raylib::Image::SetMipmaps ( int  value)
inline

Definition at line 132 of file Image.hpp.

◆ SetWidth()

void raylib::Image::SetWidth ( int  value)
inline

Definition at line 130 of file Image.hpp.

◆ Text() [1/2]

static Image raylib::Image::Text ( Font  font,
std::string  text,
float  fontSize,
float  spacing,
Color  tint 
)
inlinestatic

Definition at line 42 of file Image.hpp.

◆ Text() [2/2]

static Image raylib::Image::Text ( std::string  text,
int  fontSize,
Color  color 
)
inlinestatic

Definition at line 38 of file Image.hpp.

◆ ToPOT()

Image& raylib::Image::ToPOT ( Color  fillColor)
inline

Definition at line 142 of file Image.hpp.

◆ Unload()

void raylib::Image::Unload ( )
inline

Definition at line 116 of file Image.hpp.

Referenced by ~Image().