735 {
736 PixelT* pixels = canvas.
pixels;
739
744
745 fl::i32 r_ii8 = r8 - 128;
746 fl::i32 r_io8 = r8 + 128;
747 fl::i32 r_oi8 = r8 + t8 - 128;
748 fl::i32 r_oo8 = r8 + t8 + 128;
749
750 if (r_ii8 < 0) r_ii8 = 0;
751 if (r_io8 < 0) r_io8 = 0;
752
753 fl::i32 ii2 = r_ii8 * r_ii8;
754 fl::i32 io2 = r_io8 * r_io8;
755 fl::i32 oi2 = r_oi8 * r_oi8;
756 fl::i32 oo2 = r_oo8 * r_oo8;
757
758 fl::i32 inner_band = io2 - ii2;
759 fl::i32 outer_band = oo2 - oi2;
760
761 int ri = (r_oo8 >> 8) + 1;
762 int cxi = cx8 >> 8;
763 int cyi = cy8 >> 8;
764
765 int xmin = cxi - ri; if (xmin < 0) xmin = 0;
766 int xmax = cxi + ri;
if (xmax >=
width) xmax =
width - 1;
767 if (xmin > xmax) return;
768 if (cyi + ri < 0 || cyi - ri >=
height)
return;
769
770 fl::i32 dx8 = (static_cast<fl::i32>(xmin) << 8) - cx8;
771 fl::i32 dx2 = dx8 * dx8;
772
774 gc.
xdelta0 = 512 * dx8 + 65536;
782
783 fl::i32 cyfrac = (static_cast<fl::i32>(cyi) << 8) - cy8;
784 fl::i32 d2c = dx2 + cyfrac * cyfrac;
785
786 if (cyi >= 0 && cyi <
height)
788
789 fl::i32 botd2 = d2c, botdelta = 512 * cyfrac + 65536;
790 fl::i32 topd2 = d2c, topdelta = -512 * cyfrac + 65536;
791 botd2 += botdelta; botdelta += 131072;
792 topd2 += topdelta; topdelta += 131072;
793
794 for (int dy = 1; dy <= ri; ++dy) {
795 bool cbot = (botd2 - dx2 <= oo2);
796 bool ctop = (topd2 - dx2 <= oo2);
797 if (!cbot && !ctop) break;
798 int pyb = cyi + dy, pyt = cyi - dy;
799 if (cbot && pyb >= 0 && pyb <
height)
801 if (ctop && pyt >= 0 && pyt <
height)
803 botd2 += botdelta; botdelta += 131072;
804 topd2 += topdelta; topdelta += 131072;
805 }
806}
void renderRingRow(PixelT *buf, int w, int py, fl::i32 d2_row, const RingCtx< PixelT > &g) FL_NO_EXCEPT
Render one scanline of a ring using incremental d² with phase-based scanning.
fl::i32 toFixed8(Coord val) FL_NO_EXCEPT
Convert any Coord type to 8.8 fixed-point (fl::i32).
void computeBandShift(fl::i32 band, fl::u8 &shift_out, fl::u16 &inv_out) FL_NO_EXCEPT
Precompute right-shift and reciprocal multiplier for AA division.
Ring context: bundles all per-circle constants into a struct passed by reference.