diff options
Diffstat (limited to 'cheatsheet/raylib_textures.c')
| -rw-r--r-- | cheatsheet/raylib_textures.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/cheatsheet/raylib_textures.c b/cheatsheet/raylib_textures.c index 3da356f..86560ee 100644 --- a/cheatsheet/raylib_textures.c +++ b/cheatsheet/raylib_textures.c @@ -1,10 +1,10 @@ // Image loading functions - // NOTE: These functions do not require GPU access + // NOTE: This functions do not require GPU access Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM) Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data Image LoadImageAnim(const char *fileName, int *frames); // Load image sequence from file (frames appended to image.data) - Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load image from memory buffer + Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load image from memory buffer, fileType refers to extension: i.e. '.png' Image LoadImageFromTexture(Texture2D texture); // Load image from GPU texture data Image LoadImageFromScreen(void); // Load image from screen buffer and (screenshot) void UnloadImage(Image image); // Unload image from CPU memory (RAM) @@ -18,7 +18,7 @@ Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked Image GenImageWhiteNoise(int width, int height, float factor); // Generate image: white noise - Image GenImageCellular(int width, int height, int tileSize); // Generate image: cellular algorithm. Bigger tileSize means bigger cells + Image GenImageCellular(int width, int height, int tileSize); // Generate image: cellular algorithm, bigger tileSize means bigger cells // Image manipulation functions Image ImageCopy(Image image); // Create an image duplicate (useful for transformations) @@ -35,7 +35,7 @@ void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm) void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm) void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color - void ImageMipmaps(Image *image); // Generate all mipmap levels for a provided image + void ImageMipmaps(Image *image); // Compute all mipmap levels for a provided image void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) void ImageFlipVertical(Image *image); // Flip image vertically void ImageFlipHorizontal(Image *image); // Flip image horizontally @@ -48,7 +48,7 @@ void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255) void ImageColorReplace(Image *image, Color color, Color replace); // Modify image color: replace color Color *LoadImageColors(Image image); // Load color data from image as a Color array (RGBA - 32bit) - Color *LoadImagePalette(Image image, int maxPaletteSize, int *colorsCount); // Load colors palette from image as a Color array (RGBA - 32bit) + Color *LoadImagePalette(Image image, int maxPaletteSize, int *colorCount); // Load colors palette from image as a Color array (RGBA - 32bit) void UnloadImageColors(Color *colors); // Unload color data loaded with LoadImageColors() void UnloadImagePalette(Color *colors); // Unload colors palette loaded with LoadImagePalette() Rectangle GetImageAlphaBorder(Image image, float threshold); // Get image alpha border rectangle @@ -93,23 +93,22 @@ void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint); // Draw texture quad with tiling and offset parameters - void DrawTextureTiled(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint); // Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest. + void DrawTextureTiled(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint); // Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest. void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely - void DrawTexturePoly(Texture2D texture, Vector2 center, Vector2 *points, Vector2 *texcoords, int pointsCount, Color tint); // Draw a textured polygon + void DrawTexturePoly(Texture2D texture, Vector2 center, Vector2 *points, Vector2 *texcoords, int pointCount, Color tint); // Draw a textured polygon // Color/pixel related functions - Color Fade(Color color, float alpha); // Returns color with alpha applied, alpha goes from 0.0f to 1.0f - int ColorToInt(Color color); // Returns hexadecimal value for a Color - Vector4 ColorNormalize(Color color); // Returns Color normalized as float [0..1] - Color ColorFromNormalized(Vector4 normalized); // Returns Color from normalized values [0..1] - Vector3 ColorToHSV(Color color); // Returns HSV values for a Color, hue [0..360], saturation/value [0..1] - Color ColorFromHSV(float hue, float saturation, float value); // Returns a Color from HSV values, hue [0..360], saturation/value [0..1] - Color ColorAlpha(Color color, float alpha); // Returns color with alpha applied, alpha goes from 0.0f to 1.0f - Color ColorAlphaBlend(Color dst, Color src, Color tint); // Returns src alpha-blended into dst color with tint - Color GetColor(unsigned int hexValue); // Get Color structure from hexadecimal value - Color GetPixelColor(void *srcPtr, int format); // Get Color from a source pixel pointer of certain format - void SetPixelColor(void *dstPtr, Color color, int format); // Set color formatted into destination pixel pointer - int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes for certain format + Color Fade(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f + int ColorToInt(Color color); // Get hexadecimal value for a Color + Vector4 ColorNormalize(Color color); // Get Color normalized as float [0..1] + Color ColorFromNormalized(Vector4 normalized); // Get Color from normalized values [0..1] + Vector3 ColorToHSV(Color color); // Get HSV values for a Color, hue [0..360], saturation/value [0..1] + Color ColorFromHSV(float hue, float saturation, float value); // Get a Color from HSV values, hue [0..360], saturation/value [0..1] + Color ColorAlpha(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f + Color ColorAlphaBlend(Color dst, Color src, Color tint); // Get src alpha-blended into dst color with tint + Color GetColor(unsigned int hexValue); // Get Color structure from hexadecimal value + Color GetPixelColor(void *srcPtr, int format); // Get Color from a source pixel pointer of certain format + void SetPixelColor(void *dstPtr, Color color, int format); // Set color formatted into destination pixel pointer + int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes for certain format - |
