本文整理汇总了C++中CxImageRAW类的典型用法代码示例。如果您正苦于以下问题:C++ CxImageRAW类的具体用法?C++ CxImageRAW怎么用?C++ CxImageRAW使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CxImageRAW类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetExifThumbnail
bool CxImage::GetExifThumbnail(const char *filename, const char *outname, int type)
{
if (type == CXIMAGE_FORMAT_RAW)
{
CxImageRAW image;
return image.GetExifThumbnail(filename, outname, type);
}
else
{
CxImageJPG image;
return image.GetExifThumbnail(filename, outname, type);
}
}
示例2: switch
bool CxImage::GetExifThumbnail(const TCHAR *filename, const TCHAR *outname, int32_t type)
{
switch (type){
#if CXIMAGE_SUPPORT_RAW
case CXIMAGE_FORMAT_RAW:
{
CxImageRAW image;
return image.GetExifThumbnail(filename, outname, type);
}
#endif //CXIMAGE_SUPPORT_RAW
#if CXIMAGE_SUPPORT_JPG
case CXIMAGE_FORMAT_JPG:
{
CxImageJPG image;
return image.GetExifThumbnail(filename, outname, type);
}
#endif //CXIMAGE_SUPPORT_JPG
default:
return false;
}
}
示例3: strcpy
//.........这里部分代码省略.........
return false;
}
}
#endif
#if CXIMAGE_SUPPORT_JASPER
if (CXIMAGE_FORMAT_UNKNOWN==imagetype ||
#if CXIMAGE_SUPPORT_JP2
CXIMAGE_FORMAT_JP2==imagetype ||
#endif
#if CXIMAGE_SUPPORT_JPC
CXIMAGE_FORMAT_JPC==imagetype ||
#endif
#if CXIMAGE_SUPPORT_PGX
CXIMAGE_FORMAT_PGX==imagetype ||
#endif
#if CXIMAGE_SUPPORT_PNM
CXIMAGE_FORMAT_PNM==imagetype ||
#endif
#if CXIMAGE_SUPPORT_RAS
CXIMAGE_FORMAT_RAS==imagetype ||
#endif
false ){
CxImageJAS *newima = new CxImageJAS;
if (!newima)
return false;
newima->CopyInfo(*this);
if (newima->Decode(hFile)) {
Transfer(*newima);
delete newima;
return true;
} else {
strcpy(info.szLastError,newima->GetLastError());
hFile->Seek(pos,SEEK_SET);
delete newima;
if (CXIMAGE_FORMAT_UNKNOWN!=imagetype)
return false;
}
}
#endif
#if CXIMAGE_SUPPORT_SKA
if (CXIMAGE_FORMAT_UNKNOWN==imagetype || CXIMAGE_FORMAT_SKA==imagetype){
CxImageSKA *newima = new CxImageSKA;
if (!newima)
return false;
newima->CopyInfo(*this);
if (newima->Decode(hFile)) {
Transfer(*newima);
delete newima;
return true;
} else {
strcpy(info.szLastError,newima->GetLastError());
hFile->Seek(pos,SEEK_SET);
delete newima;
if (CXIMAGE_FORMAT_UNKNOWN!=imagetype)
return false;
}
}
#endif
#if CXIMAGE_SUPPORT_RAW
if (CXIMAGE_FORMAT_UNKNOWN==imagetype || CXIMAGE_FORMAT_RAW==imagetype){
CxImageRAW *newima = new CxImageRAW;
if (!newima)
return false;
newima->CopyInfo(*this);
if (newima->Decode(hFile)) {
Transfer(*newima);
delete newima;
return true;
} else {
strcpy(info.szLastError,newima->GetLastError());
hFile->Seek(pos,SEEK_SET);
delete newima;
if (CXIMAGE_FORMAT_UNKNOWN!=imagetype)
return false;
}
}
#endif
#if CXIMAGE_SUPPORT_PSD
if (CXIMAGE_FORMAT_UNKNOWN==imagetype || CXIMAGE_FORMAT_PSD==imagetype){
CxImagePSD *newima = new CxImagePSD;
if (!newima)
return false;
newima->CopyInfo(*this);
if (newima->Decode(hFile)) {
Transfer(*newima);
delete newima;
return true;
} else {
strcpy(info.szLastError,newima->GetLastError());
hFile->Seek(pos,SEEK_SET);
delete newima;
if (CXIMAGE_FORMAT_UNKNOWN!=imagetype)
return false;
}
}
#endif
strcpy(info.szLastError,"Decode: Unknown or wrong format");
return false;
}
示例4: strcpy
bool CxImage::Decode(CxFile *hFile, DWORD imagetype)
#endif
{
if (hFile == NULL){
strcpy(info.szLastError,CXIMAGE_ERR_NOFILE);
return false;
}
if (imagetype==CXIMAGE_FORMAT_UNKNOWN){
DWORD pos = hFile->Tell();
#if CXIMAGE_SUPPORT_JPG
#ifdef XBMC
{ CxImageJPG newima; try { newima.CopyInfo(*this); if (newima.Decode(hFile, iWidth, iHeight)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); } catch (...) { hFile->Seek(pos,SEEK_SET); } }
#else
{ CxImageJPG newima; try { newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); } catch (...) { hFile->Seek(pos,SEEK_SET); } }
#endif
#endif
#if CXIMAGE_SUPPORT_PNG
{ CxImagePNG newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_GIF
{ CxImageGIF newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_BMP
{ CxImageBMP newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_ICO
{ CxImageICO newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_TIF
{ CxImageTIF newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_MNG
{ CxImageMNG newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_TGA
{ CxImageTGA newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_PCX
{ CxImagePCX newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_WBMP
{ CxImageWBMP newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_WMF && CXIMAGE_SUPPORT_WINDOWS
{ CxImageWMF newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_JBG
{ CxImageJBG newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_JASPER
{ CxImageJAS newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_SKA
{ CxImageSKA newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_RAW
{ CxImageRAW newima;
newima.CopyInfo(*this);
// libDCR performs a high volume of seeks/reads which XBMC's
// VFS cannot sustain efficiently, therefore read the file into
// memory and send it to the decoder.
long buffer_size = hFile->Size();
if (buffer_size < 0)
return false;
unsigned char* buffer = (unsigned char*)malloc( buffer_size );
// if we were able to allocate the buffer, transfer to a CxMemFile
if ( buffer )
{
hFile->Read( buffer, buffer_size, 1 );
CxMemFile hMemFile( buffer, buffer_size );
if (newima.Decode( &hMemFile ))
{
Transfer(newima);
return true;
}
else
hFile->Seek(pos, SEEK_SET);
}
else
{
// fallback to default method
if (newima.Decode(hFile))
{
Transfer(newima);
return true;
}
else
hFile->Seek(pos,SEEK_SET);
}
}
#endif
}
#if CXIMAGE_SUPPORT_BMP
if (imagetype==CXIMAGE_FORMAT_BMP){
CxImageBMP newima;
//.........这里部分代码省略.........
示例5: strcpy
/**
* Loads an image from CxFile object
* \param hFile: file handle (CxMemFile or CxIOFile), with read access.
* \param imagetype: file format, see ENUM_CXIMAGE_FORMATS
* \return true if everything is ok
* \sa ENUM_CXIMAGE_FORMATS
*/
bool CxImage::Decode(CxFile *hFile, DWORD imagetype)
{
if (hFile == NULL){
strcpy(info.szLastError,CXIMAGE_ERR_NOFILE);
return false;
}
if (imagetype==CXIMAGE_FORMAT_UNKNOWN){
DWORD pos = hFile->Tell();
#if CXIMAGE_SUPPORT_BMP
{ CxImageBMP newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_PNG
{ CxImagePNG newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_JPG
{ CxImageJPG newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_MNG
{ CxImageMNG newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_TGA
{ CxImageTGA newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_ICO
{ CxImageICO newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_GIF
{ CxImageGIF newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_TIF
{ CxImageTIF newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_PCX
{ CxImagePCX newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_WBMP
{ CxImageWBMP newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_WMF && CXIMAGE_SUPPORT_WINDOWS
{ CxImageWMF newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_JBG
{ CxImageJBG newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_JASPER
{ CxImageJAS newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_SKA
{ CxImageSKA newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
#if CXIMAGE_SUPPORT_RAW
{ CxImageRAW newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); }
#endif
}
#if CXIMAGE_SUPPORT_BMP
if (imagetype==CXIMAGE_FORMAT_BMP){
CxImageBMP newima;
newima.CopyInfo(*this);
if (newima.Decode(hFile)){
Transfer(newima);
return true;
} else {
strcpy(info.szLastError,newima.GetLastError());
return false;
}
}
#endif
#if CXIMAGE_SUPPORT_PNG
if (imagetype==CXIMAGE_FORMAT_PNG){
CxImagePNG newima;
newima.CopyInfo(*this);
if (newima.Decode(hFile)){
Transfer(newima);
return true;
} else {
strcpy(info.szLastError,newima.GetLastError());
return false;
}
}
#endif
#if CXIMAGE_SUPPORT_JPG
if (imagetype==CXIMAGE_FORMAT_JPG){
CxImageJPG newima;
newima.CopyInfo(*this); // <ignacio>
if (newima.Decode(hFile)){
Transfer(newima);
return true;
} else {
strcpy(info.szLastError,newima.GetLastError());
return false;
}
//.........这里部分代码省略.........