FastLED 3.9.15
Loading...
Searching...
No Matches

◆ upscale()

void fl::upscale ( const CRGB * input,
CRGB * output,
uint16_t inputWidth,
uint16_t inputHeight,
fl::XYMap xyMap )
inline

Definition at line 36 of file upscale.h.

37 {
38 uint16_t outputWidth = xyMap.getWidth();
39 uint16_t outputHeight = xyMap.getHeight();
40 const bool wontFit =
41 (outputWidth != xyMap.getWidth() || outputHeight != xyMap.getHeight());
42 // if the input dimensions are not a power of 2 then we can't use the
43 // optimized version.
44 if (wontFit || (inputWidth & (inputWidth - 1)) ||
45 (inputHeight & (inputHeight - 1))) {
46 upscaleArbitrary(input, output, inputWidth, inputHeight, xyMap);
47 } else {
48 upscalePowerOf2(input, output, inputWidth, inputHeight, xyMap);
49 }
50}
XYMap xyMap
Definition gfx.cpp:8
void upscaleArbitrary(const CRGB *input, CRGB *output, uint16_t inputWidth, uint16_t inputHeight, XYMap xyMap)
Performs bilinear interpolation for upscaling an image.
Definition upscale.cpp:20
void upscalePowerOf2(const CRGB *input, CRGB *output, uint8_t inputWidth, uint8_t inputHeight, XYMap xyMap)
Performs bilinear interpolation for upscaling an image.
Definition upscale.cpp:84

References upscaleArbitrary(), upscalePowerOf2(), and xyMap.

Referenced by bilinearExpand(), fl::ScaleUp::expand(), and CRGB::upscale().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: