Fix image pixel reference calculation for CL_{INTENSITY,LUMINANCE} formats (#1247)

As per 6.15.15.7, the first three components have to be set to the luminance
value and all components to the intensity value.

Signed-off-by: Kévin Petit <kpet@free.fr>
This commit is contained in:
Kévin Petit
2021-05-14 09:44:38 +01:00
committed by GitHub
parent 02c2a424f7
commit e7c5694cf5

View File

@@ -489,12 +489,14 @@ void read_image_pixel(void *imageData, image_descriptor *imageInfo, int x,
}
else if (format->image_channel_order == CL_INTENSITY)
{
outData[0] = tempData[0];
outData[1] = tempData[0];
outData[2] = tempData[0];
outData[3] = tempData[0];
}
else if (format->image_channel_order == CL_LUMINANCE)
{
outData[0] = tempData[0];
outData[1] = tempData[0];
outData[2] = tempData[0];
}