GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
Typedefs | Enumerations | Functions
gp_pixel_pack.gen.h File Reference

Defines how are pixels packed in a buffer. More...

Go to the source code of this file.

Typedefs

typedef enum gp_pixel_pack gp_pixel_pack
 Pixel packings.
 

Enumerations

enum  gp_pixel_pack {
  GP_PIXEL_PACK_1BPP_DB = 0x71 , GP_PIXEL_PACK_1BPP_UB = 0x01 , GP_PIXEL_PACK_2BPP_DB = 0x72 , GP_PIXEL_PACK_2BPP_UB = 0x02 ,
  GP_PIXEL_PACK_4BPP_DB = 0x74 , GP_PIXEL_PACK_4BPP_UB = 0x04 , GP_PIXEL_PACK_8BPP = 0x08 , GP_PIXEL_PACK_16BPP = 0x10 ,
  GP_PIXEL_PACK_24BPP = 0x18 , GP_PIXEL_PACK_32BPP = 0x20 , GP_PIXEL_PACK_18BPP_DB = 0x82
}
 Pixel packings. More...
 

Functions

uint8_t gp_pixel_bpp_by_pack (enum gp_pixel_pack pack)
 Returns pixel size, e.g. bits per pixel given pixel packing.
 

Detailed Description

Defines how are pixels packed in a buffer.

Definition in file gp_pixel_pack.gen.h.

Typedef Documentation

◆ gp_pixel_pack

Pixel packings.

Pixel packing defines how pixels are packed in a stream of bytes. Note that there may be more than one packing defined for a single pixel size.

The bits_per_pixel (pixel size) defines how big is a pixel, it's useful for determining the buffer size, but it does not tell us anything about how pixels are stacked in the buffer. Note that for 4bit depth there are two ways how to interpret which half byte goes first. So there will always be more different packings than pixel sizes.

Enumeration Type Documentation

◆ gp_pixel_pack

Pixel packings.

Pixel packing defines how pixels are packed in a stream of bytes. Note that there may be more than one packing defined for a single pixel size.

The bits_per_pixel (pixel size) defines how big is a pixel, it's useful for determining the buffer size, but it does not tell us anything about how pixels are stacked in the buffer. Note that for 4bit depth there are two ways how to interpret which half byte goes first. So there will always be more different packings than pixel sizes.

Enumerator
GP_PIXEL_PACK_1BPP_DB 

GP_PIXEL_PACK_1BPP_DB.

GP_PIXEL_PACK_1BPP_UB 

GP_PIXEL_PACK_1BPP_UB.

GP_PIXEL_PACK_2BPP_DB 

GP_PIXEL_PACK_2BPP_DB.

GP_PIXEL_PACK_2BPP_UB 

GP_PIXEL_PACK_2BPP_UB.

GP_PIXEL_PACK_4BPP_DB 

GP_PIXEL_PACK_4BPP_DB.

GP_PIXEL_PACK_4BPP_UB 

GP_PIXEL_PACK_4BPP_UB.

GP_PIXEL_PACK_8BPP 

GP_PIXEL_PACK_8BPP.

GP_PIXEL_PACK_16BPP 

GP_PIXEL_PACK_16BPP.

GP_PIXEL_PACK_24BPP 

GP_PIXEL_PACK_24BPP.

GP_PIXEL_PACK_32BPP 

GP_PIXEL_PACK_32BPP.

GP_PIXEL_PACK_18BPP_DB 

GP_PIXEL_PACK_18BPP_DB.

Definition at line 33 of file gp_pixel_pack.gen.h.

Function Documentation

◆ gp_pixel_bpp_by_pack()

uint8_t gp_pixel_bpp_by_pack ( enum gp_pixel_pack  pack)

Returns pixel size, e.g. bits per pixel given pixel packing.

Parameters
packA pixel packing.
Returns
Number of bits used by the pixel.