rlReadTexturePixels method

  1. @override
Uint8List rlReadTexturePixels(
  1. num id,
  2. num width,
  3. num height,
  4. PixelFormat format,
)
override

Implementation

@override
Uint8List rlReadTexturePixels(
  num id,
  num width,
  num height,
  PixelFormat format,
) => run(
  () => RaylibDebugLabels.rlReadTexturePixels(id, width, height, format),
  () {
    final size = rl.Utils.GetPixelDataSize(
      width.toInt(),
      height.toInt(),
      format,
    );
    final pixels = rl.Rlgl.rlReadTexturePixels(
      id.toInt(),
      width.toInt(),
      height.toInt(),
      format.value,
    );
    return pixels.cast<Uint8>().asTypedList(size);
  },
);