FreeImage で DCINEMA 用の j2c ファイルを作成してテストしたいのですが、結果のファイルは j2c と互換性がありません。
IfanView (イメージ ソフトウェア) は、「result.j2c」は拡張子が正しくない jp2 ファイルであると言い、result.j2c から result.jp2 に名前を変更します。
j2c ファイルの作成方法がわかりません。
私のコードは以下の通りです:
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 );
私は何をすべきか?