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

Fast value scaling macros. More...

Go to the source code of this file.

Macros

#define GP_SCALE_VAL(s1, s2, val)   ( GP_SCALE_VAL_##s1##_##s2(val) )
 Helper macros to transfer s1-bit value to s2-bit value.
 

Detailed Description

Fast value scaling macros.

Definition in file gp_convert_scale.gen.h.

Macro Definition Documentation

◆ GP_SCALE_VAL

#define GP_SCALE_VAL (   s1,
  s2,
  val 
)    ( GP_SCALE_VAL_##s1##_##s2(val) )

Helper macros to transfer s1-bit value to s2-bit value.

Efficient and accurate for both up- and downscaling.

Warning
GP_SCALE_VAL requires constants numbers as first two parameters.
Parameters
s1Number of bits to scale from.
s2Number of bits to scale to.
valA value to be scaled.
Returns
A scaled value.

Definition at line 35 of file gp_convert_scale.gen.h.