FastLED 3.9.7
Loading...
Searching...
No Matches
Scaling Functions that Leave R1 Dirty

Detailed Description

These functions are more efficient for scaling multiple bytes at once, but require calling cleanup_R1() afterwards.

Functions

LIB8STATIC_ALWAYS_INLINE uint8_t scale8_LEAVING_R1_DIRTY (uint8_t i, fract8 scale)
 This version of scale8() does not clean up the R1 register on AVR.
 
LIB8STATIC_ALWAYS_INLINE void nscale8_LEAVING_R1_DIRTY (uint8_t &i, fract8 scale)
 In place modifying version of scale8() that does not clean up the R1 register on AVR.
 
LIB8STATIC_ALWAYS_INLINE uint8_t scale8_video_LEAVING_R1_DIRTY (uint8_t i, fract8 scale)
 This version of scale8_video() does not clean up the R1 register on AVR.
 
LIB8STATIC_ALWAYS_INLINE void nscale8_video_LEAVING_R1_DIRTY (uint8_t &i, fract8 scale)
 In place modifying version of scale8_video() that does not clean up the R1 register on AVR.
 
LIB8STATIC_ALWAYS_INLINE void cleanup_R1 ()
 Clean up the r1 register after a series of *LEAVING_R1_DIRTY calls.
 
constexpr CRGB nscale8x3_constexpr (uint8_t r, uint8_t g, uint8_t b, fract8 scale)
 

Function Documentation

◆ cleanup_R1()

LIB8STATIC_ALWAYS_INLINE void cleanup_R1 ( )

Clean up the r1 register after a series of *LEAVING_R1_DIRTY calls.

Definition at line 333 of file scale8.h.

◆ nscale8_LEAVING_R1_DIRTY()

LIB8STATIC_ALWAYS_INLINE void nscale8_LEAVING_R1_DIRTY ( uint8_t & i,
fract8 scale )

In place modifying version of scale8() that does not clean up the R1 register on AVR.

If you are doing several "scale8()'s" in a row, use this, and then explicitly call cleanup_R1().

Warning
You MUST call cleanup_R1() after using this function!
Warning
This function always modifies its arguments in place!
Parameters
iinput value to scale
scalescale factor, in n/256 units
See also
scale8()

Definition at line 217 of file scale8.h.

◆ nscale8_video_LEAVING_R1_DIRTY()

LIB8STATIC_ALWAYS_INLINE void nscale8_video_LEAVING_R1_DIRTY ( uint8_t & i,
fract8 scale )

In place modifying version of scale8_video() that does not clean up the R1 register on AVR.

If you are doing several "scale8_video()'s" in a row, use this, and then explicitly call cleanup_R1().

Warning
You MUST call cleanup_R1() after using this function!
Warning
This function always modifies its arguments in place!
Parameters
iinput value to scale
scalescale factor, in n/256 units
See also
scale8_video()

Definition at line 311 of file scale8.h.

◆ nscale8x3_constexpr()

CRGB nscale8x3_constexpr ( uint8_t r,
uint8_t g,
uint8_t b,
fract8 scale )
constexpr

Definition at line 340 of file scale8.h.

◆ scale8_LEAVING_R1_DIRTY()

LIB8STATIC_ALWAYS_INLINE uint8_t scale8_LEAVING_R1_DIRTY ( uint8_t i,
fract8 scale )

This version of scale8() does not clean up the R1 register on AVR.

If you are doing several "scale8()'s" in a row, use this, and then explicitly call cleanup_R1().

Warning
You MUST call cleanup_R1() after using this function!
Parameters
iinput value to scale
scalescale factor, in n/256 units
Returns
scaled value
See also
scale8()

Definition at line 170 of file scale8.h.

◆ scale8_video_LEAVING_R1_DIRTY()

LIB8STATIC_ALWAYS_INLINE uint8_t scale8_video_LEAVING_R1_DIRTY ( uint8_t i,
fract8 scale )

This version of scale8_video() does not clean up the R1 register on AVR.

If you are doing several "scale8_video()'s" in a row, use this, and then explicitly call cleanup_R1().

Warning
You MUST call cleanup_R1() after using this function!
Parameters
iinput value to scale
scalescale factor, in n/256 units
Returns
scaled value
See also
scale8_video()

Definition at line 262 of file scale8.h.