659 {
660 PixelT* pixels = canvas.
pixels;
663
667
668 fl::i32 rin8 = r8 - 128;
669 fl::i32 rout8 = r8 + 128;
670
671 fl::i32 rin2 = rin8 * rin8;
672 fl::i32 rout2 = rout8 * rout8;
673 fl::i32 band = rout2 - rin2;
674 if (band <= 0) return;
675
676 int ri = (rout8 >> 8) + 1;
677 int cxi = cx8 >> 8;
678 int cyi = cy8 >> 8;
679
680 int xmin = cxi - ri; if (xmin < 0) xmin = 0;
681 int xmax = cxi + ri;
if (xmax >=
width) xmax =
width - 1;
682 if (xmin > xmax) return;
683 if (cyi + ri < 0 || cyi - ri >=
height)
return;
684
685 fl::i32 dx8 = (static_cast<fl::i32>(xmin) << 8) - cx8;
686 fl::i32 dx2 = dx8 * dx8;
687
689 fc.
xdelta0 = 512 * dx8 + 65536;
694
695 fl::i32 cyfrac = (static_cast<fl::i32>(cyi) << 8) - cy8;
696 fl::i32 d2c = dx2 + cyfrac * cyfrac;
697
698 if (cyi >= 0 && cyi <
height)
700
701 fl::i32 botd2 = d2c, botdelta = 512 * cyfrac + 65536;
702 fl::i32 topd2 = d2c, topdelta = -512 * cyfrac + 65536;
703 botd2 += botdelta; botdelta += 131072;
704 topd2 += topdelta; topdelta += 131072;
705
706 for (int dy = 1; dy <= ri; ++dy) {
707 bool cbot = (botd2 - dx2 <= rout2);
708 bool ctop = (topd2 - dx2 <= rout2);
709 if (!cbot && !ctop) break;
710 int pyb = cyi + dy, pyt = cyi - dy;
711 if (cbot && pyb >= 0 && pyb <
height)
713 if (ctop && pyt >= 0 && pyt <
height)
715 botd2 += botdelta; botdelta += 131072;
716 topd2 += topdelta; topdelta += 131072;
717 }
718}
void renderDiscRow(PixelT *buf, int w, int py, fl::i32 d2_row, const DiscCtx< PixelT > &f) FL_NO_EXCEPT
Render one scanline of a disc using incremental d².
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.
Disc context: bundles per-circle constants into a struct passed by reference.