merge method

TransformationData merge(
  1. TMode? mode,
  2. String? image,
  3. String? transformation,
  4. String? background,
  5. int? height,
  6. int? width,
  7. int? top,
  8. int? left,
  9. TGravity? gravity,
  10. TBlend? blend,
  11. bool? tile,
  12. String? listOfBboxes,
  13. String? listOfPolygons,
)

Method for Basic Transformations

  • mode : TMode (Default: overlay)

  • image : image (Default: )

  • transformation : transformation (Default: )

  • background : background (Default: "00000000")

  • height : height (Default: 0)

  • width : width (Default: 0)

  • top : top (Default: 0)

  • left : left (Default: 0)

  • gravity : TGravity (Default: center)

  • blend : TBlend (Default: over)

  • tile : tile (Default: false)

  • listOfBboxes : List of bboxes (Default: )

  • listOfPolygons : List of Polygons (Default: )

Returns TransformationData.

Implementation

TransformationData merge(
  TMode? mode,
  String? image,
  String? transformation,
  String? background,
  int? height,
  int? width,
  int? top,
  int? left,
  TGravity? gravity,
  TBlend? blend,
  bool? tile,
  String? listOfBboxes,
  String? listOfPolygons,
) {
  // Determine if there are values to add to the dictionary

  var values = <String, String>{};

  if (mode != null) {
    values['m'] = mode.value;
  }

  if (image != null) {
    values['i'] = image.toString();
  }

  if (transformation != null) {
    values['tr'] = transformation.toString();
  }

  if (background != null && background.isNotEmpty) {
    values['bg'] = background;
  }

  if (height != null) {
    values['h'] = height.toString();
  }

  if (width != null) {
    values['w'] = width.toString();
  }

  if (top != null) {
    values['t'] = top.toString();
  }

  if (left != null) {
    values['l'] = left.toString();
  }

  if (gravity != null) {
    values['g'] = gravity.value;
  }

  if (blend != null) {
    values['b'] = blend.value;
  }

  if (tile != null) {
    values['r'] = tile.toString();
  }

  if (listOfBboxes != null) {
    values['bboxes'] = listOfBboxes.toString();
  }

  if (listOfPolygons != null) {
    values['polys'] = listOfPolygons.toString();
  }

  return TransformationData(plugin: 't', name: 'merge', values: values);
}