raylib-cpp
C++ object-oriented wrapper library for raylib.
Image.hpp
1 /*
2 * LICENSE: zlib/libpng
3 *
4 * raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified,
5 * BSD-like license that allows static linking with closed source software:
6 *
7 * Copyright (c) 2020 Rob Loach (@RobLoach)
8 *
9 * This software is provided "as-is", without any express or implied warranty. In no event
10 * will the authors be held liable for any damages arising from the use of this software.
11 *
12 * Permission is granted to anyone to use this software for any purpose, including commercial
13 * applications, and to alter it and redistribute it freely, subject to the following restrictions:
14 *
15 * 1. The origin of this software must not be misrepresented; you must not claim that you
16 * wrote the original software. If you use this software in a product, an acknowledgment
17 * in the product documentation would be appreciated but is not required.
18 *
19 * 2. Altered source versions must be plainly marked as such, and must not be misrepresented
20 * as being the original software.
21 *
22 * 3. This notice may not be removed or altered from any source distribution.
23 */
24 
25 #ifndef RAYLIB_CPP_INCLUDE_IMAGE_HPP_
26 #define RAYLIB_CPP_INCLUDE_IMAGE_HPP_
27 
28 #include <string>
29 
30 #include "./raylib.hpp"
31 #include "./raylib-cpp-utils.hpp"
32 
33 namespace raylib {
34 class Image : public ::Image {
35  public:
36  Image(const ::Image& image) {
37  set(image);
38  }
39 
40  Image(const std::string& fileName) {
41  Load(fileName);
42  }
43 
44  Image(const std::string& fileName, int width, int height, int format, int headerSize) {
45  LoadRaw(fileName, width, height, format, headerSize);
46  }
47 
48  Image(const std::string& fileName, int* frames) {
49  LoadAnim(fileName, frames);
50  }
51 
52  Image(const std::string& fileType, const unsigned char* fileData, int dataSize) {
53  LoadFromMemory(fileType, fileData, dataSize);
54  }
55 
56  Image(const ::Texture2D& texture) {
57  set(::GetTextureData(texture));
58  }
59 
60  Image(int width, int height, ::Color color = {255, 255, 255, 255}) {
61  set(::GenImageColor(width, height, color));
62  }
63 
64  Image(const ::Font& font, const std::string& text, float fontSize, float spacing,
65  ::Color tint = {255, 255, 255, 255}) {
66  set(::ImageTextEx(font, text.c_str(), fontSize, spacing, tint));
67  }
68 
69  static ::Image Text(const std::string& text, int fontSize,
70  ::Color color = {255, 255, 255, 255}) {
71  return ::ImageText(text.c_str(), fontSize, color);
72  }
73 
74  static ::Image Text(const ::Font& font, const std::string& text, float fontSize, float spacing,
75  ::Color tint = {255, 255, 255, 255}) {
76  return ::ImageTextEx(font, text.c_str(), fontSize, spacing, tint);
77  }
78 
82  static ::Image GetScreenData() {
83  return ::GetScreenData();
84  }
85 
89  static ::Image Color(int width, int height, ::Color color = {255, 255, 255, 255}) {
90  return ::GenImageColor(width, height, color);
91  }
92 
96  static ::Image GradientV(int width, int height, ::Color top, ::Color bottom) {
97  return ::GenImageGradientV(width, height, top, bottom);
98  }
99 
103  static ::Image GradientH(int width, int height, ::Color left, ::Color right) {
104  return ::GenImageGradientH(width, height, left, right);
105  }
106 
110  static ::Image GradientRadial(int width, int height, float density,
111  ::Color inner, ::Color outer) {
112  return ::GenImageGradientRadial(width, height, density, inner, outer);
113  }
114 
118  static ::Image Checked(int width, int height, int checksX, int checksY,
119  ::Color col1, ::Color col2) {
120  return ::GenImageChecked(width, height, checksX, checksY, col1, col2);
121  }
122 
126  static ::Image WhiteNoise(int width, int height, float factor) {
127  return ::GenImageWhiteNoise(width, height, factor);
128  }
129 
133  static ::Image PerlinNoise(int width, int height, int offsetX, int offsetY,
134  float scale = 1.0f) {
135  return ::GenImagePerlinNoise(width, height, offsetX, offsetY, scale);
136  }
137 
141  static ::Image Cellular(int width, int height, int tileSize) {
142  return ::GenImageCellular(width, height, tileSize);
143  }
144 
145  ~Image() {
146  Unload();
147  }
148 
149  Image& operator=(const ::Image& image) {
150  set(image);
151  return *this;
152  }
153 
154  Image& operator=(const Image& image) {
155  set(image);
156  return *this;
157  }
158 
159  void Load(const std::string& fileName) {
160  set(::LoadImage(fileName.c_str()));
161  }
162 
163  void LoadRaw(const std::string& fileName, int width, int height, int format, int headerSize) {
164  set(::LoadImageRaw(fileName.c_str(), width, height, format, headerSize));
165  }
166 
167  void LoadAnim(const std::string& fileName, int* frames) {
168  set(::LoadImageAnim(fileName.c_str(), frames));
169  }
170 
172  const std::string& fileType,
173  const unsigned char *fileData,
174  int dataSize) {
175  set(::LoadImageFromMemory(fileType.c_str(), fileData, dataSize));
176  }
177 
178  inline void Unload() {
179  if (data != NULL) {
180  ::UnloadImage(*this);
181  data = NULL;
182  }
183  }
184 
188  inline bool Export(const std::string& fileName) {
189  // TODO(RobLoach): Switch to an invalid loading exception on false.
190  return ::ExportImage(*this, fileName.c_str());
191  }
192 
196  inline bool ExportAsCode(const std::string& fileName) {
197  return ::ExportImageAsCode(*this, fileName.c_str());
198  }
199 
200  GETTERSETTER(void*, Data, data)
201  GETTERSETTER(int, Width, width)
202  GETTERSETTER(int, Height, height)
203  GETTERSETTER(int, Mipmaps, mipmaps)
204  GETTERSETTER(int, Format, format)
205 
209  inline ::Vector2 GetSize() {
210  return {static_cast<float>(width), static_cast<float>(height)};
211  }
212 
216  inline ::Image Copy() {
217  return ::ImageCopy(*this);
218  }
219 
223  inline ::Image FromImage(::Rectangle rec) {
224  return ::ImageFromImage(*this, rec);
225  }
226 
230  inline Image& ToPOT(::Color fillColor) {
231  ::ImageToPOT(this, fillColor);
232  return *this;
233  }
234 
238  inline Image& Format(int newFormat) {
239  ::ImageFormat(this, newFormat);
240  return *this;
241  }
242 
246  inline Image& AlphaMask(const ::Image& alphaMask) {
247  ::ImageAlphaMask(this, alphaMask);
248  return *this;
249  }
250 
254  inline Image& AlphaCrop(float threshold) {
255  ::ImageAlphaCrop(this, threshold);
256  return *this;
257  }
258 
263  ::ImageAlphaPremultiply(this);
264  return *this;
265  }
266 
270  inline Image& Crop(::Rectangle crop) {
271  ::ImageCrop(this, crop);
272  return *this;
273  }
274 
278  inline Image& Crop(::Vector2 size) {
279  return Crop(0, 0, static_cast<int>(size.x), static_cast<int>(size.y));
280  }
281 
285  inline Image& Crop(int offsetX, int offsetY, int newWidth, int newHeight) {
286  ::Rectangle rect{
287  static_cast<float>(offsetX),
288  static_cast<float>(offsetY),
289  static_cast<float>(newWidth),
290  static_cast<float>(newHeight)
291  };
292  ::ImageCrop(this, rect);
293  return *this;
294  }
295 
299  inline Image& Resize(int newWidth, int newHeight) {
300  ::ImageResize(this, newWidth, newHeight);
301  return *this;
302  }
303 
307  inline Image& ResizeNN(int newWidth, int newHeight) {
308  ::ImageResizeNN(this, newWidth, newHeight);
309  return *this;
310  }
311 
315  inline Image& ResizeCanvas(int newWidth, int newHeight, int offsetX, int offsetY,
316  ::Color color = {255, 255, 255, 255}) {
317  ::ImageResizeCanvas(this, newWidth, newHeight, offsetX, offsetY, color);
318  return *this;
319  }
320 
324  inline Image& Mipmaps() {
325  ::ImageMipmaps(this);
326  return *this;
327  }
328 
332  inline Image& Dither(int rBpp, int gBpp, int bBpp, int aBpp) {
333  ::ImageDither(this, rBpp, gBpp, bBpp, aBpp);
334  return *this;
335  }
336 
340  inline Image& FlipVertical() {
341  ::ImageFlipVertical(this);
342  return *this;
343  }
344 
348  inline Image& FlipHorizontal() {
349  ::ImageFlipHorizontal(this);
350  return *this;
351  }
352 
356  inline Image& RotateCW() {
357  ::ImageRotateCW(this);
358  return *this;
359  }
360 
364  inline Image& RotateCCW() {
365  ::ImageRotateCCW(this);
366  return *this;
367  }
368 
372  inline Image& ColorTint(::Color color = {255, 255, 255, 255}) {
373  ::ImageColorTint(this, color);
374  return *this;
375  }
376 
380  inline Image& ColorInvert() {
381  ::ImageColorInvert(this);
382  return *this;
383  }
384 
388  inline Image& ColorGrayscale() {
389  ::ImageColorGrayscale(this);
390  return *this;
391  }
392 
398  inline Image& ColorContrast(float contrast) {
399  ::ImageColorContrast(this, contrast);
400  return *this;
401  }
402 
408  inline Image& ColorBrightness(int brightness) {
409  ::ImageColorBrightness(this, brightness);
410  return *this;
411  }
412 
416  inline Image& ColorReplace(::Color color, ::Color replace) {
417  ::ImageColorReplace(this, color, replace);
418  return *this;
419  }
420 
426  inline Rectangle GetAlphaBorder(float threshold) const {
427  return ::GetImageAlphaBorder(*this, threshold);
428  }
429 
433  inline Image& ClearBackground(::Color color = {0, 0, 0, 255}) {
434  ::ImageClearBackground(this, color);
435  return *this;
436  }
437 
441  inline Image& DrawPixel(int posX, int posY, ::Color color = {255, 255, 255, 255}) {
442  ::ImageDrawPixel(this, posX, posY, color);
443  return *this;
444  }
445 
446  inline Image& DrawPixel(::Vector2 position, ::Color color = {255, 255, 255, 255}) {
447  ::ImageDrawPixelV(this, position, color);
448  return *this;
449  }
450 
451  inline Image& DrawLine(int startPosX, int startPosY, int endPosX, int endPosY,
452  ::Color color = {255, 255, 255, 255}) {
453  ::ImageDrawLine(this, startPosX, startPosY, endPosX, endPosY, color);
454  return *this;
455  }
456 
457  inline Image& DrawLine(::Vector2 start, ::Vector2 end, ::Color color = {255, 255, 255, 255}) {
458  ::ImageDrawLineV(this, start, end, color);
459  return *this;
460  }
461 
462  inline Image& DrawCircle(int centerX, int centerY, int radius,
463  ::Color color = {255, 255, 255, 255}) {
464  ::ImageDrawCircle(this, centerX, centerY, radius, color);
465  return *this;
466  }
467 
468  inline Image& DrawCircle(::Vector2 center, int radius,
469  ::Color color = {255, 255, 255, 255}) {
470  ::ImageDrawCircleV(this, center, radius, color);
471  return *this;
472  }
473 
474  inline Image& DrawRectangle(int posX, int posY, int width, int height,
475  ::Color color = {255, 255, 255, 255}) {
476  ::ImageDrawRectangle(this, posX, posY, width, height, color);
477  return *this;
478  }
479 
480  inline Image& DrawRectangle(Vector2 position, Vector2 size,
481  ::Color color = {255, 255, 255, 255}) {
482  ::ImageDrawRectangleV(this, position, size, color);
483  return *this;
484  }
485 
486  inline Image& DrawRectangle(::Rectangle rec, ::Color color = {255, 255, 255, 255}) {
487  ::ImageDrawRectangleRec(this, rec, color);
488  return *this;
489  }
490 
491  inline Image& DrawRectangleLines(::Rectangle rec, int thick,
492  ::Color color = {255, 255, 255, 255}) {
493  ::ImageDrawRectangleLines(this, rec, thick, color);
494  return *this;
495  }
496 
497  inline Image& Draw(const ::Image& src, ::Rectangle srcRec, ::Rectangle dstRec,
498  ::Color tint = {255, 255, 255, 255}) {
499  ::ImageDraw(this, src, srcRec, dstRec, tint);
500  return *this;
501  }
502 
503  inline Image& DrawText(const std::string& text, ::Vector2 position, int fontSize,
504  ::Color color = {255, 255, 255, 255}) {
505  ::ImageDrawText(this,
506  text.c_str(),
507  static_cast<int>(position.x),
508  static_cast<int>(position.y),
509  fontSize,
510  color);
511  return *this;
512  }
513 
514  inline Image& DrawText(const std::string& text, int x, int y, int fontSize,
515  ::Color color = {255, 255, 255, 255}) {
516  ::ImageDrawText(this, text.c_str(), x, y, fontSize, color);
517  return *this;
518  }
519 
520  inline Image& DrawText(const ::Font& font, const std::string& text, ::Vector2 position,
521  float fontSize, float spacing, ::Color tint = {255, 255, 255, 255}) {
522  ::ImageDrawTextEx(this, font, text.c_str(), position, fontSize, spacing, tint);
523  return *this;
524  }
525 
529  inline ::Color* LoadColors() {
530  return ::LoadImageColors(*this);
531  }
532 
536  inline ::Color* LoadPalette(int maxPaletteSize, int *colorsCount) {
537  return ::LoadImagePalette(*this, maxPaletteSize, colorsCount);
538  }
539 
543  inline ::Texture2D LoadTexture() {
544  return ::LoadTextureFromImage(*this);
545  }
546 
550  inline operator ::Texture2D() {
551  return LoadTexture();
552  }
553 
554  protected:
555  inline void set(const ::Image& image) {
556  data = image.data;
557  width = image.width;
558  height = image.height;
559  mipmaps = image.mipmaps;
560  format = image.format;
561  }
562 };
563 } // namespace raylib
564 
565 #endif // RAYLIB_CPP_INCLUDE_IMAGE_HPP_
raylib::Image::Dither
Image & Dither(int rBpp, int gBpp, int bBpp, int aBpp)
Dither image data to 16bpp or lower (Floyd-Steinberg dithering)
Definition: Image.hpp:332
raylib
Provides all the classes associated with raylib-cpp.
Definition: AudioDevice.hpp:31
raylib::Image::LoadPalette
inline ::Color * LoadPalette(int maxPaletteSize, int *colorsCount)
Load colors palette from image as a Color array (RGBA - 32bit)
Definition: Image.hpp:536
raylib::Image::ColorBrightness
Image & ColorBrightness(int brightness)
Modify image color: brightness.
Definition: Image.hpp:408
raylib::Image::WhiteNoise
::Image WhiteNoise(int width, int height, float factor)
Generate image: white noise.
Definition: Image.hpp:126
raylib::Image::GradientRadial
::Image GradientRadial(int width, int height, float density, ::Color inner, ::Color outer)
Generate image: radial gradient.
Definition: Image.hpp:110
raylib::Image::Image
Image(const std::string &fileType, const unsigned char *fileData, int dataSize)
Definition: Image.hpp:52
raylib::Image::~Image
~Image()
Definition: Image.hpp:145
raylib::Image::Image
Image(int width, int height, ::Color color={255, 255, 255, 255})
Definition: Image.hpp:60
raylib::Image::ToPOT
Image & ToPOT(::Color fillColor)
Convert image to POT (power-of-two)
Definition: Image.hpp:230
raylib::Image::DrawCircle
Image & DrawCircle(::Vector2 center, int radius, ::Color color={255, 255, 255, 255})
Definition: Image.hpp:468
raylib::Image::Format
Image & Format(int newFormat)
Convert image data to desired format.
Definition: Image.hpp:238
raylib::Image::Draw
Image & Draw(const ::Image &src, ::Rectangle srcRec, ::Rectangle dstRec, ::Color tint={255, 255, 255, 255})
Definition: Image.hpp:497
raylib::Image::Copy
inline ::Image Copy()
Create an image duplicate (useful for transformations)
Definition: Image.hpp:216
raylib::Image::Crop
Image & Crop(::Vector2 size)
Crop an image to area defined by a vector.
Definition: Image.hpp:278
raylib::Image::ColorInvert
Image & ColorInvert()
Modify image color: invert.
Definition: Image.hpp:380
raylib::Image::ColorGrayscale
Image & ColorGrayscale()
Modify image color: grayscale.
Definition: Image.hpp:388
raylib::Image
Definition: Image.hpp:34
raylib::Image::Crop
Image & Crop(::Rectangle crop)
Crop an image to area defined by a rectangle.
Definition: Image.hpp:270
raylib::Image::Image
Image(const std::string &fileName)
Definition: Image.hpp:40
raylib::Image::DrawText
Image & DrawText(const std::string &text, int x, int y, int fontSize, ::Color color={255, 255, 255, 255})
Definition: Image.hpp:514
raylib::Image::GetSize
inline ::Vector2 GetSize()
Retrieve the width and height of the image.
Definition: Image.hpp:209
raylib::Image::DrawPixel
Image & DrawPixel(::Vector2 position, ::Color color={255, 255, 255, 255})
Definition: Image.hpp:446
raylib::Image::Text
::Image Text(const ::Font &font, const std::string &text, float fontSize, float spacing, ::Color tint={255, 255, 255, 255})
Definition: Image.hpp:74
raylib::Image::DrawLine
Image & DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, ::Color color={255, 255, 255, 255})
Definition: Image.hpp:451
raylib::Image::RotateCCW
Image & RotateCCW()
Rotate image counter-clockwise 90deg.
Definition: Image.hpp:364
raylib::Image::DrawCircle
Image & DrawCircle(int centerX, int centerY, int radius, ::Color color={255, 255, 255, 255})
Definition: Image.hpp:462
raylib::Image::Image
Image(const ::Font &font, const std::string &text, float fontSize, float spacing, ::Color tint={255, 255, 255, 255})
Definition: Image.hpp:64
raylib::Image::ExportAsCode
bool ExportAsCode(const std::string &fileName)
Export image as code file defining an array of bytes, returns true on success.
Definition: Image.hpp:196
raylib::Image::DrawRectangle
Image & DrawRectangle(Vector2 position, Vector2 size, ::Color color={255, 255, 255, 255})
Definition: Image.hpp:480
raylib::Image::FlipVertical
Image & FlipVertical()
Flip image vertically.
Definition: Image.hpp:340
raylib::Image::ColorContrast
Image & ColorContrast(float contrast)
Modify image color: contrast.
Definition: Image.hpp:398
raylib::Image::DrawText
Image & DrawText(const std::string &text, ::Vector2 position, int fontSize, ::Color color={255, 255, 255, 255})
Definition: Image.hpp:503
raylib::Image::LoadColors
inline ::Color * LoadColors()
Load color data from image as a Color array (RGBA - 32bit)
Definition: Image.hpp:529
raylib::Image::GetScreenData
::Image GetScreenData()
Get pixel data from screen buffer and return an Image (screenshot)
Definition: Image.hpp:82
raylib::Image::PerlinNoise
::Image PerlinNoise(int width, int height, int offsetX, int offsetY, float scale=1.0f)
Generate image: perlin noise.
Definition: Image.hpp:133
raylib::Image::LoadRaw
void LoadRaw(const std::string &fileName, int width, int height, int format, int headerSize)
Definition: Image.hpp:163
raylib::Image::operator=
Image & operator=(const ::Image &image)
Definition: Image.hpp:149
raylib::Image::DrawRectangle
Image & DrawRectangle(::Rectangle rec, ::Color color={255, 255, 255, 255})
Definition: Image.hpp:486
raylib::Image::DrawLine
Image & DrawLine(::Vector2 start, ::Vector2 end, ::Color color={255, 255, 255, 255})
Definition: Image.hpp:457
raylib::Image::AlphaPremultiply
Image & AlphaPremultiply()
Premultiply alpha channel.
Definition: Image.hpp:262
raylib::Image::Crop
Image & Crop(int offsetX, int offsetY, int newWidth, int newHeight)
Crop an image to area defined by a rectangle.
Definition: Image.hpp:285
raylib::Image::LoadFromMemory
void LoadFromMemory(const std::string &fileType, const unsigned char *fileData, int dataSize)
Definition: Image.hpp:171
raylib::Image::ResizeCanvas
Image & ResizeCanvas(int newWidth, int newHeight, int offsetX, int offsetY, ::Color color={255, 255, 255, 255})
Resize canvas and fill with color.
Definition: Image.hpp:315
raylib::Image::DrawPixel
Image & DrawPixel(int posX, int posY, ::Color color={255, 255, 255, 255})
Draw pixel within an image.
Definition: Image.hpp:441
raylib::Image::Mipmaps
Image & Mipmaps()
Generate all mipmap levels for a provided image.
Definition: Image.hpp:324
raylib::Image::Text
::Image Text(const std::string &text, int fontSize, ::Color color={255, 255, 255, 255})
Definition: Image.hpp:69
raylib::Image::Image
Image(const std::string &fileName, int width, int height, int format, int headerSize)
Definition: Image.hpp:44
raylib::Image::Export
bool Export(const std::string &fileName)
Export image data to file, returns true on success.
Definition: Image.hpp:188
raylib::Rectangle
Definition: Rectangle.hpp:33
raylib::Vector2
Definition: Vector2.hpp:37
raylib::Image::GradientV
::Image GradientV(int width, int height, ::Color top, ::Color bottom)
Generate image: vertical gradient.
Definition: Image.hpp:96
raylib::Image::DrawRectangleLines
Image & DrawRectangleLines(::Rectangle rec, int thick, ::Color color={255, 255, 255, 255})
Definition: Image.hpp:491
raylib::Image::ColorTint
Image & ColorTint(::Color color={255, 255, 255, 255})
Modify image color: tint.
Definition: Image.hpp:372
raylib::Image::GetAlphaBorder
Rectangle GetAlphaBorder(float threshold) const
Get image alpha border rectangle.
Definition: Image.hpp:426
raylib::Color
Definition: Color.hpp:35
raylib::Image::GradientH
::Image GradientH(int width, int height, ::Color left, ::Color right)
Generate image: horizontal gradient.
Definition: Image.hpp:103
raylib::Image::set
void set(const ::Image &image)
Definition: Image.hpp:555
raylib::Image::Checked
::Image Checked(int width, int height, int checksX, int checksY, ::Color col1, ::Color col2)
Generate image: checked.
Definition: Image.hpp:118
raylib::Image::LoadAnim
void LoadAnim(const std::string &fileName, int *frames)
Definition: Image.hpp:167
raylib::Image::Load
void Load(const std::string &fileName)
Definition: Image.hpp:159
raylib::Image::Image
Image(const std::string &fileName, int *frames)
Definition: Image.hpp:48
raylib::Image::Color
::Image Color(int width, int height, ::Color color={255, 255, 255, 255})
Generate image: plain color.
Definition: Image.hpp:89
raylib::Image::AlphaCrop
Image & AlphaCrop(float threshold)
Crop image depending on alpha value.
Definition: Image.hpp:254
raylib::Image::Resize
Image & Resize(int newWidth, int newHeight)
Resize and image to new size.
Definition: Image.hpp:299
raylib::Image::Image
Image(const ::Texture2D &texture)
Definition: Image.hpp:56
raylib::Image::Unload
void Unload()
Definition: Image.hpp:178
raylib::Image::FlipHorizontal
Image & FlipHorizontal()
Flip image horizontally.
Definition: Image.hpp:348
raylib::Image::FromImage
inline ::Image FromImage(::Rectangle rec)
Create an image from another image piece.
Definition: Image.hpp:223
raylib::Image::LoadTexture
inline ::Texture2D LoadTexture()
Load texture from image data.
Definition: Image.hpp:543
raylib::Image::ResizeNN
Image & ResizeNN(int newWidth, int newHeight)
Resize and image to new size using Nearest-Neighbor scaling algorithm.
Definition: Image.hpp:307
raylib::Image::operator=
Image & operator=(const Image &image)
Definition: Image.hpp:154
raylib::Image::Cellular
::Image Cellular(int width, int height, int tileSize)
Generate image: cellular algorithm.
Definition: Image.hpp:141
raylib::Image::Image
Image(const ::Image &image)
Definition: Image.hpp:36
raylib::Image::DrawText
Image & DrawText(const ::Font &font, const std::string &text, ::Vector2 position, float fontSize, float spacing, ::Color tint={255, 255, 255, 255})
Definition: Image.hpp:520
raylib::Image::DrawRectangle
Image & DrawRectangle(int posX, int posY, int width, int height, ::Color color={255, 255, 255, 255})
Definition: Image.hpp:474
raylib::Image::ClearBackground
Image & ClearBackground(::Color color={0, 0, 0, 255})
Clear image background with given color.
Definition: Image.hpp:433
raylib::Image::RotateCW
Image & RotateCW()
Rotate image clockwise 90deg.
Definition: Image.hpp:356
raylib::Image::AlphaMask
Image & AlphaMask(const ::Image &alphaMask)
Apply alpha mask to image.
Definition: Image.hpp:246
raylib::Image::ColorReplace
Image & ColorReplace(::Color color, ::Color replace)
Modify image color: replace color.
Definition: Image.hpp:416