YoloxResultsPainter constructor

YoloxResultsPainter({
  1. required Image image,
  2. required List<YoloxResults> results,
  3. required List<String> labels,
  4. Paint? drawRectPaint,
  5. TextStyle? labelTextStyle,
})

Implementation

YoloxResultsPainter({
  required this.image,
  required this.results,
  required this.labels,
  Paint? drawRectPaint,
  TextStyle? labelTextStyle,
}) {
  final defaultDrawRectPaint = Paint()
    ..color = Colors.red
    ..style = PaintingStyle.stroke
    ..strokeWidth = min(image.width, image.height) * 0.01;
  this.drawRectPaint = drawRectPaint ?? defaultDrawRectPaint;

  this.labelTextStyle = labelTextStyle ??
      TextStyle(
        color: Colors.red,
        fontWeight: FontWeight.bold,
        fontSize: min(image.width, image.height) * 0.05,
      );
}