本文整理汇总了C++中LibRaw::dcraw_thumb_writer方法的典型用法代码示例。如果您正苦于以下问题:C++ LibRaw::dcraw_thumb_writer方法的具体用法?C++ LibRaw::dcraw_thumb_writer怎么用?C++ LibRaw::dcraw_thumb_writer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LibRaw
的用法示例。
在下文中一共展示了LibRaw::dcraw_thumb_writer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: libraw_dcraw_thumb_writer
int libraw_dcraw_thumb_writer(libraw_data_t* lr,const char *fname)
{
if(!lr) return EINVAL;
LibRaw *ip = (LibRaw*) lr->parent_class;
return ip->dcraw_thumb_writer(fname);
}
示例2: main
int main(int ac, char *av[])
{
int i, ret, verbose=0, output_thumbs=0;
// don't use fixed size buffers in real apps!
char outfn[1024],thumbfn[1024];
LibRaw RawProcessor;
if(ac<2)
{
printf(
"simple_dcraw - LibRaw %s sample. Emulates dcraw [-D] [-T] [-v] [-e] [-E]\n"
" %d cameras supported\n"
"Usage: %s [-D] [-T] [-v] [-e] raw-files....\n"
"\t-D - document mode emulation\n"
"\t-4 - 16-bit mode\n"
"\t-v - verbose output\n"
"\t-T - output TIFF files instead of .pgm/ppm\n"
"\t-e - extract thumbnails (same as dcraw -e in separate run)\n",LibRaw::version(),
LibRaw::cameraCount(),
av[0]);
return 0;
}
putenv ((char*)"TZ=UTC"); // dcraw compatibility, affects TIFF datestamp field
#define P1 RawProcessor.imgdata.idata
#define S RawProcessor.imgdata.sizes
#define C RawProcessor.imgdata.color
#define T RawProcessor.imgdata.thumbnail
#define P2 RawProcessor.imgdata.other
#define OUT RawProcessor.imgdata.params
for (i=1;i<ac;i++)
{
if(av[i][0]=='-')
{
if(av[i][1]=='T' && av[i][2]==0)
OUT.output_tiff=1;
if(av[i][1]=='v' && av[i][2]==0)
verbose++;
if(av[i][1]=='e' && av[i][2]==0)
output_thumbs++;
if(av[i][1]=='D' && av[i][2]==0)
OUT.document_mode=2;
if(av[i][1]=='4' && av[i][2]==0)
OUT.output_bps=16;
if(av[i][1]=='C' && av[i][2]==0)
RawProcessor.set_progress_handler(my_progress_callback,NULL);
continue;
}
if(verbose) printf("Processing file %s\n",av[i]);
if( (ret = RawProcessor.open_file(av[i])) != LIBRAW_SUCCESS)
{
fprintf(stderr,"Cannot open_file %s: %s\n",av[i],libraw_strerror(ret));
continue; // no recycle b/c open file will recycle itself
}
if( (ret = RawProcessor.unpack() ) != LIBRAW_SUCCESS)
{
fprintf(stderr,"Cannot unpack %s: %s\n",av[i],libraw_strerror(ret));
continue;
}
// thumbnail unpacking and output in the middle of main
// image processing - for test purposes!
if(output_thumbs)
{
if( (ret = RawProcessor.unpack_thumb() ) != LIBRAW_SUCCESS)
{
fprintf(stderr,"Cannot unpack_thumb %s: %s\n",av[i],libraw_strerror(ret));
if(LIBRAW_FATAL_ERROR(ret))
continue; // skip to next file
}
else
{
snprintf(thumbfn,sizeof(thumbfn),"%s.%s",
av[i],T.tformat == LIBRAW_THUMBNAIL_JPEG ? "thumb.jpg" : "thumb.ppm");
if(verbose) printf("Writing thumbnail file %s\n",thumbfn);
if( LIBRAW_SUCCESS != (ret = RawProcessor.dcraw_thumb_writer(thumbfn)))
{
fprintf(stderr,"Cannot write %s: %s\n",thumbfn,libraw_strerror(ret));
if(LIBRAW_FATAL_ERROR(ret))
continue;
}
}
}
if(OUT.document_mode)
ret = RawProcessor.dcraw_document_mode_processing();
else
ret = RawProcessor.dcraw_process();
if(LIBRAW_SUCCESS !=ret)
{
fprintf(stderr,"Cannot do postpocessing on %s: %s\n",
//.........这里部分代码省略.........