readSpectralDataPercents method

List<SpectralDataPercents> readSpectralDataPercents()

Implementation

List<SpectralDataPercents> readSpectralDataPercents() {
  return _usingOp<List<SpectralDataPercents>>((arena, opStatus) {
    final sizePointer = arena<Int>();
    _getSpectralDataArraySize(arena, opStatus, sizePointer);

    final nativeArray = arena.allocate<NativeSpectralDataPercents>(sizeOf<NativeSpectralDataPercents>() * sizePointer.value);
    bindings.MathLibReadSpectralDataPercentsArr(_pointer, nativeArray, sizePointer, opStatus);
    opStatus.ref.throwIfNotSuccessful();

    final results = <SpectralDataPercents>[];
    for (int i = 0; i < sizePointer.value; i++) {
      results.add(nativeArray[i].toManaged());
    }

    return results;
  });
}