• Home
  • Raw
  • Download

Lines Matching refs:gifIn

81     GifFileType* gifIn;  in transcode()  local
87 gifIn = DGifOpenFileName(pathIn, &error); in transcode()
88 if (gifIn) { in transcode()
89 closer.setGifIn(gifIn); in transcode()
106 if (resizeBoxFilter(gifIn, gifOut)) { in transcode()
116 bool GifTranscoder::resizeBoxFilter(GifFileType* gifIn, GifFileType* gifOut) { in resizeBoxFilter() argument
117 ASSERT(gifIn != NULL, "gifIn cannot be NULL"); in resizeBoxFilter()
120 if (gifIn->SWidth < 0 || gifIn->SHeight < 0) { in resizeBoxFilter()
121 LOGE("Input GIF has invalid size: %d x %d", gifIn->SWidth, gifIn->SHeight); in resizeBoxFilter()
127 gifIn->SWidth / 2, in resizeBoxFilter()
128 gifIn->SHeight / 2, in resizeBoxFilter()
129 gifIn->SColorResolution, in resizeBoxFilter()
130 gifIn->SBackGroundColor, in resizeBoxFilter()
131 gifIn->SColorMap) == GIF_ERROR) { in resizeBoxFilter()
144 std::vector<GifByteType> srcBuffer(gifIn->SWidth * gifIn->SHeight); in resizeBoxFilter()
147 std::unique_ptr<ColorARGB[]> renderBuffer(new ColorARGB[gifIn->SWidth * gifIn->SHeight]); in resizeBoxFilter()
164 if (DGifGetRecordType(gifIn, &recordType) == GIF_ERROR) { in resizeBoxFilter()
171 if (DGifGetImageDesc(gifIn) == GIF_ERROR) { in resizeBoxFilter()
177 if (gifIn->Image.Left < 0 || in resizeBoxFilter()
178 gifIn->Image.Top < 0 || in resizeBoxFilter()
179 gifIn->Image.Left + gifIn->Image.Width > gifIn->SWidth || in resizeBoxFilter()
180 gifIn->Image.Top + gifIn->Image.Height > gifIn->SHeight) { in resizeBoxFilter()
192 gifIn->Image.ColorMap) == GIF_ERROR) { in resizeBoxFilter()
200 srcBuffer.resize(gifIn->Image.Width * gifIn->Image.Height); in resizeBoxFilter()
201 if (readImage(gifIn, srcBuffer.data()) == false) { in resizeBoxFilter()
207 if (renderImage(gifIn, in resizeBoxFilter()
224 gifIn, transparentColor, renderBuffer.get(), x, y); in resizeBoxFilter()
243 prevImageDimens.Left = gifIn->Image.Left; in resizeBoxFilter()
244 prevImageDimens.Top = gifIn->Image.Top; in resizeBoxFilter()
245 prevImageDimens.Width = gifIn->Image.Width; in resizeBoxFilter()
246 prevImageDimens.Height = gifIn->Image.Height; in resizeBoxFilter()
259 if (DGifGetExtension(gifIn, &extCode, &ext) == GIF_ERROR) { in resizeBoxFilter()
275 if (imageIndex == 0 && gifIn->SColorMap) { in resizeBoxFilter()
277 if (gifIn->SBackGroundColor < 0 || in resizeBoxFilter()
278 gifIn->SBackGroundColor >= gifIn->SColorMap->ColorCount) { in resizeBoxFilter()
283 gifIn->SColorMap->Colors[gifIn->SBackGroundColor]; in resizeBoxFilter()
304 if (DGifGetExtensionNext(gifIn, &ext) == GIF_ERROR) { in resizeBoxFilter()
330 bool GifTranscoder::readImage(GifFileType* gifIn, GifByteType* rasterBits) { in readImage() argument
331 if (gifIn->Image.Interlace) { in readImage()
337 for (int j = interlacedOffset[i]; j < gifIn->Image.Height; j += interlacedJumps[i]) { in readImage()
338 if (DGifGetLine(gifIn, in readImage()
339 rasterBits + j * gifIn->Image.Width, in readImage()
340 gifIn->Image.Width) == GIF_ERROR) { in readImage()
347 if (DGifGetLine(gifIn, rasterBits, gifIn->Image.Width * gifIn->Image.Height) == GIF_ERROR) { in readImage()
355 bool GifTranscoder::renderImage(GifFileType* gifIn, in renderImage() argument
363 ASSERT(imageIndex < gifIn->ImageCount, in renderImage()
364 "Image index %d is out of bounds (count=%d)", imageIndex, gifIn->ImageCount); in renderImage()
366 ColorMapObject* colorMap = getColorMap(gifIn); in renderImage()
375 fillRect(renderBuffer, gifIn->SWidth, gifIn->SHeight, in renderImage()
376 0, 0, gifIn->SWidth, gifIn->SHeight, bgColor); in renderImage()
378 fillRect(renderBuffer, gifIn->SWidth, gifIn->SHeight, in renderImage()
384 for (int y = 0; y < gifIn->Image.Height; y++) { in renderImage()
385 for (int x = 0; x < gifIn->Image.Width; x++) { in renderImage()
386 GifByteType colorIndex = *getPixel(rasterBits, gifIn->Image.Width, x, y); in renderImage()
394 int renderX = x + gifIn->Image.Left; in renderImage()
395 int renderY = y + gifIn->Image.Top; in renderImage()
403 ColorARGB* renderPixel = getPixel(renderBuffer, gifIn->SWidth, renderX, renderY); in renderImage()
429 GifByteType GifTranscoder::computeNewColorIndex(GifFileType* gifIn, in computeNewColorIndex() argument
434 ColorMapObject* colorMap = getColorMap(gifIn); in computeNewColorIndex()
437 ColorARGB c1 = *getPixel(renderBuffer, gifIn->SWidth, x * 2, y * 2); in computeNewColorIndex()
438 ColorARGB c2 = *getPixel(renderBuffer, gifIn->SWidth, x * 2 + 1, y * 2); in computeNewColorIndex()
439 ColorARGB c3 = *getPixel(renderBuffer, gifIn->SWidth, x * 2, y * 2 + 1); in computeNewColorIndex()
440 ColorARGB c4 = *getPixel(renderBuffer, gifIn->SWidth, x * 2 + 1, y * 2 + 1); in computeNewColorIndex()
490 ColorMapObject* GifTranscoder::getColorMap(GifFileType* gifIn) { in getColorMap() argument
491 if (gifIn->Image.ColorMap) { in getColorMap()
492 return gifIn->Image.ColorMap; in getColorMap()
494 return gifIn->SColorMap; in getColorMap()
520 void GifFilesCloser::setGifIn(GifFileType* gifIn) { in setGifIn() argument
522 mGifIn = gifIn; in setGifIn()