magickGetImageHistogram method

Future<List<PixelWand>?> magickGetImageHistogram()

MagickGetImageHistogram() returns the image histogram as an array of PixelWand wands.

Don't forget to call destroyPixelWand on the returned PixelWands when done.

This method runs inside an isolate different from the main isolate.

Implementation

Future<List<PixelWand>?> magickGetImageHistogram() async {
  List<int> pixelWandsPtrsAddresses = await _magickCompute(
    _magickGetImageHistogram,
    _wandPtr.address,
  );
  if (pixelWandsPtrsAddresses.isEmpty) {
    return null;
  }
  return pixelWandsPtrsAddresses
      .map((address) =>
          PixelWand._(Pointer<mwbg.PixelWand>.fromAddress(address)))
      .toList();
}