mirror of
https://github.com/wled/WLED.git
synced 2025-07-22 10:16:32 +00:00
Pinwheel cleanup
This commit is contained in:
parent
a5a6a8eaee
commit
c0cb677a4c
@ -640,7 +640,7 @@ uint16_t IRAM_ATTR Segment::nrOfVStrips() const {
|
|||||||
// Constants for mapping mode "Pinwheel"
|
// Constants for mapping mode "Pinwheel"
|
||||||
#ifndef WLED_DISABLE_2D
|
#ifndef WLED_DISABLE_2D
|
||||||
constexpr int Pinwheel_Steps_Small = 72; // no holes up to 16x16
|
constexpr int Pinwheel_Steps_Small = 72; // no holes up to 16x16
|
||||||
constexpr int Pinwheel_Size_Small = 16;
|
constexpr int Pinwheel_Size_Small = 16; // larger than this -> use "Medium"
|
||||||
constexpr int Pinwheel_Steps_Medium = 192; // no holes up to 32x32
|
constexpr int Pinwheel_Steps_Medium = 192; // no holes up to 32x32
|
||||||
constexpr int Pinwheel_Size_Medium = 32; // larger than this -> use "Big"
|
constexpr int Pinwheel_Size_Medium = 32; // larger than this -> use "Big"
|
||||||
constexpr int Pinwheel_Steps_Big = 304; // no holes up to 50x50
|
constexpr int Pinwheel_Steps_Big = 304; // no holes up to 50x50
|
||||||
@ -656,7 +656,11 @@ constexpr int Fixed_Scale = 512; // fixpoint scaling factor (9bit
|
|||||||
// Pinwheel helper function: pixel index to radians
|
// Pinwheel helper function: pixel index to radians
|
||||||
static float getPinwheelAngle(int i, int vW, int vH) {
|
static float getPinwheelAngle(int i, int vW, int vH) {
|
||||||
int maxXY = max(vW, vH);
|
int maxXY = max(vW, vH);
|
||||||
return (maxXY > Pinwheel_Size_Small) ? ((maxXY > Pinwheel_Size_Medium) ? ((maxXY > Pinwheel_Size_Big) ? float(i) * Int_to_Rad_XL : float(i) * Int_to_Rad_Big) : float(i) * Int_to_Rad_Med) : float(i) * Int_to_Rad_Small;
|
if (maxXY <= Pinwheel_Size_Small) return float(i) * Int_to_Rad_Small;
|
||||||
|
if (maxXY <= Pinwheel_Size_Medium) return float(i) * Int_to_Rad_Med;
|
||||||
|
if (maxXY <= Pinwheel_Size_Big) return float(i) * Int_to_Rad_Big;
|
||||||
|
// else
|
||||||
|
return Pinwheel_Steps_XL;
|
||||||
}
|
}
|
||||||
// Pinwheel helper function: matrix dimensions to number of rays
|
// Pinwheel helper function: matrix dimensions to number of rays
|
||||||
static int getPinwheelLength(int vW, int vH) {
|
static int getPinwheelLength(int vW, int vH) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user