apply method
Applies bloom to the canvas by drawing a blurred overlay of bright areas.
Implementation
void apply(Canvas canvas, Size size) {
if (!enabled || intensity <= 0) return;
// Simulate bloom with a bright glow overlay at center
// For a real implementation, this would sample the rendered frame
// and blur bright pixels. With Canvas API, we approximate with a radial glow.
final center = Offset(size.width / 2, size.height / 2);
canvas.drawCircle(
center,
size.width * 0.4,
Paint()
..color = Color.fromARGB((intensity * 30).toInt(), 255, 255, 255)
..maskFilter = MaskFilter.blur(BlurStyle.normal, radius)
..blendMode = BlendMode.screen,
);
}