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

A pixel defintions generated from gen/include/gfxprim_config.py. More...

Go to the source code of this file.

Macros

#define GP_PIXEL_CHANS_MAX   4
 Maximal number of channels per all defined pixel types.
 
#define GP_PIXEL_ADDR_RGB101010(pixmap, x, y)   GP_PIXEL_ADDR_32BPP(pixmap, x, y)
 A macro to get address of a pixel RGB101010 at x, y in a pixmap.
 
#define GP_PIXEL_ADDR_xRGB8888(pixmap, x, y)   GP_PIXEL_ADDR_32BPP(pixmap, x, y)
 A macro to get address of a pixel xRGB8888 at x, y in a pixmap.
 
#define GP_PIXEL_ADDR_RGBA8888(pixmap, x, y)   GP_PIXEL_ADDR_32BPP(pixmap, x, y)
 A macro to get address of a pixel RGBA8888 at x, y in a pixmap.
 
#define GP_PIXEL_ADDR_RGB888(pixmap, x, y)   GP_PIXEL_ADDR_24BPP(pixmap, x, y)
 A macro to get address of a pixel RGB888 at x, y in a pixmap.
 
#define GP_PIXEL_ADDR_BGR888(pixmap, x, y)   GP_PIXEL_ADDR_24BPP(pixmap, x, y)
 A macro to get address of a pixel BGR888 at x, y in a pixmap.
 
#define GP_PIXEL_ADDR_RGB555(pixmap, x, y)   GP_PIXEL_ADDR_16BPP(pixmap, x, y)
 A macro to get address of a pixel RGB555 at x, y in a pixmap.
 
#define GP_PIXEL_ADDR_RGB565(pixmap, x, y)   GP_PIXEL_ADDR_16BPP(pixmap, x, y)
 A macro to get address of a pixel RGB565 at x, y in a pixmap.
 
#define GP_PIXEL_ADDR_RGB666(pixmap, x, y)   GP_PIXEL_ADDR_18BPP_DB(pixmap, x, y)
 A macro to get address of a pixel RGB666 at x, y in a pixmap.
 
#define GP_PIXEL_ADDR_RGB332(pixmap, x, y)   GP_PIXEL_ADDR_8BPP(pixmap, x, y)
 A macro to get address of a pixel RGB332 at x, y in a pixmap.
 
#define GP_PIXEL_ADDR_CMYK8888(pixmap, x, y)   GP_PIXEL_ADDR_32BPP(pixmap, x, y)
 A macro to get address of a pixel CMYK8888 at x, y in a pixmap.
 
#define GP_PIXEL_ADDR_P2(pixmap, x, y)   GP_PIXEL_ADDR_2BPP_UB(pixmap, x, y)
 A macro to get address of a pixel P2 at x, y in a pixmap.
 
#define GP_PIXEL_ADDR_P4(pixmap, x, y)   GP_PIXEL_ADDR_4BPP_UB(pixmap, x, y)
 A macro to get address of a pixel P4 at x, y in a pixmap.
 
#define GP_PIXEL_ADDR_P8(pixmap, x, y)   GP_PIXEL_ADDR_8BPP(pixmap, x, y)
 A macro to get address of a pixel P8 at x, y in a pixmap.
 
#define GP_PIXEL_ADDR_G1_DB(pixmap, x, y)   GP_PIXEL_ADDR_1BPP_DB(pixmap, x, y)
 A macro to get address of a pixel G1_DB at x, y in a pixmap.
 
#define GP_PIXEL_ADDR_G2_DB(pixmap, x, y)   GP_PIXEL_ADDR_2BPP_DB(pixmap, x, y)
 A macro to get address of a pixel G2_DB at x, y in a pixmap.
 
#define GP_PIXEL_ADDR_G4_DB(pixmap, x, y)   GP_PIXEL_ADDR_4BPP_DB(pixmap, x, y)
 A macro to get address of a pixel G4_DB at x, y in a pixmap.
 
#define GP_PIXEL_ADDR_G1_UB(pixmap, x, y)   GP_PIXEL_ADDR_1BPP_UB(pixmap, x, y)
 A macro to get address of a pixel G1_UB at x, y in a pixmap.
 
#define GP_PIXEL_ADDR_G2_UB(pixmap, x, y)   GP_PIXEL_ADDR_2BPP_UB(pixmap, x, y)
 A macro to get address of a pixel G2_UB at x, y in a pixmap.
 
#define GP_PIXEL_ADDR_G4_UB(pixmap, x, y)   GP_PIXEL_ADDR_4BPP_UB(pixmap, x, y)
 A macro to get address of a pixel G4_UB at x, y in a pixmap.
 
#define GP_PIXEL_ADDR_G8(pixmap, x, y)   GP_PIXEL_ADDR_8BPP(pixmap, x, y)
 A macro to get address of a pixel G8 at x, y in a pixmap.
 
#define GP_PIXEL_ADDR_GA88(pixmap, x, y)   GP_PIXEL_ADDR_16BPP(pixmap, x, y)
 A macro to get address of a pixel GA88 at x, y in a pixmap.
 
#define GP_PIXEL_ADDR_G16(pixmap, x, y)   GP_PIXEL_ADDR_16BPP(pixmap, x, y)
 A macro to get address of a pixel G16 at x, y in a pixmap.
 

Typedefs

typedef enum gp_pixel_type gp_pixel_type
 List of all pixel types.
 

Enumerations

enum  gp_pixel_type {
  GP_PIXEL_UNKNOWN , GP_PIXEL_RGB101010 , GP_PIXEL_xRGB8888 , GP_PIXEL_RGBA8888 ,
  GP_PIXEL_RGB888 , GP_PIXEL_BGR888 , GP_PIXEL_RGB555 , GP_PIXEL_RGB565 ,
  GP_PIXEL_RGB666 , GP_PIXEL_RGB332 , GP_PIXEL_CMYK8888 , GP_PIXEL_P2 ,
  GP_PIXEL_P4 , GP_PIXEL_P8 , GP_PIXEL_G1_DB , GP_PIXEL_G2_DB ,
  GP_PIXEL_G4_DB , GP_PIXEL_G1_UB , GP_PIXEL_G2_UB , GP_PIXEL_G4_UB ,
  GP_PIXEL_G8 , GP_PIXEL_GA88 , GP_PIXEL_G16 , GP_PIXEL_MAX
}
 List of all pixel types. More...
 

Detailed Description

A pixel defintions generated from gen/include/gfxprim_config.py.

Warning
All the actual values here depends on the configuration. If you change the definitions of pixel types in the gfxprim_config.py values will be different!

Definition in file gp_pixel.gen.h.

Macro Definition Documentation

◆ GP_PIXEL_ADDR_BGR888

#define GP_PIXEL_ADDR_BGR888 (   pixmap,
  x,
 
)    GP_PIXEL_ADDR_24BPP(pixmap, x, y)

A macro to get address of a pixel BGR888 at x, y in a pixmap.

Parameters
pixmapA pixmap.
xA x coordiate.
yA y coordiate.
Returns
A pointer to the first byte of the pixel.

Definition at line 311 of file gp_pixel.gen.h.

◆ GP_PIXEL_ADDR_CMYK8888

#define GP_PIXEL_ADDR_CMYK8888 (   pixmap,
  x,
 
)    GP_PIXEL_ADDR_32BPP(pixmap, x, y)

A macro to get address of a pixel CMYK8888 at x, y in a pixmap.

Parameters
pixmapA pixmap.
xA x coordiate.
yA y coordiate.
Returns
A pointer to the first byte of the pixel.

Definition at line 391 of file gp_pixel.gen.h.

◆ GP_PIXEL_ADDR_G16

#define GP_PIXEL_ADDR_G16 (   pixmap,
  x,
 
)    GP_PIXEL_ADDR_16BPP(pixmap, x, y)

A macro to get address of a pixel G16 at x, y in a pixmap.

Parameters
pixmapA pixmap.
xA x coordiate.
yA y coordiate.
Returns
A pointer to the first byte of the pixel.

Definition at line 583 of file gp_pixel.gen.h.

◆ GP_PIXEL_ADDR_G1_DB

#define GP_PIXEL_ADDR_G1_DB (   pixmap,
  x,
 
)    GP_PIXEL_ADDR_1BPP_DB(pixmap, x, y)

A macro to get address of a pixel G1_DB at x, y in a pixmap.

Parameters
pixmapA pixmap.
xA x coordiate.
yA y coordiate.
Returns
A pointer to the first byte of the pixel.

Definition at line 455 of file gp_pixel.gen.h.

◆ GP_PIXEL_ADDR_G1_UB

#define GP_PIXEL_ADDR_G1_UB (   pixmap,
  x,
 
)    GP_PIXEL_ADDR_1BPP_UB(pixmap, x, y)

A macro to get address of a pixel G1_UB at x, y in a pixmap.

Parameters
pixmapA pixmap.
xA x coordiate.
yA y coordiate.
Returns
A pointer to the first byte of the pixel.

Definition at line 503 of file gp_pixel.gen.h.

◆ GP_PIXEL_ADDR_G2_DB

#define GP_PIXEL_ADDR_G2_DB (   pixmap,
  x,
 
)    GP_PIXEL_ADDR_2BPP_DB(pixmap, x, y)

A macro to get address of a pixel G2_DB at x, y in a pixmap.

Parameters
pixmapA pixmap.
xA x coordiate.
yA y coordiate.
Returns
A pointer to the first byte of the pixel.

Definition at line 471 of file gp_pixel.gen.h.

◆ GP_PIXEL_ADDR_G2_UB

#define GP_PIXEL_ADDR_G2_UB (   pixmap,
  x,
 
)    GP_PIXEL_ADDR_2BPP_UB(pixmap, x, y)

A macro to get address of a pixel G2_UB at x, y in a pixmap.

Parameters
pixmapA pixmap.
xA x coordiate.
yA y coordiate.
Returns
A pointer to the first byte of the pixel.

Definition at line 519 of file gp_pixel.gen.h.

◆ GP_PIXEL_ADDR_G4_DB

#define GP_PIXEL_ADDR_G4_DB (   pixmap,
  x,
 
)    GP_PIXEL_ADDR_4BPP_DB(pixmap, x, y)

A macro to get address of a pixel G4_DB at x, y in a pixmap.

Parameters
pixmapA pixmap.
xA x coordiate.
yA y coordiate.
Returns
A pointer to the first byte of the pixel.

Definition at line 487 of file gp_pixel.gen.h.

◆ GP_PIXEL_ADDR_G4_UB

#define GP_PIXEL_ADDR_G4_UB (   pixmap,
  x,
 
)    GP_PIXEL_ADDR_4BPP_UB(pixmap, x, y)

A macro to get address of a pixel G4_UB at x, y in a pixmap.

Parameters
pixmapA pixmap.
xA x coordiate.
yA y coordiate.
Returns
A pointer to the first byte of the pixel.

Definition at line 535 of file gp_pixel.gen.h.

◆ GP_PIXEL_ADDR_G8

#define GP_PIXEL_ADDR_G8 (   pixmap,
  x,
 
)    GP_PIXEL_ADDR_8BPP(pixmap, x, y)

A macro to get address of a pixel G8 at x, y in a pixmap.

Parameters
pixmapA pixmap.
xA x coordiate.
yA y coordiate.
Returns
A pointer to the first byte of the pixel.

Definition at line 551 of file gp_pixel.gen.h.

◆ GP_PIXEL_ADDR_GA88

#define GP_PIXEL_ADDR_GA88 (   pixmap,
  x,
 
)    GP_PIXEL_ADDR_16BPP(pixmap, x, y)

A macro to get address of a pixel GA88 at x, y in a pixmap.

Parameters
pixmapA pixmap.
xA x coordiate.
yA y coordiate.
Returns
A pointer to the first byte of the pixel.

Definition at line 567 of file gp_pixel.gen.h.

◆ GP_PIXEL_ADDR_P2

#define GP_PIXEL_ADDR_P2 (   pixmap,
  x,
 
)    GP_PIXEL_ADDR_2BPP_UB(pixmap, x, y)

A macro to get address of a pixel P2 at x, y in a pixmap.

Parameters
pixmapA pixmap.
xA x coordiate.
yA y coordiate.
Returns
A pointer to the first byte of the pixel.

Definition at line 407 of file gp_pixel.gen.h.

◆ GP_PIXEL_ADDR_P4

#define GP_PIXEL_ADDR_P4 (   pixmap,
  x,
 
)    GP_PIXEL_ADDR_4BPP_UB(pixmap, x, y)

A macro to get address of a pixel P4 at x, y in a pixmap.

Parameters
pixmapA pixmap.
xA x coordiate.
yA y coordiate.
Returns
A pointer to the first byte of the pixel.

Definition at line 423 of file gp_pixel.gen.h.

◆ GP_PIXEL_ADDR_P8

#define GP_PIXEL_ADDR_P8 (   pixmap,
  x,
 
)    GP_PIXEL_ADDR_8BPP(pixmap, x, y)

A macro to get address of a pixel P8 at x, y in a pixmap.

Parameters
pixmapA pixmap.
xA x coordiate.
yA y coordiate.
Returns
A pointer to the first byte of the pixel.

Definition at line 439 of file gp_pixel.gen.h.

◆ GP_PIXEL_ADDR_RGB101010

#define GP_PIXEL_ADDR_RGB101010 (   pixmap,
  x,
 
)    GP_PIXEL_ADDR_32BPP(pixmap, x, y)

A macro to get address of a pixel RGB101010 at x, y in a pixmap.

Parameters
pixmapA pixmap.
xA x coordiate.
yA y coordiate.
Returns
A pointer to the first byte of the pixel.

Definition at line 247 of file gp_pixel.gen.h.

◆ GP_PIXEL_ADDR_RGB332

#define GP_PIXEL_ADDR_RGB332 (   pixmap,
  x,
 
)    GP_PIXEL_ADDR_8BPP(pixmap, x, y)

A macro to get address of a pixel RGB332 at x, y in a pixmap.

Parameters
pixmapA pixmap.
xA x coordiate.
yA y coordiate.
Returns
A pointer to the first byte of the pixel.

Definition at line 375 of file gp_pixel.gen.h.

◆ GP_PIXEL_ADDR_RGB555

#define GP_PIXEL_ADDR_RGB555 (   pixmap,
  x,
 
)    GP_PIXEL_ADDR_16BPP(pixmap, x, y)

A macro to get address of a pixel RGB555 at x, y in a pixmap.

Parameters
pixmapA pixmap.
xA x coordiate.
yA y coordiate.
Returns
A pointer to the first byte of the pixel.

Definition at line 327 of file gp_pixel.gen.h.

◆ GP_PIXEL_ADDR_RGB565

#define GP_PIXEL_ADDR_RGB565 (   pixmap,
  x,
 
)    GP_PIXEL_ADDR_16BPP(pixmap, x, y)

A macro to get address of a pixel RGB565 at x, y in a pixmap.

Parameters
pixmapA pixmap.
xA x coordiate.
yA y coordiate.
Returns
A pointer to the first byte of the pixel.

Definition at line 343 of file gp_pixel.gen.h.

◆ GP_PIXEL_ADDR_RGB666

#define GP_PIXEL_ADDR_RGB666 (   pixmap,
  x,
 
)    GP_PIXEL_ADDR_18BPP_DB(pixmap, x, y)

A macro to get address of a pixel RGB666 at x, y in a pixmap.

Parameters
pixmapA pixmap.
xA x coordiate.
yA y coordiate.
Returns
A pointer to the first byte of the pixel.

Definition at line 359 of file gp_pixel.gen.h.

◆ GP_PIXEL_ADDR_RGB888

#define GP_PIXEL_ADDR_RGB888 (   pixmap,
  x,
 
)    GP_PIXEL_ADDR_24BPP(pixmap, x, y)

A macro to get address of a pixel RGB888 at x, y in a pixmap.

Parameters
pixmapA pixmap.
xA x coordiate.
yA y coordiate.
Returns
A pointer to the first byte of the pixel.

Definition at line 295 of file gp_pixel.gen.h.

◆ GP_PIXEL_ADDR_RGBA8888

#define GP_PIXEL_ADDR_RGBA8888 (   pixmap,
  x,
 
)    GP_PIXEL_ADDR_32BPP(pixmap, x, y)

A macro to get address of a pixel RGBA8888 at x, y in a pixmap.

Parameters
pixmapA pixmap.
xA x coordiate.
yA y coordiate.
Returns
A pointer to the first byte of the pixel.

Definition at line 279 of file gp_pixel.gen.h.

◆ GP_PIXEL_ADDR_xRGB8888

#define GP_PIXEL_ADDR_xRGB8888 (   pixmap,
  x,
 
)    GP_PIXEL_ADDR_32BPP(pixmap, x, y)

A macro to get address of a pixel xRGB8888 at x, y in a pixmap.

Parameters
pixmapA pixmap.
xA x coordiate.
yA y coordiate.
Returns
A pointer to the first byte of the pixel.

Definition at line 263 of file gp_pixel.gen.h.

◆ GP_PIXEL_CHANS_MAX

#define GP_PIXEL_CHANS_MAX   4

Maximal number of channels per all defined pixel types.

Warning
The value may change if gfxprim_config.py is changed.

Definition at line 235 of file gp_pixel.gen.h.

Typedef Documentation

◆ gp_pixel_type

List of all pixel types.

The type always contains GP_PIXEL_UNKNOWN = 0 and GP_PIXEL_MAX as the last value (also the number of valid types) The types are numbered to use the entire range 0 .. GP_PIXEL_MAX-1. Some pixel types have aliases defined in gp_pixel_type_alias .

You can index the gp_pixel_types array with a pixel type to get detailed info about a pixel type at a runtime.

A pixel definition is a two layered, the top layer defines a packing i.e. gp_pixel_pack which describes pixel size and how pixels are stored in the pixmap buffer, then pixel type completes the definition by adding how channels are defined in each individual pixel.

Some functions need only pixel packing to operate correctly, e.g. if you need to fill in a buffer with a single pixel value, while other need to know the whole pixel type, e.g. filters that operate on individual channel values.

Note that two pixels can have the same channels, packing and size but stil differ e.g. RGB888 and BGR888 or same channels, different packing and size, e.g. RGB888 and xRGB8888 or same channels and size but different packing e.g. G1_UB and G1_DB which differ in the direction bits are read in the byte.

Also note that on the top of this pixel channels may not be linear and hence may need to be linearized before you can operate on the values. That is not encoded in the pixel type but rather at the gp_pixmap level where you can set a gp_gamma correction with gp_pixmap_gamma_set() independently of the pixel type.

Enumeration Type Documentation

◆ gp_pixel_type

List of all pixel types.

The type always contains GP_PIXEL_UNKNOWN = 0 and GP_PIXEL_MAX as the last value (also the number of valid types) The types are numbered to use the entire range 0 .. GP_PIXEL_MAX-1. Some pixel types have aliases defined in gp_pixel_type_alias .

You can index the gp_pixel_types array with a pixel type to get detailed info about a pixel type at a runtime.

A pixel definition is a two layered, the top layer defines a packing i.e. gp_pixel_pack which describes pixel size and how pixels are stored in the pixmap buffer, then pixel type completes the definition by adding how channels are defined in each individual pixel.

Some functions need only pixel packing to operate correctly, e.g. if you need to fill in a buffer with a single pixel value, while other need to know the whole pixel type, e.g. filters that operate on individual channel values.

Note that two pixels can have the same channels, packing and size but stil differ e.g. RGB888 and BGR888 or same channels, different packing and size, e.g. RGB888 and xRGB8888 or same channels and size but different packing e.g. G1_UB and G1_DB which differ in the direction bits are read in the byte.

Also note that on the top of this pixel channels may not be linear and hence may need to be linearized before you can operate on the values. That is not encoded in the pixel type but rather at the gp_pixmap level where you can set a gp_gamma correction with gp_pixmap_gamma_set() independently of the pixel type.

Enumerator
GP_PIXEL_UNKNOWN 

Pixel type UNKNOWN.

Returned when pixel matching functions such as gp_pixel_rgb_lookup() when match wasn't found.

GP_PIXEL_RGB101010 

Pixel type RGB101010.

BBBBBBBBBBGGGGGGGGGGRRRRRRRRRRxx

GP_PIXEL_xRGB8888 

Pixel type xRGB8888.

BBBBBBBBGGGGGGGGRRRRRRRRxxxxxxxx

GP_PIXEL_RGBA8888 

Pixel type RGBA8888.

AAAAAAAABBBBBBBBGGGGGGGGRRRRRRRR

GP_PIXEL_RGB888 

Pixel type RGB888.

BBBBBBBBGGGGGGGGRRRRRRRR

GP_PIXEL_BGR888 

Pixel type BGR888.

RRRRRRRRGGGGGGGGBBBBBBBB

GP_PIXEL_RGB555 

Pixel type RGB555.

BBBBBGGGGGRRRRRx

GP_PIXEL_RGB565 

Pixel type RGB565.

BBBBBGGGGGGRRRRR

GP_PIXEL_RGB666 

Pixel type RGB666.

BBBBBBGGGGGGRRRRRR

GP_PIXEL_RGB332 

Pixel type RGB332.

BBGGGRRR

GP_PIXEL_CMYK8888 

Pixel type CMYK8888.

CCCCCCCCMMMMMMMMYYYYYYYYKKKKKKKK

GP_PIXEL_P2 

Pixel type P2.

PP

GP_PIXEL_P4 

Pixel type P4.

PPPP

GP_PIXEL_P8 

Pixel type P8.

PPPPPPPP

GP_PIXEL_G1_DB 

Pixel type G1_DB.

V

GP_PIXEL_G2_DB 

Pixel type G2_DB.

VV

GP_PIXEL_G4_DB 

Pixel type G4_DB.

VVVV

GP_PIXEL_G1_UB 

Pixel type G1_UB.

V

GP_PIXEL_G2_UB 

Pixel type G2_UB.

VV

GP_PIXEL_G4_UB 

Pixel type G4_UB.

VVVV

GP_PIXEL_G8 

Pixel type G8.

VVVVVVVV

GP_PIXEL_GA88 

Pixel type GA88.

VVVVVVVVAAAAAAAA

GP_PIXEL_G16 

Pixel type G16.

VVVVVVVVVVVVVVVV

GP_PIXEL_MAX 

Last valid pixel type has value GP_PIXEL_MAX-1.

Definition at line 62 of file gp_pixel.gen.h.