pixelGetNextIteratorRow method

Future<List<PixelWand>> pixelGetNextIteratorRow()

Returns the next row as an array of pixel wands from the pixel iterator.

Don't forget to destroy each of the returned pixel wands using destroyPixelWand when you are done with them.

This method runs in a different isolate than the main isolate.

Implementation

Future<List<PixelWand>> pixelGetNextIteratorRow() async {
  List<int> pixelWandsAddresses = await _magickCompute(
    _pixelGetNextIteratorRow,
    _iteratorPtr.address,
  );
  List<PixelWand> pixelWands = [];
  for (int i = 0; i < pixelWandsAddresses.length; i++) {
    PixelWand? pixelWand = PixelWand._fromAddress(pixelWandsAddresses[i]);
    pixelWands.add(pixelWand!);
  }
  return pixelWands;
}