本文整理汇总了C++中ofx::Clip::fetchStereoscopicImage方法的典型用法代码示例。如果您正苦于以下问题:C++ Clip::fetchStereoscopicImage方法的具体用法?C++ Clip::fetchStereoscopicImage怎么用?C++ Clip::fetchStereoscopicImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofx::Clip
的用法示例。
在下文中一共展示了Clip::fetchStereoscopicImage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dst
/* set up and run a processor */
void
AnaglyphPlugin::setupAndProcess(AnaglyphBase &processor, const OFX::RenderArguments &args)
{
// get a dst image
std::auto_ptr<OFX::Image> dst(dstClip_->fetchImage(args.time));
if (!dst.get()) {
OFX::throwSuiteStatusException(kOfxStatFailed);
}
if (dst->getRenderScale().x != args.renderScale.x ||
dst->getRenderScale().y != args.renderScale.y ||
dst->getField() != args.fieldToRender) {
setPersistentMessage(OFX::Message::eMessageError, "", "OFX Host gave image with wrong scale or field properties");
OFX::throwSuiteStatusException(kOfxStatFailed);
}
OFX::BitDepthEnum dstBitDepth = dst->getPixelDepth();
OFX::PixelComponentEnum dstComponents = dst->getPixelComponents();
// fetch main input image
std::auto_ptr<OFX::Image> srcLeft(srcClip_->fetchStereoscopicImage(args.time,0));
if (srcLeft.get()) {
if (srcLeft->getRenderScale().x != args.renderScale.x ||
srcLeft->getRenderScale().y != args.renderScale.y ||
srcLeft->getField() != args.fieldToRender) {
setPersistentMessage(OFX::Message::eMessageError, "", "OFX Host gave image with wrong scale or field properties");
OFX::throwSuiteStatusException(kOfxStatFailed);
}
}
std::auto_ptr<OFX::Image> srcRight(srcClip_->fetchStereoscopicImage(args.time,1));
if (srcRight.get()) {
if (srcRight->getRenderScale().x != args.renderScale.x ||
srcRight->getRenderScale().y != args.renderScale.y ||
srcRight->getField() != args.fieldToRender) {
setPersistentMessage(OFX::Message::eMessageError, "", "OFX Host gave image with wrong scale or field properties");
OFX::throwSuiteStatusException(kOfxStatFailed);
}
}
// make sure bit depths are sane
if (srcLeft.get()) {
OFX::BitDepthEnum srcBitDepth = srcLeft->getPixelDepth();
OFX::PixelComponentEnum srcComponents = srcLeft->getPixelComponents();
// see if they have the same depths and bytes and all
if (srcBitDepth != dstBitDepth || srcComponents != dstComponents)
OFX::throwSuiteStatusException(kOfxStatErrImageFormat);
}
if (srcRight.get()) {
OFX::BitDepthEnum srcBitDepth = srcRight->getPixelDepth();
OFX::PixelComponentEnum srcComponents = srcRight->getPixelComponents();
// see if they have the same depths and bytes and all
if (srcBitDepth != dstBitDepth || srcComponents != dstComponents)
OFX::throwSuiteStatusException(kOfxStatErrImageFormat);
}
double amtcolour = amtcolour_->getValueAtTime(args.time);
bool swap = swap_->getValueAtTime(args.time);
int offset = offset_->getValueAtTime(args.time);
// set the images
processor.setDstImg(dst.get());
processor.setSrcLeftImg(srcLeft.get());
processor.setSrcRightImg(srcRight.get());
// set the render window
processor.setRenderWindow(args.renderWindow);
// set the parameters
processor.setAmtColour(amtcolour);
processor.setSwap(swap);
processor.setOffset(offset);
// Call the base class process member, this will call the derived templated process code
processor.process();
}