本文整理汇总了C++中Oiiotool::pop方法的典型用法代码示例。如果您正苦于以下问题:C++ Oiiotool::pop方法的具体用法?C++ Oiiotool::pop怎么用?C++ Oiiotool::pop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Oiiotool
的用法示例。
在下文中一共展示了Oiiotool::pop方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ImageRec
static int
action_flip (int argc, const char *argv[])
{
if (ot.postpone_callback (1, action_flip, argc, argv))
return 0;
ot.read ();
ImageRecRef A = ot.pop();
ot.push (new ImageRec (*A, ot.allsubimages ? -1 : 0,
ot.allsubimages ? -1 : 0, true, false));
int subimages = ot.curimg->subimages();
for (int s = 0; s < subimages; ++s) {
int miplevels = ot.curimg->miplevels(s);
for (int m = 0; m < miplevels; ++m) {
const ImageBuf &Aib ((*A)(s,m));
ImageBuf &Rib ((*ot.curimg)(s,m));
ImageBuf::ConstIterator<float> a (Aib);
ImageBuf::Iterator<float> r (Rib);
int nchans = Rib.nchannels();
int firstscanline = Rib.ymin();
int lastscanline = Rib.ymax();
for ( ; ! r.done(); ++r) {
a.pos (r.x(), lastscanline - (r.y() - firstscanline));
for (int c = 0; c < nchans; ++c)
r[c] = a[c];
}
}
}
return 0;
}
示例2: B
static int
action_add (int argc, const char *argv[])
{
if (ot.postpone_callback (2, action_add, argc, argv))
return 0;
ImageRecRef B (ot.pop());
ImageRecRef A (ot.pop());
ot.read (A);
ot.read (B);
ot.push (new ImageRec (*A, ot.allsubimages ? -1 : 0,
ot.allsubimages ? -1 : 0, true, false));
int subimages = ot.curimg->subimages();
for (int s = 0; s < subimages; ++s) {
int miplevels = ot.curimg->miplevels(s);
for (int m = 0; m < miplevels; ++m) {
const ImageBuf &Aib ((*A)(s,m));
const ImageBuf &Bib ((*B)(s,m));
if (! same_size (Aib, Bib)) {
// FIXME: some day, there should be options of combining
// differing images somehow.
std::cerr << "oiiotool: " << argv[0] << " could not combine images of differing sizes\n";
continue;
}
ImageBuf &Rib ((*ot.curimg)(s,m));
ImageBufAlgo::add (Rib, Aib, Bib);
}
}
return 0;
}
示例3: ASSERT
static int
action_pop (int argc, const char *argv[])
{
ASSERT (argc == 1);
ot.pop ();
return 0;
}