sdlConvertPixels function

int sdlConvertPixels(
  1. int width,
  2. int height,
  3. int srcFormat,
  4. Pointer<NativeType> src,
  5. int srcPitch,
  6. int dstFormat,
  7. Pointer<NativeType> dst,
  8. int dstPitch,
)

Copy a block of pixels of one format to another format.

\param width the width of the block to copy, in pixels \param height the height of the block to copy, in pixels \param src_format an SDL_PixelFormatEnum value of the src pixels format \param src a pointer to the source pixels \param src_pitch the pitch of the source pixels, in bytes \param dst_format an SDL_PixelFormatEnum value of the dst pixels format \param dst a pointer to be filled in with new pixel data \param dst_pitch the pitch of the destination pixels, in bytes \returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.

\since This function is available since SDL 2.0.0.

extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height, Uint32 src_format, const void * src, int src_pitch, Uint32 dst_format, void * dst, int dst_pitch)

Implementation

int sdlConvertPixels(
    int width,
    int height,
    int srcFormat,
    Pointer<NativeType> src,
    int srcPitch,
    int dstFormat,
    Pointer<NativeType> dst,
    int dstPitch) {
  final sdlConvertPixelsLookupFunction = libSdl2.lookupFunction<
      Int32 Function(
          Int32 width,
          Int32 height,
          Uint32 srcFormat,
          Pointer<NativeType> src,
          Int32 srcPitch,
          Uint32 dstFormat,
          Pointer<NativeType> dst,
          Int32 dstPitch),
      int Function(
          int width,
          int height,
          int srcFormat,
          Pointer<NativeType> src,
          int srcPitch,
          int dstFormat,
          Pointer<NativeType> dst,
          int dstPitch)>('SDL_ConvertPixels');
  return sdlConvertPixelsLookupFunction(
      width, height, srcFormat, src, srcPitch, dstFormat, dst, dstPitch);
}