From b97134c3e157f241cef485b34b8fb0e09575e7bc Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 6 Jan 2018 18:17:38 +0100 Subject: Review float pixel format textures support --- src/textures.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/textures.c') diff --git a/src/textures.c b/src/textures.c index 7ea54c2c..fe75bd74 100644 --- a/src/textures.c +++ b/src/textures.c @@ -417,6 +417,7 @@ void UnloadRenderTexture(RenderTexture2D target) } // Get pixel data from image in the form of Color struct array +// TODO: Support float pixel data retrieval Color *GetImageData(Image image) { Color *pixels = (Color *)malloc(image.width*image.height*sizeof(Color)); @@ -719,7 +720,7 @@ void ImageFormat(Image *image, int newFormat) case UNCOMPRESSED_R32: { image->data = (float *)malloc(image->width*image->height*sizeof(float)); - + for (int i = 0; i < image->width*image->height; i++) { ((float *)image->data)[i] = (float)((float)pixels[i].r*0.299f/255.0f + (float)pixels[i].g*0.587f/255.0f + (float)pixels[i].b*0.114f/255.0f); -- cgit v1.2.3