FastLED 3.6.0
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.
 

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 336 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 216 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 312 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 169 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.