|
Raylib C++
1.0.0
Encapsulates the raylib library
|
The encapsultation of the raylib Image. More...
#include <RlImage.hpp>

Public Member Functions | |
| RlImage (const Image &image) | |
| Construct a new RlImage object. More... | |
| RlImage (const Image &image, int frameCount) | |
| Construct a new RlImage object. More... | |
| ~RlImage () | |
| Destroy the RlImage object. More... | |
| RlImage | copy () |
| Create an image duplicate (useful for transformations) More... | |
| bool | save (const std::string &fileName) |
| Export image data to file, returns true on success. More... | |
| bool | saveAsCode (const std::string &fileName) |
| Export image as code file defining an array of bytes, returns true on success. More... | |
| RlImage | subImage (const Rectangle &rec) |
| Create an image from another image piece. More... | |
| void | changeFormat (int newFormat) |
| Convert image data to desired format. More... | |
| void | toPot (const RlColor &fill) |
| Convert image to POT (power-of-two) More... | |
| void | crop (const Rectangle &crop) |
| Crop an image to a defined rectangle. More... | |
| void | alphaCrop (float threshold) |
| Crop image depending on alpha value. More... | |
| void | alphaClear (const RlColor &color, float threshold) |
| Clear alpha channel to desired color. More... | |
| void | alphaMask (const RlImage &alphaMask) |
| Apply alpha mask to image. More... | |
| void | alphaPremultiply () |
| Premultiply alpha channel. More... | |
| void | resize (int newWidth, int newHeight) |
| Resize image (Bicubic scaling algorithm) More... | |
| void | resizeNearesetNeighbor (int newWidth, int newHeight) |
| Resize image (Nearest-Neighbor scaling algorithm) More... | |
| void | resizeCanvas (int newWidth, int newHeight, int offsetX, int offsetY, const RlColor &fill) |
| Resize canvas and fill with color. More... | |
| void | mipmaps () |
| Generate all mipmap levels for a provided image. More... | |
| void | dither (int rBpp, int gBpp, int bBpp, int aBpp) |
| Dither image data to 16bpp or lower (Floyd-Steinberg dithering) More... | |
| void | flipVertical () |
| Flip image vertically. More... | |
| void | flipHorizontal () |
| Flip image horizontally. More... | |
| void | rotateClockwise () |
| Rotate image clockwise 90deg. More... | |
| void | rotateCounterClockwise () |
| Rotate image counter-clockwise 90deg. More... | |
| void | colorTint (const RlColor &color) |
| Modify image color: tint. More... | |
| void | colorInvert () |
| Modify image color: invert. More... | |
| void | colorGrayscale () |
| Modify image color: grayscale. More... | |
| void | colorContrast (float contrast) |
| Modify image color: contrast. More... | |
| void | colorBrightness (int brightness) |
| Modify image color: brightness. More... | |
| void | colorReplace (const RlColor &color, const RlColor &replace) |
| Modify image color: replace color. More... | |
| std::vector< RlColor > | loadImageColors () |
| Load color data from image as a Color array (RGBA - 32bit) More... | |
| std::vector< RlColor > | loadImagePalette (int maxPaletteSize) |
| Load colors palette from image as a Color array (RGBA - 32bit) More... | |
| Rectangle | getImageAlphaBorder (float threshold) |
| Get image alpha border rectangle. More... | |
| RlColor | getImageColor (int x, int y) |
| Get image pixel color at (x, y) position. More... | |
| const Image & | getImage () const |
| Get the image (const) More... | |
| Image & | getImage () |
| Get the mutable image. More... | |
| const int & | getFrameCount () const |
| Get the frame count. More... | |
The encapsultation of the raylib Image.
|
explicit |
Construct a new RlImage object.
| image | the image |
|
explicit |
Construct a new RlImage object.
| image | the image |
| frameCount | the frame count |
| raylib::image::RlImage::~RlImage | ( | ) |
Destroy the RlImage object.
| void raylib::image::RlImage::alphaClear | ( | const RlColor & | color, |
| float | threshold | ||
| ) |
Clear alpha channel to desired color.
| color | the color |
| threshold | the threshold |

| void raylib::image::RlImage::alphaCrop | ( | float | threshold | ) |
Crop image depending on alpha value.
| threshold | the threshold |
| void raylib::image::RlImage::alphaMask | ( | const RlImage & | alphaMask | ) |
Apply alpha mask to image.
| alphaMask | the alpha mask |
| void raylib::image::RlImage::alphaPremultiply | ( | ) |
Premultiply alpha channel.
| void raylib::image::RlImage::changeFormat | ( | int | newFormat | ) |
Convert image data to desired format.
| newFormat | the new format |
| void raylib::image::RlImage::colorBrightness | ( | int | brightness | ) |
Modify image color: brightness.
| brightness | the brightness (-255 to 255) |
| void raylib::image::RlImage::colorContrast | ( | float | contrast | ) |
Modify image color: contrast.
| contrast | the contrast (-100 to 100) |
| void raylib::image::RlImage::colorGrayscale | ( | ) |
Modify image color: grayscale.
| void raylib::image::RlImage::colorInvert | ( | ) |
Modify image color: invert.
Modify image color: replace color.
| color | the color to replace |
| replace | the replacement |

| void raylib::image::RlImage::colorTint | ( | const RlColor & | color | ) |
Modify image color: tint.
| color | the color |

| raylib::image::RlImage raylib::image::RlImage::copy | ( | ) |
Create an image duplicate (useful for transformations)
| void raylib::image::RlImage::crop | ( | const Rectangle & | crop | ) |
Crop an image to a defined rectangle.
| crop | the crop |
| void raylib::image::RlImage::dither | ( | int | rBpp, |
| int | gBpp, | ||
| int | bBpp, | ||
| int | aBpp | ||
| ) |
Dither image data to 16bpp or lower (Floyd-Steinberg dithering)
| rBpp | the r bpp |
| gBpp | the g bpp |
| bBpp | the b bpp |
| aBpp | the a bpp |
| void raylib::image::RlImage::flipHorizontal | ( | ) |
Flip image horizontally.
| void raylib::image::RlImage::flipVertical | ( | ) |
Flip image vertically.
| const int & raylib::image::RlImage::getFrameCount | ( | ) | const |
Get the frame count.
| Image& raylib::image::RlImage::getImage | ( | ) |
Get the mutable image.
| Image & raylib::image::RlImage::getImage | ( | ) | const |
Get the image (const)

| Rectangle raylib::image::RlImage::getImageAlphaBorder | ( | float | threshold | ) |
Get image alpha border rectangle.
| threshold | the threshold |
| raylib::RlColor raylib::image::RlImage::getImageColor | ( | int | x, |
| int | y | ||
| ) |
Get image pixel color at (x, y) position.
| x | the x |
| y | the y |
| std::vector< RlColor > raylib::image::RlImage::loadImageColors | ( | ) |
Load color data from image as a Color array (RGBA - 32bit)
| std::vector< RlColor > raylib::image::RlImage::loadImagePalette | ( | int | maxPaletteSize | ) |
Load colors palette from image as a Color array (RGBA - 32bit)
| maxPaletteSize | the max palette size |
| void raylib::image::RlImage::mipmaps | ( | ) |
Generate all mipmap levels for a provided image.
| void raylib::image::RlImage::resize | ( | int | newWidth, |
| int | newHeight | ||
| ) |
Resize image (Bicubic scaling algorithm)
| newWidth | the new width |
| newHeight | the new height |
| void raylib::image::RlImage::resizeCanvas | ( | int | newWidth, |
| int | newHeight, | ||
| int | offsetX, | ||
| int | offsetY, | ||
| const RlColor & | fill | ||
| ) |
Resize canvas and fill with color.
| newWidth | the new width |
| newHeight | the new height |
| offsetX | the offset x |
| offsetY | the offset y |
| fill | the color to fill |

| void raylib::image::RlImage::resizeNearesetNeighbor | ( | int | newWidth, |
| int | newHeight | ||
| ) |
Resize image (Nearest-Neighbor scaling algorithm)
| newWidth | the new width |
| newHeight | the new height |
| void raylib::image::RlImage::rotateClockwise | ( | ) |
Rotate image clockwise 90deg.
| void raylib::image::RlImage::rotateCounterClockwise | ( | ) |
Rotate image counter-clockwise 90deg.
| bool raylib::image::RlImage::save | ( | const std::string & | fileName | ) |
Export image data to file, returns true on success.
| fileName | the file name |
| bool raylib::image::RlImage::saveAsCode | ( | const std::string & | fileName | ) |
Export image as code file defining an array of bytes, returns true on success.
| fileName | the file name |
| raylib::image::RlImage raylib::image::RlImage::subImage | ( | const Rectangle & | rec | ) |
Create an image from another image piece.
| rec | the rec |
| void raylib::image::RlImage::toPot | ( | const RlColor & | fill | ) |
Convert image to POT (power-of-two)
| fill | the fill |

1.8.17