// // jp2_decode.cpp // // Simple image decoder using IMJ2Dec. // // Copyright Morgan-Multimedia 1990-2005. // #include "iMJ2Dec.h" #include "OEM_LIC.h" int Decode(int nWidth, int nHeight, PBYTE pIn, int nIn, PBYTE pOut, int nOut, DWORD fccOut, int nOutBits) { // Create a decoder IMJ2Dec *pDec = new IMJ2Dec(FALSE, &OEM_LIC); if (!pDec) {return 0;} // Is license valid ? if (!pDec->IsLicenseValid()) { // No delete pDec; return 0; } // Decode int nSize = pDec->decode( NULL, 0, NULL, // jp2 = NULL, no codestream info returned pIn, nIn, nWidth, nHeight, 0, 0, // in_fcc, in_bits passed as unknown pOut, nOut, 0, 0, nWidth, nHeight, fccOut, nOutBits); // Delete decoder if (pDec) {delete pDec;} // Return the number of bytes red in the input codestream return nSize; }
|
© Morgan Multimedia 1990-2005 |