mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-21 21:41:02 +00:00
Don't print TRACE() output by default from gif_format.cpp
This commit is contained in:
parent
759326f1b6
commit
07077c139d
@ -48,6 +48,8 @@
|
|||||||
#define GifBitSize BitSize
|
#define GifBitSize BitSize
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define GIF_TRACE(...)
|
||||||
|
|
||||||
// GifBitSize can return 9 (it's a bug in giflib)
|
// GifBitSize can return 9 (it's a bug in giflib)
|
||||||
#define GifBitSizeLimited(v) (MIN(GifBitSize(v), 8))
|
#define GifBitSizeLimited(v) (MIN(GifBitSize(v), 8))
|
||||||
|
|
||||||
@ -217,10 +219,10 @@ public:
|
|||||||
, m_remap(256)
|
, m_remap(256)
|
||||||
, m_hasLocalColormaps(false)
|
, m_hasLocalColormaps(false)
|
||||||
, m_firstLocalColormap(nullptr) {
|
, m_firstLocalColormap(nullptr) {
|
||||||
TRACE("GIF: background index=%d\n", (int)m_gifFile->SBackGroundColor);
|
GIF_TRACE("GIF: background index=%d\n", (int)m_gifFile->SBackGroundColor);
|
||||||
TRACE("GIF: global colormap=%d, ncolors=%d\n",
|
GIF_TRACE("GIF: global colormap=%d, ncolors=%d\n",
|
||||||
(m_gifFile->SColorMap ? 1: 0),
|
(m_gifFile->SColorMap ? 1: 0),
|
||||||
(m_gifFile->SColorMap ? m_gifFile->SColorMap->ColorCount: 0));
|
(m_gifFile->SColorMap ? m_gifFile->SColorMap->ColorCount: 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
~GifDecoder() {
|
~GifDecoder() {
|
||||||
@ -341,7 +343,7 @@ private:
|
|||||||
std::unique_ptr<Image> frameImage(
|
std::unique_ptr<Image> frameImage(
|
||||||
readFrameIndexedImage(frameBounds));
|
readFrameIndexedImage(frameBounds));
|
||||||
|
|
||||||
TRACE("GIF: Frame[%d] transparent index = %d\n", (int)m_frameNum, m_localTransparentIndex);
|
GIF_TRACE("GIF: Frame[%d] transparent index = %d\n", (int)m_frameNum, m_localTransparentIndex);
|
||||||
|
|
||||||
if (m_frameNum == 0) {
|
if (m_frameNum == 0) {
|
||||||
if (m_localTransparentIndex >= 0)
|
if (m_localTransparentIndex >= 0)
|
||||||
@ -356,8 +358,8 @@ private:
|
|||||||
// Convert the sprite to RGB if we have more than 256 colors
|
// Convert the sprite to RGB if we have more than 256 colors
|
||||||
if ((m_sprite->pixelFormat() == IMAGE_INDEXED) &&
|
if ((m_sprite->pixelFormat() == IMAGE_INDEXED) &&
|
||||||
(m_sprite->palette(m_frameNum)->size() > 256)) {
|
(m_sprite->palette(m_frameNum)->size() > 256)) {
|
||||||
TRACE("GIF: Converting to RGB because we have %d colors\n",
|
GIF_TRACE("GIF: Converting to RGB because we have %d colors\n",
|
||||||
m_sprite->palette(m_frameNum)->size());
|
m_sprite->palette(m_frameNum)->size());
|
||||||
|
|
||||||
convertIndexedSpriteToRgb();
|
convertIndexedSpriteToRgb();
|
||||||
}
|
}
|
||||||
@ -475,7 +477,7 @@ private:
|
|||||||
int ncolors = colormap->ColorCount;
|
int ncolors = colormap->ColorCount;
|
||||||
bool isLocalColormap = (m_gifFile->Image.ColorMap ? true: false);
|
bool isLocalColormap = (m_gifFile->Image.ColorMap ? true: false);
|
||||||
|
|
||||||
TRACE("GIF: Local colormap=%d, ncolors=%d\n", isLocalColormap, ncolors);
|
GIF_TRACE("GIF: Local colormap=%d, ncolors=%d\n", isLocalColormap, ncolors);
|
||||||
|
|
||||||
// We'll calculate the list of used colormap indexes in this
|
// We'll calculate the list of used colormap indexes in this
|
||||||
// frameImage.
|
// frameImage.
|
||||||
@ -558,17 +560,17 @@ private:
|
|||||||
// Number of colors in the image that aren't in the palette.
|
// Number of colors in the image that aren't in the palette.
|
||||||
int missing = (usedNColors - found);
|
int missing = (usedNColors - found);
|
||||||
|
|
||||||
TRACE("GIF: Bg index=%d,\n"
|
GIF_TRACE("GIF: Bg index=%d,\n"
|
||||||
" Local transparent index=%d,\n"
|
" Local transparent index=%d,\n"
|
||||||
" Need extra index to show bg color=%d,\n "
|
" Need extra index to show bg color=%d,\n "
|
||||||
" Found colors in palette=%d,\n"
|
" Found colors in palette=%d,\n"
|
||||||
" Used colors in local pixels=%d,\n"
|
" Used colors in local pixels=%d,\n"
|
||||||
" Base for new colors in palette=%d,\n"
|
" Base for new colors in palette=%d,\n"
|
||||||
" Colors in the image missing in the palette=%d,\n"
|
" Colors in the image missing in the palette=%d,\n"
|
||||||
" New palette size=%d\n",
|
" New palette size=%d\n",
|
||||||
m_bgIndex, m_localTransparentIndex, needsExtraBgColor,
|
m_bgIndex, m_localTransparentIndex, needsExtraBgColor,
|
||||||
found, usedNColors, base, missing,
|
found, usedNColors, base, missing,
|
||||||
base + missing + (needsExtraBgColor ? 1: 0));
|
base + missing + (needsExtraBgColor ? 1: 0));
|
||||||
|
|
||||||
Palette oldPalette(*palette);
|
Palette oldPalette(*palette);
|
||||||
palette->resize(base + missing + (needsExtraBgColor ? 1: 0));
|
palette->resize(base + missing + (needsExtraBgColor ? 1: 0));
|
||||||
@ -695,8 +697,8 @@ private:
|
|||||||
m_localTransparentIndex = (extension[1] & 1) ? extension[4]: -1;
|
m_localTransparentIndex = (extension[1] & 1) ? extension[4]: -1;
|
||||||
m_frameDelay = (extension[3] << 8) | extension[2];
|
m_frameDelay = (extension[3] << 8) | extension[2];
|
||||||
|
|
||||||
TRACE("GIF: Disposal method: %d\n Transparent index: %d\n Frame delay: %d\n",
|
GIF_TRACE("GIF: Disposal method: %d\n Transparent index: %d\n Frame delay: %d\n",
|
||||||
m_disposalMethod, m_localTransparentIndex, m_frameDelay);
|
m_disposalMethod, m_localTransparentIndex, m_frameDelay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1133,10 +1135,10 @@ private:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("GIF: frameBounds=%d %d %d %d prev=%d %d %d %d next=%d %d %d %d\n",
|
GIF_TRACE("GIF: frameBounds=%d %d %d %d prev=%d %d %d %d next=%d %d %d %d\n",
|
||||||
frameBounds.x, frameBounds.y, frameBounds.w, frameBounds.h,
|
frameBounds.x, frameBounds.y, frameBounds.w, frameBounds.h,
|
||||||
prev.x, prev.y, prev.w, prev.h,
|
prev.x, prev.y, prev.w, prev.h,
|
||||||
next.x, next.y, next.w, next.h);
|
next.x, next.y, next.w, next.h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user