diff options
| author | victorfisac <victorfisac@gmail.com> | 2016-02-26 14:28:05 +0100 |
|---|---|---|
| committer | victorfisac <victorfisac@gmail.com> | 2016-02-26 14:28:05 +0100 |
| commit | 68088bc5be39beff4f9997fe0966ce30054f67c1 (patch) | |
| tree | ef7a773a5cd69193abce4e635dc1555cbd9ad9b7 /src/textures.c | |
| parent | 233f7611da96ea6bc0b7c62f6a06dacef707f9d7 (diff) | |
| parent | 0dfc7fffff68b0bfafd30a86fb322073daf7fc0e (diff) | |
| download | raylib-68088bc5be39beff4f9997fe0966ce30054f67c1.tar.gz raylib-68088bc5be39beff4f9997fe0966ce30054f67c1.zip | |
Merge remote-tracking branch 'refs/remotes/raysan5/develop' into develop
Diffstat (limited to 'src/textures.c')
| -rw-r--r-- | src/textures.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/textures.c b/src/textures.c index f03d2d9a..36819daf 100644 --- a/src/textures.c +++ b/src/textures.c @@ -712,7 +712,7 @@ void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp) { oldpixel = pixels[y*image->width + x]; - // TODO: New pixel obtained by bits truncate, it would be better to round values (check ImageFormat()) + // NOTE: New pixel obtained by bits truncate, it would be better to round values (check ImageFormat()) newpixel.r = oldpixel.r>>(8 - rBpp); // R bits newpixel.g = oldpixel.g>>(8 - gBpp); // G bits newpixel.b = oldpixel.b>>(8 - bBpp); // B bits @@ -769,7 +769,7 @@ void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp) } // Convert image to POT (power-of-two) -// NOTE: Requirement on OpenGL ES 2.0 (RPI, HTML5) +// NOTE: It could be useful on OpenGL ES 2.0 (RPI, HTML5) void ImageToPOT(Image *image, Color fillColor) { Color *pixels = GetImageData(*image); // Get pixels data @@ -784,7 +784,7 @@ void ImageToPOT(Image *image, Color fillColor) Color *pixelsPOT = NULL; // Generate POT array from NPOT data - pixelsPOT = (Color *)malloc(potWidth * potHeight * sizeof(Color)); + pixelsPOT = (Color *)malloc(potWidth*potHeight*sizeof(Color)); for (int j = 0; j < potHeight; j++) { @@ -896,7 +896,9 @@ void ImageCrop(Image *image, Rectangle crop) } // Resize and image to new size -// NOTE: Uses stb default scaling filter +// NOTE: Uses stb default scaling filters (both bicubic): +// STBIR_DEFAULT_FILTER_UPSAMPLE STBIR_FILTER_CATMULLROM +// STBIR_DEFAULT_FILTER_DOWNSAMPLE STBIR_FILTER_MITCHELL (high-quality Catmull-Rom) void ImageResize(Image *image, int newWidth, int newHeight) { // Get data as Color pixels array to work with it |
