| 524 | } |
| 525 | |
| 526 | void draw(float pos) { |
| 527 | if (splatRendering) { |
| 528 | fl::Tile2x2_u8_wrap pos_tile = corkscrew.at_wrap(pos); |
| 529 | //FL_WARN("pos_tile: " << pos_tile); |
| 530 | fl::CRGB color = fl::CRGB::Blue; |
| 531 | // Apply color boost using ease functions |
| 532 | fl::EaseType sat_ease = getEaseType(saturationFunction.value()); |
| 533 | fl::EaseType lum_ease = getEaseType(luminanceFunction.value()); |
| 534 | color = color.colorBoost(sat_ease, lum_ease); |
| 535 | // Draw each pixel in the 2x2 tile using the new wrapping API |
| 536 | for (int dx = 0; dx < 2; ++dx) { |
| 537 | for (int dy = 0; dy < 2; ++dy) { |
| 538 | fl::Tile2x2_u8_wrap::Entry data = pos_tile.at(dx, dy); |
| 539 | fl::vec2<fl::u16> wrapped_pos = data.first; // Already wrapped position |
| 540 | uint8_t alpha = data.second; // Alpha value |
| 541 | |
| 542 | if (alpha > 0) { // Only draw if there's some alpha |
| 543 | fl::CRGB c = color; |
| 544 | c.nscale8(alpha); // Scale the color by the alpha value |
| 545 | frameBufferPtr->at(wrapped_pos.x, wrapped_pos.y) = c; |
| 546 | } |
| 547 | } |
| 548 | } |
| 549 | } else { |
| 550 | // None splat rendering, looks aweful. |
| 551 | fl::vec2f pos_vec2f = corkscrew.at_no_wrap(pos); |
| 552 | fl::vec2<fl::u16> pos_i16 = fl::vec2<fl::u16>(pos_vec2f.x, pos_vec2f.y); |
| 553 | |
| 554 | fl::CRGB color = fl::CRGB::Blue; |
| 555 | // Apply color boost using ease functions |
| 556 | fl::EaseType sat_ease = getEaseType(saturationFunction.value()); |
| 557 | fl::EaseType lum_ease = getEaseType(luminanceFunction.value()); |
| 558 | color = color.colorBoost(sat_ease, lum_ease); |
| 559 | |
| 560 | // Now map the cork screw position to the cylindrical buffer that we |
| 561 | // will draw. |
| 562 | frameBufferPtr->at(pos_i16.x, pos_i16.y) = color; // Draw a blue pixel at (w, h) |
| 563 | } |
| 564 | } |
| 565 | |
| 566 | fl::CRGBPalette16 getFirePalette() { |
| 567 | int paletteIndex = (int)firePalette.value(); |
no test coverage detected