imgSaveJpgRw function

int imgSaveJpgRw(
  1. Pointer<SdlSurface> surface,
  2. Pointer<SdlRWops> dst,
  3. int freedst,
  4. int quality,
)

Save an SDL_Surface into JPEG image data, via an SDL_RWops.

If you just want to save to a filename, you can use IMG_SaveJPG() instead.

\param surface the SDL surface to save \param dst the SDL_RWops to save the image data to. \returns 0 if successful, -1 on error.

\since This function is available since SDL_image 2.0.2.

\sa IMG_SaveJPG \sa IMG_SavePNG \sa IMG_SavePNG_RW

extern DECLSPEC int SDLCALL IMG_SaveJPG_RW(SDL_Surface *surface, SDL_RWops *dst, int freedst, int quality)

Implementation

int imgSaveJpgRw(Pointer<SdlSurface> surface, Pointer<SdlRWops> dst,
    int freedst, int quality) {
  final imgSaveJpgRwLookupFunction = libSdl2Image.lookupFunction<
      Int32 Function(Pointer<SdlSurface> surface, Pointer<SdlRWops> dst,
          Int32 freedst, Int32 quality),
      int Function(Pointer<SdlSurface> surface, Pointer<SdlRWops> dst,
          int freedst, int quality)>('IMG_SaveJPG_RW');
  return imgSaveJpgRwLookupFunction(surface, dst, freedst, quality);
}