MCPcopy Create free account
hub / github.com/NetHack/NetHack / build_pixel

Function build_pixel

win/share/bmptiles.c:563–573  ·  view source on GitHub ↗

Build a pixel structure, given the mask words in the second header and * a packed 16 or 32 bit pixel */

Source from the content-addressed store, hash-verified

561/* Build a pixel structure, given the mask words in the second header and
562 * a packed 16 or 32 bit pixel */
563static struct Pixel
564build_pixel(const struct BitmapInfoHeader *header, uint32 color)
565{
566 struct Pixel pixel;
567
568 pixel.r = pixel_element(header->RedMask, color);
569 pixel.g = pixel_element(header->GreenMask, color);
570 pixel.b = pixel_element(header->BlueMask, color);
571 pixel.a = header->AlphaMask ? pixel_element(header->AlphaMask, color) : 255;
572 return pixel;
573}
574
575/* Extract one element (red, green, blue or alpha) from a pixel */
576static unsigned char

Callers 1

read_bmp_tilesFunction · 0.85

Calls 1

pixel_elementFunction · 0.85

Tested by

no test coverage detected