#pragma once //Return Codes enum { CELL_PNGDEC_ERROR_HEADER = 0x80611201, CELL_PNGDEC_ERROR_STREAM_FORMAT = 0x80611202, CELL_PNGDEC_ERROR_ARG = 0x80611203, CELL_PNGDEC_ERROR_SEQ = 0x80611204, CELL_PNGDEC_ERROR_BUSY = 0x80611205, CELL_PNGDEC_ERROR_FATAL = 0x80611206, CELL_PNGDEC_ERROR_OPEN_FILE = 0x80611207, CELL_PNGDEC_ERROR_SPU_UNSUPPORT = 0x80611208, CELL_PNGDEC_ERROR_SPU_ERROR = 0x80611209, CELL_PNGDEC_ERROR_CB_PARAM = 0x8061120a, }; enum CellPngDecColorSpace { CELL_PNGDEC_GRAYSCALE = 1, CELL_PNGDEC_RGB = 2, CELL_PNGDEC_PALETTE = 4, CELL_PNGDEC_GRAYSCALE_ALPHA = 9, CELL_PNGDEC_RGBA = 10, CELL_PNGDEC_ARGB = 20, }; enum CellPngDecDecodeStatus { CELL_PNGDEC_DEC_STATUS_FINISH = 0, //Decoding finished CELL_PNGDEC_DEC_STATUS_STOP = 1, //Decoding halted }; enum CellPngDecStreamSrcSel { CELL_PNGDEC_FILE = 0, CELL_PNGDEC_BUFFER = 1, }; enum CellPngDecInterlaceMode { CELL_PNGDEC_NO_INTERLACE = 0, CELL_PNGDEC_ADAM7_INTERLACE = 1, }; enum CellPngDecOutputMode { CELL_PNGDEC_TOP_TO_BOTTOM = 0, CELL_PNGDEC_BOTTOM_TO_TOP = 1, }; // Structs struct CellPngDecDataOutInfo { be_t chunkInformation; be_t numText; be_t numUnknownChunk; be_t status; }; struct CellPngDecDataCtrlParam { be_t outputBytesPerLine; }; struct CellPngDecInfo { be_t imageWidth; be_t imageHeight; be_t numComponents; be_t colorSpace; // CellPngDecColorSpace be_t bitDepth; be_t interlaceMethod; // CellPngDecInterlaceMode be_t chunkInformation; }; struct CellPngDecSrc { be_t srcSelect; // CellPngDecStreamSrcSel be_t fileName_addr; // const char* be_t fileOffset; be_t fileSize; be_t streamPtr; be_t streamSize; be_t spuThreadEnable; // CellPngDecSpuThreadEna }; struct CellPngDecInParam { be_t commandPtr; be_t outputMode; // CellPngDecOutputMode be_t outputColorSpace; // CellPngDecColorSpace be_t outputBitDepth; be_t outputPackFlag; // CellPngDecPackFlag be_t outputAlphaSelect; // CellPngDecAlphaSelect be_t outputColorAlpha; }; struct CellPngDecOutParam { be_t outputWidthByte; be_t outputWidth; be_t outputHeight; be_t outputComponents; be_t outputBitDepth; be_t outputMode; // CellPngDecOutputMode be_t outputColorSpace; // CellPngDecColorSpace be_t useMemorySpace; }; struct CellPngDecStrmInfo { be_t decodedStrmSize; }; struct CellPngDecStrmParam { be_t strmPtr; be_t strmSize; }; struct CellPngDecCbCtrlStrm { mem_func_beptr_t strmInfo, mem_ptr_t strmParam, u32 cbCtrlStrmArg)> cbCtrlStrmFunc; be_t cbCtrlStrmArg; }; struct CellPngDecCbCtrlDisp { be_t cbCtrlDispFunc_addr; be_t cbCtrlDispArg; }; struct CellPngDecDispParam { be_t nextOutputImage_addr; }; struct CellPngDecExtInfo { be_t reserved; }; struct CellPngDecExtInParam { be_t bufferMode; // CellPngDecBufferMode be_t outputCounts; be_t spuMode; // CellPngDecSpuMode }; struct CellPngDecExtOutParam { be_t outputWidthByte; be_t outputHeight; }; struct CellPngDecOpnParam { be_t selectChunk; }; // Custom structs struct CellPngDecSubHandle { be_t fd; be_t fileSize; CellPngDecInfo info; CellPngDecOutParam outParam; CellPngDecSrc src; }; struct CellPngDecMainHandle { be_t mainHandle; be_t threadInParam; be_t threadOutParam; };