With FreeImage I want to create a j2c file for DCINEMA and test it, however, the result file is not compatible with j2c.
IfanView (image software) says "result.j2c" is a jp2 file with an incorrect extension and renames it from result.j2c to result.jp2.
I don't understand how to create a j2c file.
My code is below:
RGBQUAD color;
GetDims( hOutputImage, &iWidth, &iHeight );
UCHAR* pSrc = ( UCHAR* )(Image->GetRaw( hOutputImage) );
FIBITMAP* bitmap = FreeImage_Allocate(iWidth, iHeight, 24);
for ( int i = 0; i < iHeight; i++) {
for( int j = 0 ; j < iWidth; j++) {
color.rgbRed = *( pSrc + 0 );
color.rgbGreen = *( pSrc + 1 );
color.rgbBlue = *( pSrc + 2 );
FreeImage_SetPixelColor(bitmap, j, i , &color);
pSrc += 4;
}
}
static int index = 0;
CString fileName;
fileName.Format("c:\\%06d.j2c", index++);
const char *ss = (LPSTR)(LPCTSTR) fileName;
FreeImage_Save(FIF_J2K, bitmap, ss, J2K_DEFAULT );
What should I do?