GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
Functions
gp_convert.h File Reference

A pixel value conversions. More...

#include <core/gp_pixmap.h>
#include <core/gp_pixel.h>
#include <core/gp_convert.gen.h>
#include <core/gp_convert_scale.gen.h>

Go to the source code of this file.

Functions

static gp_pixel gp_rgb_to_pixel (uint8_t r, uint8_t g, uint8_t b, gp_pixel_type type)
 Converts a color specified by its R, G, B components to a specified type.
 
static gp_pixel gp_rgba_to_pixel (uint8_t r, uint8_t g, uint8_t b, uint8_t a, gp_pixel_type type)
 Converts a color specified by its R, G, B, A components to a specified type.
 

Detailed Description

A pixel value conversions.

Definition in file gp_convert.h.

Function Documentation

◆ gp_rgb_to_pixel()

static gp_pixel gp_rgb_to_pixel ( uint8_t  r,
uint8_t  g,
uint8_t  b,
gp_pixel_type  type 
)
inlinestatic

Converts a color specified by its R, G, B components to a specified type.

Parameters
rA red channel value.
gA green channel value.
bA blue channel value.
typeA pixel type for the resulting pixel value.
Returns
A pixel value.

Definition at line 30 of file gp_convert.h.

References gp_RGB888_to_pixel().

◆ gp_rgba_to_pixel()

static gp_pixel gp_rgba_to_pixel ( uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  a,
gp_pixel_type  type 
)
inlinestatic

Converts a color specified by its R, G, B, A components to a specified type.

Parameters
rA red channel value.
gA green channel value.
bA blue channel value.
aAn alpha channel value.
typeA pixel type for the resulting pixel value.
Returns
A pixel value.

Definition at line 48 of file gp_convert.h.

References gp_RGBA8888_to_pixel().