diff options
| author | raysan5 <raysan5@gmail.com> | 2016-02-12 12:22:56 +0100 |
|---|---|---|
| committer | raysan5 <raysan5@gmail.com> | 2016-02-12 12:22:56 +0100 |
| commit | 823abf666e09e96ccbf5230c96f2d3a61ff60895 (patch) | |
| tree | 2fc8e05491b466b1dd6855ef63038f691dfe7ed5 /src/textures.c | |
| parent | 685273675bc9247e215c213939c017e506296a70 (diff) | |
| download | raylib-823abf666e09e96ccbf5230c96f2d3a61ff60895.tar.gz raylib-823abf666e09e96ccbf5230c96f2d3a61ff60895.zip | |
Reviewed code TODOs
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 |
