composeTextImage method

Future<Uint8List> composeTextImage({
  1. required Uint8List inputImage,
  2. required String text,
  3. String anchor = 'bottomRight',
  4. double margin = 16.0,
  5. String marginUnit = 'px',
  6. double offsetX = 0.0,
  7. double offsetY = 0.0,
  8. String offsetUnit = 'px',
  9. double widthPercent = 0.18,
  10. double opacity = 0.6,
  11. String format = 'jpeg',
  12. double quality = 0.9,
  13. String fontFamily = '.SFUI',
  14. double fontSizePt = 24.0,
  15. int fontWeight = 600,
  16. int colorArgb = 0xFFFFFFFF,
})

Composes inputImage with a text watermark and returns encoded bytes.

Options (defaults mirror composeImage where applicable):

  • text: watermark text (required)
  • anchor: 'topLeft'|'topRight'|'bottomLeft'|'bottomRight'|'center' (default: 'bottomRight')
  • margin: logical px (default: 16.0) with marginUnit 'px'|'percent'
  • offsetX/offsetY: offsets with offsetUnit 'px'|'percent' (default: 0)
  • widthPercent: 0..1 of base width to fit text (default: 0.18)
  • opacity: 0..1 applied post‑raster (default: 0.6)
  • format: 'jpeg' | 'png' (default: 'jpeg'), JPEG quality 0..1
  • fontFamily: default '.SFUI'
  • fontSizePt: default 24.0
  • fontWeight: 100..900 (default 600)
  • colorArgb: ARGB32 integer (default 0xFFFFFFFF)

Implementation

Future<Uint8List> composeTextImage({
  required Uint8List inputImage,
  required String text,
  String anchor = 'bottomRight',
  double margin = 16.0,
  String marginUnit = 'px',
  double offsetX = 0.0,
  double offsetY = 0.0,
  String offsetUnit = 'px',
  double widthPercent = 0.18,
  double opacity = 0.6,
  String format = 'jpeg',
  double quality = 0.9,
  String fontFamily = '.SFUI',
  double fontSizePt = 24.0,
  int fontWeight = 600,
  int colorArgb = 0xFFFFFFFF,
}) {
  throw UnimplementedError('composeTextImage() has not been implemented.');
}