本文整理汇总了C++中CRGBA::setRGBAI方法的典型用法代码示例。如果您正苦于以下问题:C++ CRGBA::setRGBAI方法的具体用法?C++ CRGBA::setRGBAI怎么用?C++ CRGBA::setRGBAI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRGBA
的用法示例。
在下文中一共展示了CRGBA::setRGBAI方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
if (num_bytes_read < file_size)
memset(&data[num_bytes_read], 0, file_size - num_bytes_read);
//------
uchar *raw_data = new uchar [num_image_bytes];
decompressData(data, num_bytes_read, raw_data, num_image_bytes);
delete [] data;
if (image_header->interlaced)
deInterlace(raw_data, image_header);
//------
CGenImage *image = proto->dup();
image->setType(CFILE_TYPE_IMAGE_GIF);
image->setColormap(true);
image->setDataSize(image_header->width, image_header->height);
int bottom = gif_data->header->height - image_header->height - image_header->top;
int right = gif_data->header->width - image_header->width - image_header->left;
//image->setBorder(image_header->left, bottom, right, image_header->top);
if (bottom != 0 || right != 0) std::cerr << "Unhandled border" << std::endl;
if (gif_data->num_local_colors > 0) {
for (int i = 0; i < gif_data->num_local_colors; ++i) {
CRGBA rgba;
rgba.setRGBAI(gif_data->local_colors[i].r,
gif_data->local_colors[i].g,
gif_data->local_colors[i].b);
image->addColor(rgba);
}
}
else {
for (int i = 0; i < gif_data->num_global_colors; ++i) {
CRGBA rgba;
rgba.setRGBAI(gif_data->global_colors[i].r,
gif_data->global_colors[i].g,
gif_data->global_colors[i].b);
image->addColor(rgba);
}
//image->setBackground(image->getColor(gif_data->header->background));
}
//------
if (transparent)
image->setTransparentColor(transparent_color);
//------
for (int y = 0, k = 0; y < image_header->height; ++y)
for (int x = 0; x < image_header->width; ++x, ++k)
image->setColorIndex(x, y, raw_data[k]);
delete [] raw_data;
//------
CGIFFrame *frame = new CGIFFrame(image);
frame->setDelay(delay);
frame->setDispose(dispose);
frame->setUserInput(user_input);
image_anim->add(frame);
//------
delay = 0;
transparent = false;
transparent_color = 0;
dispose = 0;
user_input = 0;
//------
delete image_header;
image_header = NULL;
}
catch (...) {
delete image_header;
CTHROW("Failed to read GIF file");
}
}
else if (id == CONTROL_ID) {