这篇教程C++ DGifCloseFile函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中DGifCloseFile函数的典型用法代码示例。如果您正苦于以下问题:C++ DGifCloseFile函数的具体用法?C++ DGifCloseFile怎么用?C++ DGifCloseFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了DGifCloseFile函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: T2APixRectArray::PixRectArray(const StringArray &fileNames, StringArray &errors) { USES_CONVERSION; m_updateCounter = 0; for(size_t i = 0; i < fileNames.size(); i++) { const String &name = fileNames[i]; try { if(FileNameSplitter(name).getExtension().equalsIgnoreCase(_T(".gif"))) { int error; const char *namea = T2A(name.cstr()); GifFileType *gifFile = DGifOpenFileName(namea, &error); if(gifFile == NULL) { throwException(_T("%s"), GifErrorString(error)); } if(DGifSlurp(gifFile) != GIF_OK) { const String msg = GifErrorString(gifFile->Error); DGifCloseFile(gifFile, &error); throwException(_T("%s"), msg.cstr()); } const int imageCount = gifFile->ImageCount; for(int k = 0; k < imageCount; k++) { add(new GifPixRect(gifFile, k)); } DGifCloseFile(gifFile, &error); } else { add(GifPixRect::load(name)); } } catch(Exception e) { errors.add(e.what()); } }}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:32,
示例2: DGifCloseFile/* * This function cleans up the gif object after the decode completes * It is used in a SkAutoTCallIProc template */void SkGifCodec::CloseGif(GifFileType* gif) {#if GIFLIB_MAJOR < 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR == 0) DGifCloseFile(gif);#else DGifCloseFile(gif, nullptr);#endif}
开发者ID:crabfang,项目名称:skia,代码行数:11,
示例3: definedint GIFAbstractDataset::myDGifCloseFile( GifFileType *hGifFile ){#if defined(GIFLIB_MAJOR) && ((GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1) || GIFLIB_MAJOR > 5) int nErrorCode; return DGifCloseFile( hGifFile, &nErrorCode );#else return DGifCloseFile( hGifFile );#endif}
开发者ID:hdfeos,项目名称:gdal,代码行数:9,
示例4: compress_custombool compress_custom(void* input_data, InputFunc input_func, void* output_data, OutputFunc output_func, int sample_size){ GifFileType* input_gif = NULL; GifFileType* output_gif = NULL; int result = GIF_ERROR; // Check sample if (sample_size <= 0) { return false; } input_gif = DGifOpen(input_data, input_func, &error_code); if (input_gif == NULL) { LOGE(EMSG("Can't open input gif")); return false; } DGifSlurp(input_gif); if (input_gif->ImageCount == 0) { LOGE(EMSG("Gif frame count is 0")); DGifCloseFile(input_gif, &error_code); return false; } // Save gif output_gif = EGifOpen(output_data, output_func, &error_code); if (output_gif == NULL) { LOGE(EMSG("Can't open output gif")); DGifCloseFile(input_gif, &error_code); return false; } if (do_compress(input_gif, output_gif, sample_size)) { result = EGifSpew(output_gif); } // Free GifFreeExtensions(&output_gif->ExtensionBlockCount, &output_gif->ExtensionBlocks); if (output_gif->SavedImages) { GifFreeSavedImages(output_gif); output_gif->SavedImages = NULL; } // Close gif DGifCloseFile(input_gif, &error_code); return result == GIF_OK;}
开发者ID:younghang,项目名称:Nimingban,代码行数:50,
示例5: dGifCloseFilevalue dGifCloseFile( value hdl ){ CAMLparam1(hdl); /* For the bug libungif/giflib 4.1.0 */ /* This may add a new memory leak, but it is better than having segmentation faults */ ((GifFileType *)hdl)->Image.ColorMap = NULL; #if (GIFLIB_MAJOR <= 4) DGifCloseFile( (GifFileType *) hdl);#else DGifCloseFile( (GifFileType *) hdl, NULL );#endif CAMLreturn0;}
开发者ID:philipdexter,项目名称:camlimages,代码行数:16,
示例6: readGifFileImage*readGifFile ( int infile ){ Image *img = 0;#if defined(INCLUDE_GIF) /* * we don't use DGifOpenFile because file io might be intercepted * (because of threading) */ FileSource fileSrc; GifFileType *gf; fileSrc.fd = infile; if ( !(gf = DGifOpen( &fileSrc, readGifFileSource)) ) return 0; img = readGif( gf); DGifCloseFile( gf);#endif return img;}
开发者ID:jameshilliard,项目名称:actiontec_opensrc_mi424wr-rev-e-f_fw-20-10-7-5,代码行数:26,
示例7: QuitGifError/******************************************************************************* Close both input and output file (if open), and exit. *******************************************************************************/static void QuitGifError(GifFileType *GifFileIn, GifFileType *GifFileOut){ PrintGifError(); if (GifFileIn != NULL) DGifCloseFile(GifFileIn); if (GifFileOut != NULL) EGifCloseFile(GifFileOut); exit(EXIT_FAILURE);}
开发者ID:BOTCrusher,项目名称:sagetv,代码行数:10,
示例8: cleanUpstatic void cleanUp(GifInfo* info) { free(info->backupPtr); info->backupPtr = NULL; free(info->infos); info->infos = NULL; free(info->rasterBits); info->rasterBits = NULL; free(info->comment); info->comment = NULL; GifFileType* GifFile = info->gifFilePtr; if (GifFile->SavedImages != NULL) { SavedImage *sp; for (sp = GifFile->SavedImages; sp < GifFile->SavedImages + GifFile->ImageCount; sp++) { if (sp->ImageDesc.ColorMap != NULL) { GifFreeMapObject(sp->ImageDesc.ColorMap); sp->ImageDesc.ColorMap = NULL; } } free(GifFile->SavedImages); GifFile->SavedImages = NULL; } DGifCloseFile(GifFile); free(info);}
开发者ID:kyze8439690,项目名称:Qingbo,代码行数:26,
示例9: mainint main(int argc, char **argv) { argv++; if(!*argv) usage(); int errorCode; GifFileType *gifFile = DGifOpenFileName(*argv, &errorCode); if(gifFile == NULL) { printf("Error:%s/n", GifErrorString(errorCode)); exit(-1); } CHECKGIFOK(DGifSlurp(gifFile)); _tprintf(_T("GifFile:Size:(%d,%d)/n"), gifFile->SWidth, gifFile->SHeight); _tprintf(_T("GifFile:BackgroundColor:%d, AspectByte:%d, ColorResultion:%d/n"), gifFile->SBackGroundColor, gifFile->AspectByte, gifFile->SColorResolution); _tprintf(_T("GifFile ")); dumpImageDesc(gifFile->Image); _tprintf(_T("GifFile:")); dumpColorMap(gifFile->SColorMap); _tprintf(_T("GifFile.ExtentionBlocks:/n")); dumpExtensionBlocks(gifFile->ExtensionBlocks, gifFile->ExtensionBlockCount); for(int i = 0; i < gifFile->ImageCount; i++) { dumpSavedImage(i, gifFile->SavedImages[i]); } if(DGifCloseFile(gifFile, &errorCode) != GIF_OK) { CHECKGIFOK(errorCode); } return 0;}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:29,
示例10: DGifOpenvoid AnimatedImage::load(CWnd *parent, ByteInputStream &in) { int error; GifFileType *gifFile = DGifOpen(&in, readGifStreamFunction, &error); if(gifFile == NULL) { THROWGIFERROR(error); } try { if(DGifSlurp(gifFile) != GIF_OK) { THROWGIFERROR(gifFile->Error); } createFromGifFile(parent, gifFile); DGifCloseFile(gifFile, &error); } catch(...) { DGifCloseFile(gifFile, &error); throw; }}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:17,
示例11: DGifCloseFileMCGIFImageLoader::~MCGIFImageLoader(){ if (m_gif != nil) { int t_error_code; DGifCloseFile(m_gif, &t_error_code); m_gif = nil; }}
开发者ID:soapdog,项目名称:livecode,代码行数:9,
示例12: QuitGifError/******************************************************************************* Close both input and output file (if open), and exit. *******************************************************************************/static int QuitGifError(GifFileType *GifFileIn, GifFileType *GifFileOut){ int ErrorCode;// PrintGifError(ErrorCode); if (GifFileIn != NULL) DGifCloseFile(GifFileIn, &ErrorCode); if (GifFileOut != NULL) EGifCloseFile(GifFileOut, &ErrorCode); //exit(1); return -1;}
开发者ID:tok101,项目名称:tok101,代码行数:12,
示例13: DGifCloseMemstatic int DGifCloseMem(GifFileType *gifFile){ if (gifFile->UserData != NULL) { GifMemoryType *gifMemoryType = (GifMemoryType *) gifFile->UserData; gif_free(gifMemoryType); } return DGifCloseFile(gifFile);}
开发者ID:Gamer125,项目名称:wiibrowser,代码行数:9,
示例14: decode_gif_pixelsstatic int decode_gif_pixels(struct gps_map *map, unsigned char *out, int x, int y, int width, int height, int bpp, int row_stride){ struct raster_map *raster_map = map->data; GifFileType *gf; GifRecordType record_type; int r; if (bpp != 24) return -1; gf = DGifOpenFileName(raster_map->bitmap_filename); if (gf == NULL) { gps_error("%s: %s", raster_map->bitmap_filename, strerror(errno)); return -1; } r = -1; do { if (DGifGetRecordType(gf, &record_type) == GIF_ERROR) { PrintGifError(); goto fail; } switch (record_type) { case IMAGE_DESC_RECORD_TYPE: if (DGifGetImageDesc(gf) == GIF_ERROR) { PrintGifError(); goto fail; } if (gf->Image.Width != map->width || gf->Image.Height != map->height) { gps_error("%s: GIF subimages not supported", raster_map->bitmap_filename); goto fail; } if (gf->Image.Interlace) { gps_error("%s: interlaced GIFs not supported", raster_map->bitmap_filename); goto fail; } output_gif_pixels(map, gf, x, y, width, height, row_stride, out); break; case EXTENSION_RECORD_TYPE: gps_error("%s: GIF extensions not supported", raster_map->bitmap_filename); goto fail; case UNDEFINED_RECORD_TYPE: case SCREEN_DESC_RECORD_TYPE: case TERMINATE_RECORD_TYPE: break; } } while (record_type != IMAGE_DESC_RECORD_TYPE); r = 0;fail: DGifCloseFile(gf); return r;}
开发者ID:vtervo,项目名称:gropes,代码行数:56,
示例15: DGifCloseFileGifFilesCloser::~GifFilesCloser() { if (mGifIn) { DGifCloseFile(mGifIn); mGifIn = NULL; } if (mGifOut) { EGifCloseFile(mGifOut); mGifOut = NULL; }}
开发者ID:b-project,项目名称:Messaging,代码行数:10,
示例16: FlushCacheBIGGIFDataset::~BIGGIFDataset(){ FlushCache(); if( hGifFile ) DGifCloseFile( hGifFile ); if( fp != NULL ) VSIFCloseL( fp ); CloseDependentDatasets();}
开发者ID:dlsyaim,项目名称:osgEarthX,代码行数:11,
示例17: cleanUpvoid cleanUp(GifInfo *info) { free(info->backupPtr); info->backupPtr = NULL; free(info->controlBlock); info->controlBlock = NULL; free(info->rasterBits); info->rasterBits = NULL; free(info->comment); info->comment = NULL; DGifCloseFile(info->gifFilePtr); free(info);}
开发者ID:BridgePasserby,项目名称:android-gif-drawable,代码行数:13,
示例18: mainint main(int argc, char **argv){ int i, ErrorCode; GifFileType *GifFileIn, *GifFileOut = (GifFileType *)NULL; if ((GifFileIn = DGifOpenFileHandle(0, &ErrorCode)) == NULL) { PrintGifError(ErrorCode); exit(EXIT_FAILURE); } if (DGifSlurp(GifFileIn) == GIF_ERROR) { PrintGifError(GifFileIn->Error); exit(EXIT_FAILURE); } if ((GifFileOut = EGifOpenFileHandle(1, &ErrorCode)) == NULL) { PrintGifError(ErrorCode); exit(EXIT_FAILURE); } /* * Your operations on in-core structures go here. * This code just copies the header and each image from the incoming file. */ GifFileOut->SWidth = GifFileIn->SWidth; GifFileOut->SHeight = GifFileIn->SHeight; GifFileOut->SColorResolution = GifFileIn->SColorResolution; GifFileOut->SBackGroundColor = GifFileIn->SBackGroundColor; GifFileOut->SColorMap = GifMakeMapObject( GifFileIn->SColorMap->ColorCount, GifFileIn->SColorMap->Colors); for (i = 0; i < GifFileIn->ImageCount; i++) (void) GifMakeSavedImage(GifFileOut, &GifFileIn->SavedImages[i]); /* * Note: don't do DGifCloseFile early, as this will * deallocate all the memory containing the GIF data! * * Further note: EGifSpew() doesn't try to validity-check any of this * data; it's *your* responsibility to keep your changes consistent. * Caveat hacker! */ if (EGifSpew(GifFileOut) == GIF_ERROR) PrintGifError(GifFileOut->Error); if (DGifCloseFile(GifFileIn, &ErrorCode) == GIF_ERROR) PrintGifError(ErrorCode); if (EGifCloseFile(GifFileOut, &ErrorCode) == GIF_ERROR) PrintGifError(ErrorCode); return 0;}
开发者ID:Distrotech,项目名称:giflib,代码行数:51,
示例19: fh_gif_getsizeint fh_gif_getsize(const char *name,int *x,int *y, int wanted_width, int wanted_height){ int err = 0; int px,py; GifFileType *gft; GifByteType *extension; int extcode; GifRecordType rt; gft=DGifOpenFileName(name, &err); if(gft==NULL) gflush; do { if(DGifGetRecordType(gft,&rt) == GIF_ERROR) grflush; switch(rt) { case IMAGE_DESC_RECORD_TYPE: if(DGifGetImageDesc(gft)==GIF_ERROR) grflush; px=gft->Image.Width; py=gft->Image.Height; *x=px; *y=py; DGifCloseFile(gft, &err); return(FH_ERROR_OK); break; case EXTENSION_RECORD_TYPE: if(DGifGetExtension(gft,&extcode,&extension)==GIF_ERROR) grflush; while(extension!=NULL) if(DGifGetExtensionNext(gft,&extension)==GIF_ERROR) grflush; break; default: break; } } while( rt!= TERMINATE_RECORD_TYPE ); DGifCloseFile(gft, &err); return(FH_ERROR_FORMAT);}
开发者ID:UkCvs,项目名称:commando,代码行数:38,
示例20: DGifOpenSkGIFMovie::SkGIFMovie(SkStream* stream){ fGIF = DGifOpen( stream, Decode ); if (NULL == fGIF) return; if (DGifSlurp(fGIF) != GIF_OK) { DGifCloseFile(fGIF); fGIF = NULL; } fCurrIndex = -1; fLastDrawIndex = -1;}
开发者ID:0omega,项目名称:platform_external_skia,代码行数:14,
示例21: gif_donestatic voidgif_done(void *data){ struct gif_state *h = (struct gif_state *) data; if (FbiStuff::fim_filereading_debug()) FIM_FBI_PRINTF("gif: done, cleaning up/n"); DGifCloseFile(h->gif); fclose(h->infile); if (h->il) fim_free(h->il); fim_free(h->row); fim_free(h);}
开发者ID:phantasea,项目名称:fim,代码行数:14,
示例22: read_gif_headerstatic int read_gif_header(struct gps_map *map){ GifFileType *gif_file; struct raster_map *raster_map = map->data; gif_file = DGifOpenFileName(raster_map->bitmap_filename); if (gif_file == NULL) { gps_error("%s: %s", raster_map->bitmap_filename, strerror(errno)); return -1; } map->width = gif_file->SWidth; map->height = gif_file->SHeight; DGifCloseFile(gif_file); return 0;}
开发者ID:vtervo,项目名称:gropes,代码行数:15,
示例23: cleanUpvoid cleanUp(GifInfo *info) { info->surfaceDescriptor = NULL; free(info->backupPtr); info->backupPtr = NULL; free(info->controlBlock); info->controlBlock = NULL; free(info->rasterBits); info->rasterBits = NULL; free(info->comment); info->comment = NULL; GifFileType *GifFile = info->gifFilePtr; DGifCloseFile(GifFile); free(info);}
开发者ID:bearprada,项目名称:android-gif-drawable,代码行数:15,
示例24: DGifOpenstatic GifFileType *loadGif(ByteInputStream &in) { int error; GifFileType *gf = DGifOpen(&in, readGifStreamFunction, &error); if(gf == NULL) { THROWGIFERROR(error); } try { if(DGifSlurp(gf) != GIF_OK) { THROWGIFERROR(gf->Error); } return gf; } catch(...) { DGifCloseFile(gf, &error); throw; }}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:16,
示例25: DGifOpenSkGIFMovie::SkGIFMovie(SkStream* stream){#if GIFLIB_MAJOR < 5 fGIF = DGifOpen( stream, Decode );#else fGIF = DGifOpen( stream, Decode, NULL );#endif if (NULL == fGIF) return; if (DGifSlurp(fGIF) != GIF_OK) { DGifCloseFile(fGIF); fGIF = NULL; } fCurrIndex = -1; fLastDrawIndex = -1;}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:18,
示例26: load_imageimage* load_image (char* file, image_format fmt) { image* img = NULL; if (fmt == imgIRMID) { FILE* fp; fp = fopen (file, "r"); image simage; fread (&simage, sizeof(image), 1, fp); img = (image*) malloc (simage.size); fseek (fp, 0, SEEK_SET); fread (img, simage.size, 1, fp); fclose (fp); } else if (fmt == imgGIF) { GifFileType* GifFileIn = DGifOpenFileName (file); int size = GifFileIn->SWidth * GifFileIn->SHeight * sizeof (rtbyte) + sizeof (image) - sizeof (rtbyte); img = (image*) malloc (size); img->size = size; img->dimx = GifFileIn->SWidth; img->dimy = GifFileIn->SHeight; img->dimc = 1; img->dimz = 1; img->dimt = 1; img->xyz = img->xy = img->dimx * img->dimy; img->len = img->xy * sizeof (rdword); img->clr = clrmGrey; GifRecordType record; GifRowType pixels = (GifRowType) new GifPixelType[img->xy]; do { DGifGetRecordType(GifFileIn, &record); if (record != IMAGE_DESC_RECORD_TYPE) continue; DGifGetImageDesc (GifFileIn); for (int row = 0; row < img->dimy; ++row) DGifGetLine (GifFileIn, pixels + row * img->dimx, img->dimx); } while (record != TERMINATE_RECORD_TYPE); for (uint n = 0; n < img->xy; ++n) data(img)[n] = (rtbyte)pixels[n]; DGifCloseFile (GifFileIn); } return (img);}
开发者ID:macx0r,项目名称:ipas,代码行数:43,
示例27: FlushCacheBIGGIFDataset::~BIGGIFDataset(){ FlushCache(); if( hGifFile ) DGifCloseFile( hGifFile ); if( fp != NULL ) VSIFCloseL( fp ); if( poWorkDS != NULL ) { CPLString osTempFilename = poWorkDS->GetDescription(); GDALClose( (GDALDatasetH) poWorkDS ); poWorkDS = NULL; GDALDriver *poGTiff = (GDALDriver *) GDALGetDriverByName( "GTiff" ); poGTiff->Delete( osTempFilename ); }}
开发者ID:469447793,项目名称:World-Wind-Java,代码行数:20,
注:本文中的DGifCloseFile函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ DGifGetCodeNext函数代码示例 C++ DFS函数代码示例 |