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

Inline functions for swapping bits inside of the byte. More...

Go to the source code of this file.

Functions

static uint8_t GP_BIT_SWAP_B1 (uint8_t byte)
 Reverses 1 bit blocks in the byte.
 
static void gp_bit_swap_row_b1 (uint8_t *row, unsigned int len)
 Reverses 1 bit blocks in a row.
 
static uint8_t GP_BIT_SWAP_B2 (uint8_t byte)
 Reverses 2 bit blocks in the byte.
 
static void gp_bit_swap_row_b2 (uint8_t *row, unsigned int len)
 Reverses 2 bit blocks in a row.
 
static uint8_t GP_BIT_SWAP_B4 (uint8_t byte)
 Reverses 4 bit blocks in the byte.
 
static void gp_bit_swap_row_b4 (uint8_t *row, unsigned int len)
 Reverses 4 bit blocks in a row.
 

Detailed Description

Inline functions for swapping bits inside of the byte.

Definition in file gp_bit_swap.h.

Function Documentation

◆ GP_BIT_SWAP_B1()

static uint8_t GP_BIT_SWAP_B1 ( uint8_t  byte)
inlinestatic

Reverses 1 bit blocks in the byte.

Example:

IN 10101110 OUT 01110101

Parameters
byteAn input byte.
Returns
A reversed byte.

Definition at line 25 of file gp_bit_swap.h.

Referenced by gp_bit_swap_row_b1().

◆ GP_BIT_SWAP_B2()

static uint8_t GP_BIT_SWAP_B2 ( uint8_t  byte)
inlinestatic

Reverses 2 bit blocks in the byte.

Example:

IN 10 11 01 00 OUT 00 01 11 10

Parameters
byteAn input byte.
Returns
A reversed byte.

Definition at line 56 of file gp_bit_swap.h.

Referenced by gp_bit_swap_row_b2().

◆ GP_BIT_SWAP_B4()

static uint8_t GP_BIT_SWAP_B4 ( uint8_t  byte)
inlinestatic

Reverses 4 bit blocks in the byte.

Example:

IN 1011 0100 OUT 0100 1011

Parameters
byteAn input byte.
Returns
A reversed byte.

Definition at line 87 of file gp_bit_swap.h.

Referenced by gp_bit_swap_row_b4().

◆ gp_bit_swap_row_b1()

static void gp_bit_swap_row_b1 ( uint8_t *  row,
unsigned int  len 
)
inlinestatic

Reverses 1 bit blocks in a row.

Parameters
rowA pointer to a start of a row.
lenA number of bytes to reverse.

Definition at line 37 of file gp_bit_swap.h.

References GP_BIT_SWAP_B1().

◆ gp_bit_swap_row_b2()

static void gp_bit_swap_row_b2 ( uint8_t *  row,
unsigned int  len 
)
inlinestatic

Reverses 2 bit blocks in a row.

Parameters
rowA pointer to a start of a row.
lenA number of bytes to reverse.

Definition at line 68 of file gp_bit_swap.h.

References GP_BIT_SWAP_B2().

◆ gp_bit_swap_row_b4()

static void gp_bit_swap_row_b4 ( uint8_t *  row,
unsigned int  len 
)
inlinestatic

Reverses 4 bit blocks in a row.

Parameters
rowA pointer to a start of a row.
lenA number of bytes to reverse.

Definition at line 98 of file gp_bit_swap.h.

References GP_BIT_SWAP_B4().