pub unsafe extern "C" fn tj3SaveImage8(
    handle: tjhandle,
    filename: *const c_char,
    buffer: *const c_uchar,
    width: c_int,
    pitch: c_int,
    height: c_int,
    pixelFormat: c_int
) -> c_int
Expand description

Save an 8-bit-per-sample packed-pixel image from memory to disk.

@param handle handle to a TurboJPEG instance

@param filename name of a file to which to save the packed-pixel image. The image will be stored in Windows BMP or PBMPLUS (PPM/PGM) format, depending on the file extension. Windows BMP files require 8-bit-per-sample data precision.

@param buffer pointer to a buffer containing a packed-pixel RGB, grayscale, or CMYK image to be saved

@param width width (in pixels) of the packed-pixel image

@param pitch samples per row in the packed-pixel image. Setting this parameter to 0 is the equivalent of setting it to width * #tjPixelSize[pixelFormat].

@param height height (in pixels) of the packed-pixel image

@param pixelFormat pixel format of the packed-pixel image (see @ref TJPF “Pixel formats”.) If this parameter is set to @ref TJPF_GRAY, then the image will be stored in PGM or 8-bit-per-pixel (indexed color) BMP format. Otherwise, the image will be stored in PPM or 24-bit-per-pixel BMP format. If this parameter is set to @ref TJPF_CMYK, then the CMYK pixels will be converted to RGB using a quick & dirty algorithm that is suitable only for testing purposes. (Proper conversion between CMYK and other formats requires a color management system.)

@return 0 if successful, or -1 if an error occurred (see #tj3GetErrorStr().)