本文整理汇总了C++中Image::Binary方法的典型用法代码示例。如果您正苦于以下问题:C++ Image::Binary方法的具体用法?C++ Image::Binary怎么用?C++ Image::Binary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Image
的用法示例。
在下文中一共展示了Image::Binary方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: binary_cb
int binary_cb(void)
{
Image* tmp = gc.image;
if (tmp != NULL) {
IupSetfAttribute(gc.msgbar, "TITLE", "Grey scale image ...");
gc.image = tmp->GreyCopy();
repaint_cb(gc.canvas); /* repaint canvas */
delete tmp;
tmp = gc.image;
gc.image = tmp->Binary();
repaint_cb(gc.canvas); /* repaint canvas */
delete tmp;
IupSetfAttribute(gc.msgbar, "TITLE", "Binary scale image ...");
}
return IUP_DEFAULT;
}
示例2: count_cb
int count_cb(void)
{
IupSetfAttribute(gc.msgbar, "TITLE", "Counting...");
Image* tmp = gc.image;
int count = 0;
if (tmp != NULL) {
gc.image = tmp->Binary();
delete tmp;
count = gc.image->Count();
if (count > 0) {
string c = "Components: " + std::to_string(count);
IupSetfAttribute(gc.msgbar, "TITLE", c.c_str());
}
}
repaint_cb(gc.canvas); /* repaint canvas */
return IUP_DEFAULT;
}