本文整理汇总了C++中StringTable::Initialize方法的典型用法代码示例。如果您正苦于以下问题:C++ StringTable::Initialize方法的具体用法?C++ StringTable::Initialize怎么用?C++ StringTable::Initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringTable
的用法示例。
在下文中一共展示了StringTable::Initialize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
int i = 0;
while( i < size ) {
io->read_proc(&pal[i].rgbRed, 1, 1, handle);
io->read_proc(&pal[i].rgbGreen, 1, 1, handle);
io->read_proc(&pal[i].rgbBlue, 1, 1, handle);
i++;
}
} else if( info->global_color_table_offset != 0 ) {
long pos = io->tell_proc(handle);
io->seek_proc(handle, info->global_color_table_offset, SEEK_SET);
int i = 0;
while( i < info->global_color_table_size ) {
io->read_proc(&pal[i].rgbRed, 1, 1, handle);
io->read_proc(&pal[i].rgbGreen, 1, 1, handle);
io->read_proc(&pal[i].rgbBlue, 1, 1, handle);
i++;
}
io->seek_proc(handle, pos, SEEK_SET);
} else {
//its legal to have no palette, but we're going to generate *something*
for( int i = 0; i < 256; i++ ) {
pal[i].rgbRed = i;
pal[i].rgbGreen = i;
pal[i].rgbBlue = i;
}
}
//LZW Minimum Code Size
io->read_proc(&b, 1, 1, handle);
StringTable stringtable;
stringtable.Initialize(b);
//Image Data Sub-blocks
int x = 0, xpos = 0, y = 0, shift = 8 - bpp, mask = (1 << bpp) - 1, interlacepass = 0;
BYTE *scanline = FreeImage_GetScanLine(dib, height - 1);
BYTE buf[1024];
io->read_proc(&b, 1, 1, handle);
while( b ) {
io->read_proc(stringtable.FillInputBuffer(b), b, 1, handle);
int size = sizeof(buf);
while( stringtable.Decompress(buf, &size) ) {
for( int i = 0; i < size; i++ ) {
scanline[xpos] |= (buf[i] & mask) << shift;
if( shift > 0 ) {
shift -= bpp;
} else {
xpos++;
shift = 8 - bpp;
}
if( ++x >= width ) {
if( interlaced ) {
y += g_GifInterlaceIncrement[interlacepass];
if( y >= height && interlacepass < GIF_INTERLACE_PASSES ) {
y = g_GifInterlaceOffset[++interlacepass];
}
} else {
y++;
}
if( y >= height ) {
stringtable.Done();
break;
}
x = xpos = 0;