#pragma once #include "Utilities/BEType.h" //Return Codes enum { CELL_JPGDEC_ERROR_HEADER = 0x80611101, CELL_JPGDEC_ERROR_STREAM_FORMAT = 0x80611102, CELL_JPGDEC_ERROR_ARG = 0x80611103, CELL_JPGDEC_ERROR_SEQ = 0x80611104, CELL_JPGDEC_ERROR_BUSY = 0x80611105, CELL_JPGDEC_ERROR_FATAL = 0x80611106, CELL_JPGDEC_ERROR_OPEN_FILE = 0x80611107, CELL_JPGDEC_ERROR_SPU_UNSUPPORT = 0x80611108, CELL_JPGDEC_ERROR_CB_PARAM = 0x80611109, }; enum CellJpgDecColorSpace { CELL_JPG_UNKNOWN = 0, CELL_JPG_GRAYSCALE = 1, CELL_JPG_RGB = 2, CELL_JPG_YCbCr = 3, CELL_JPG_RGBA = 10, CELL_JPG_UPSAMPLE_ONLY = 11, CELL_JPG_ARGB = 20, CELL_JPG_GRAYSCALE_TO_ALPHA_RGBA = 40, CELL_JPG_GRAYSCALE_TO_ALPHA_ARGB = 41, }; enum CellJpgDecStreamSrcSel { CELL_JPGDEC_FILE = 0, CELL_JPGDEC_BUFFER = 1, }; enum CellJpgDecDecodeStatus { CELL_JPGDEC_DEC_STATUS_FINISH = 0, // Decoding finished CELL_JPGDEC_DEC_STATUS_STOP = 1, // Decoding halted }; enum CellJpgDecOutputMode { CELL_JPGDEC_TOP_TO_BOTTOM = 0, // Top left to bottom right CELL_JPGDEC_BOTTOM_TO_TOP = 1, // Bottom left to top right }; struct CellJpgDecInfo { be_t imageWidth; be_t imageHeight; be_t numComponents; be_t colorSpace; // CellJpgDecColorSpace }; struct CellJpgDecSrc { be_t srcSelect; // CellJpgDecStreamSrcSel vm::bcptr fileName; be_t fileOffset; // int64_t be_t fileSize; be_t streamPtr; be_t streamSize; be_t spuThreadEnable; // CellJpgDecSpuThreadEna }; struct CellJpgDecInParam { be_t commandPtr; be_t downScale; be_t method; // CellJpgDecMethod be_t outputMode; // CellJpgDecOutputMode be_t outputColorSpace; // CellJpgDecColorSpace u8 outputColorAlpha; u8 reserved[3]; }; struct CellJpgDecOutParam { be_t outputWidthByte; be_t outputWidth; be_t outputHeight; be_t outputComponents; be_t outputMode; // CellJpgDecOutputMode be_t outputColorSpace; // CellJpgDecColorSpace be_t downScale; be_t useMemorySpace; }; struct CellJpgDecOpnInfo { be_t initSpaceAllocated; }; struct CellJpgDecDataCtrlParam { be_t outputBytesPerLine; }; struct CellJpgDecDataOutInfo { be_t mean; be_t outputLines; be_t status; }; // Custom structs struct CellJpgDecSubHandle { static const u32 id_base = 1; static const u32 id_step = 1; static const u32 id_count = 1023; u32 fd; u64 fileSize; CellJpgDecInfo info; CellJpgDecOutParam outParam; CellJpgDecSrc src; };