renderImage method

void renderImage(
  1. Image image,
  2. double left,
  3. double top,
  4. double right,
  5. double bottom,
  6. double scos,
  7. double ssin,
  8. double tx,
  9. double ty,
  10. [Color? color]
)

Implementation

void renderImage(Image image, double left, double top, double right, double bottom, double scos, double ssin, double tx, double ty, [Color? color]) {
  if (this.image != image || index >= maxBatchedObjects) {
    _flush(_canvas);
  }

  this.image = image;

  final int index0 = index * 4;
  final int index1 = index0 + 1;
  final int index2 = index0 + 2;
  final int index3 = index0 + 3;

  _rawTransforms[index0] = scos;
  _rawTransforms[index1] = ssin;
  _rawTransforms[index2] = tx;
  _rawTransforms[index3] = ty;

  _rawSources[index0] = left;
  _rawSources[index1] = top;
  _rawSources[index2] = right;
  _rawSources[index3] = bottom;

  _rawColors[index] = color?.value ?? Colors.white.value;

  index++;
}