From d873314c279be1582e28f3c90416c6b225b787fb Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 29 May 2018 00:52:08 +0200 Subject: Reviewed Windows resource file name --- release/libs/win32/tcc/libraylib.a | Bin 0 -> 1463102 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 release/libs/win32/tcc/libraylib.a (limited to 'release/libs/win32/tcc/libraylib.a') diff --git a/release/libs/win32/tcc/libraylib.a b/release/libs/win32/tcc/libraylib.a new file mode 100644 index 00000000..94114ac0 Binary files /dev/null and b/release/libs/win32/tcc/libraylib.a differ -- cgit v1.2.3 From b1b4a11bdb450c415ae54eded7f868af19a7fb5d Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 2 Jun 2018 13:05:23 +0200 Subject: Corrected issue with function definition --- release/include/raylib.h | 5 +++-- release/libs/win32/tcc/libraylib.a | Bin 1463102 -> 1463584 bytes src/raylib.h | 2 +- src/textures.c | 1 - 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'release/libs/win32/tcc/libraylib.a') diff --git a/release/include/raylib.h b/release/include/raylib.h index e83650e6..dad08ba2 100644 --- a/release/include/raylib.h +++ b/release/include/raylib.h @@ -912,8 +912,9 @@ RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle -RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize and image (bilinear filtering) -RLAPI void ImageResizeNN(Image *image,int newWidth,int newHeight); // Resize and image (Nearest-Neighbor scaling algorithm) +RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (bilinear filtering) +RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm) +RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color color); // Resize canvas and fill with color RLAPI void ImageMipmaps(Image *image); // Generate all mipmap levels for a provided image RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) diff --git a/release/libs/win32/tcc/libraylib.a b/release/libs/win32/tcc/libraylib.a index 94114ac0..0d1d4549 100644 Binary files a/release/libs/win32/tcc/libraylib.a and b/release/libs/win32/tcc/libraylib.a differ diff --git a/src/raylib.h b/src/raylib.h index 2659d70d..dad08ba2 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -914,7 +914,7 @@ RLAPI void ImageAlphaPremultiply(Image *image); RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (bilinear filtering) RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm) -RLAPI void ImageResizeCanvas(Image *image, int newWidth,int newHeight, int anchor, Color color); // Resize canvas, using anchor point and color filling +RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color color); // Resize canvas and fill with color RLAPI void ImageMipmaps(Image *image); // Generate all mipmap levels for a provided image RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) diff --git a/src/textures.c b/src/textures.c index c4e77458..3a62ac14 100644 --- a/src/textures.c +++ b/src/textures.c @@ -1118,7 +1118,6 @@ void ImageResizeCanvas(Image *image, int newWidth,int newHeight, int offsetX, in { // TODO: ImageCrop(), define proper cropping rectangle } - } // Generate all mipmap levels for a provided image -- cgit v1.2.3 From 0e6458cfee398e572340db461ef6beb85253a4c5 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 3 Jun 2018 21:05:01 +0200 Subject: Added ImageRotate*() functions --- release/include/raylib.h | 2 ++ release/libs/win32/tcc/libraylib.a | Bin 1463584 -> 1465002 bytes src/raylib.h | 2 ++ src/textures.c | 56 +++++++++++++++++++++++++++++++++++-- 4 files changed, 58 insertions(+), 2 deletions(-) (limited to 'release/libs/win32/tcc/libraylib.a') diff --git a/release/include/raylib.h b/release/include/raylib.h index a3fa1311..86ad5408 100644 --- a/release/include/raylib.h +++ b/release/include/raylib.h @@ -925,6 +925,8 @@ RLAPI void ImageDrawText(Image *dst, Vector2 position, const char *text, int fon RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, Font font, const char *text, float fontSize, float spacing, Color color); // Draw text (custom sprite font) within an image (destination) RLAPI void ImageFlipVertical(Image *image); // Flip image vertically RLAPI void ImageFlipHorizontal(Image *image); // Flip image horizontally +RLAPI void ImageRotateCW(Image *image); // Rotate image clockwise 90deg +RLAPI void ImageRotateCCW(Image *image); // Rotate image counter-clockwise 90deg RLAPI void ImageColorTint(Image *image, Color color); // Modify image color: tint RLAPI void ImageColorInvert(Image *image); // Modify image color: invert RLAPI void ImageColorGrayscale(Image *image); // Modify image color: grayscale diff --git a/release/libs/win32/tcc/libraylib.a b/release/libs/win32/tcc/libraylib.a index 0d1d4549..1aa76249 100644 Binary files a/release/libs/win32/tcc/libraylib.a and b/release/libs/win32/tcc/libraylib.a differ diff --git a/src/raylib.h b/src/raylib.h index a3fa1311..86ad5408 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -925,6 +925,8 @@ RLAPI void ImageDrawText(Image *dst, Vector2 position, const char *text, int fon RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, Font font, const char *text, float fontSize, float spacing, Color color); // Draw text (custom sprite font) within an image (destination) RLAPI void ImageFlipVertical(Image *image); // Flip image vertically RLAPI void ImageFlipHorizontal(Image *image); // Flip image horizontally +RLAPI void ImageRotateCW(Image *image); // Rotate image clockwise 90deg +RLAPI void ImageRotateCCW(Image *image); // Rotate image counter-clockwise 90deg RLAPI void ImageColorTint(Image *image, Color color); // Modify image color: tint RLAPI void ImageColorInvert(Image *image); // Modify image color: invert RLAPI void ImageColorGrayscale(Image *image); // Modify image color: grayscale diff --git a/src/textures.c b/src/textures.c index 3a62ac14..0b9f907e 100644 --- a/src/textures.c +++ b/src/textures.c @@ -1539,7 +1539,7 @@ void ImageDrawTextEx(Image *dst, Vector2 position, Font font, const char *text, void ImageFlipVertical(Image *image) { Color *srcPixels = GetImageData(*image); - Color *dstPixels = (Color *)malloc(sizeof(Color)*image->width*image->height); + Color *dstPixels = (Color *)malloc(image->width*image->height*sizeof(Color)); for (int y = 0; y < image->height; y++) { @@ -1563,7 +1563,7 @@ void ImageFlipVertical(Image *image) void ImageFlipHorizontal(Image *image) { Color *srcPixels = GetImageData(*image); - Color *dstPixels = (Color *)malloc(sizeof(Color)*image->width*image->height); + Color *dstPixels = (Color *)malloc(image->width*image->height*sizeof(Color)); for (int y = 0; y < image->height; y++) { @@ -1583,6 +1583,58 @@ void ImageFlipHorizontal(Image *image) image->data = processed.data; } +// Rotate image clockwise 90deg +void ImageRotateCW(Image *image) +{ + Color *srcPixels = GetImageData(*image); + Color *rotPixels = (Color *)malloc(image->width*image->height*sizeof(Color)); + + for (int y = 0; y < image->height; y++) + { + for (int x = 0; x < image->width; x++) + { + rotPixels[x*image->height + (image->height - y - 1)] = srcPixels[y*image->width + x]; + } + } + + Image processed = LoadImageEx(rotPixels, image->height, image->width); + ImageFormat(&processed, image->format); + UnloadImage(*image); + + free(srcPixels); + free(rotPixels); + + image->data = processed.data; + image->width = processed.width; + image->height = processed.height; +} + +// Rotate image counter-clockwise 90deg +void ImageRotateCCW(Image *image) +{ + Color *srcPixels = GetImageData(*image); + Color *rotPixels = (Color *)malloc(image->width*image->height*sizeof(Color)); + + for (int y = 0; y < image->height; y++) + { + for (int x = 0; x < image->width; x++) + { + rotPixels[x*image->height + y] = srcPixels[y*image->width + (image->width - x - 1)]; + } + } + + Image processed = LoadImageEx(rotPixels, image->height, image->width); + ImageFormat(&processed, image->format); + UnloadImage(*image); + + free(srcPixels); + free(rotPixels); + + image->data = processed.data; + image->width = processed.width; + image->height = processed.height; +} + // Modify image color: tint void ImageColorTint(Image *image, Color color) { -- cgit v1.2.3