You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to draw pixels on the screen using the provided pixel_put function, pixels intended to be white are instead rendered as cyan. This discrepancy suggests a potential problem with how the red channel is being handled during the rendering process.
staticvoidpixel_put(mlx_image_t*image, intx, inty, intcolor)
{
inti;
unsigned char*pixel;
if ((unsigned)x< (*image).width&& (unsigned)y< (*image).height)
{
pixel= (*image).pixels+ (y* (*image).width+x) *sizeof(int);
i=sizeof(int) *6;
while (i >= 0)
{
*pixel++= (color >> i) &0xFF;
i-=sizeof(int) *2;
}
}
}
``
Thepixel_putfunctionisresponsibleforplacingapixelofaspecifiedcoloratthegivencoordinatesonanimage. Itoperatesbymanipulatingthepixel's color values, byte by byte, to set the appropriate RGB components.
Thisissuehasbeenobservedacrossmultipleplatforms, includingArchLinuxandmacOSCatalina.
The text was updated successfully, but these errors were encountered:
When attempting to draw pixels on the screen using the provided pixel_put function, pixels intended to be white are instead rendered as cyan. This discrepancy suggests a potential problem with how the red channel is being handled during the rendering process.
The text was updated successfully, but these errors were encountered: