LensDistortProcessParams<Scalar> getProcessParams(const OfxRectD& inputRod, const OfxRectD& outputRod, const double pixelAspectRatio, const bool reverse = false) const { static const OfxRectD noOptionalInputRod = {0, 0, 0, 0}; return getProcessParams(inputRod, outputRod, noOptionalInputRod, pixelAspectRatio, reverse); }
bool RawReaderPlugin::getRegionOfDefinition(const OFX::RegionOfDefinitionArguments& args, OfxRectD& rod) { updateInfos(args.time); RawReaderProcessParams<Scalar> params = getProcessParams(args.time); LibRaw rawProcessor; libraw_image_sizes_t& sizes = rawProcessor.imgdata.sizes; // libraw_output_params_t& out = rawProcessor.imgdata.params; // out.half_size = 1; if(rawProcessor.open_file(params._filepath.c_str())) { BOOST_THROW_EXCEPTION(exception::FileNotExist() << exception::user("RAW: Unable to open file") << exception::filename(params._filepath)); } if(rawProcessor.adjust_sizes_info_only()) { BOOST_THROW_EXCEPTION(exception::File() << exception::user("RAW: Cannot decode infos") << exception::filename(params._filepath)); } // point2<ptrdiff_t> dims( sizes.raw_width, sizes.raw_height ); point2<ptrdiff_t> dims(sizes.width, sizes.height); // TUTTLE_LOG_VAR( TUTTLE_INFO, dims ); rod.x1 = 0; rod.x2 = dims.x * this->_clipDst->getPixelAspectRatio(); rod.y1 = 0; rod.y2 = dims.y; return true; }
ProcessPtr DatabaseSubsystem::getProcess(int processID) { RWLock::ScopedLock lock(_dbLock); ProcessPtr result; Session session = getSession(); session << "SELECT * FROM process WHERE process_id = ?", use(processID), into(result), now; if (!result.isNull()) getProcessParams(session, result); return result; }
void ImageStatisticsPlugin::getRegionsOfInterest( const OFX::RegionsOfInterestArguments& args, OFX::RegionOfInterestSetter& rois ) { OfxRectI srcRealRoi = getProcessParams( _clipSrc->getPixelRod( args.time ) )._rect; // we need the selected rectangle OfxRectD srcRealRoiD; srcRealRoiD.x1 = srcRealRoi.x1; srcRealRoiD.y1 = srcRealRoi.y1; srcRealRoiD.x2 = srcRealRoi.x2; srcRealRoiD.y2 = srcRealRoi.y2; // TUTTLE_COUT_VAR( srcRealRoiD ); rois.setRegionOfInterest( *_clipSrc, srcRealRoiD ); }
vector<ProcessPtr> DatabaseSubsystem::getProcesses() { RWLock::ScopedLock lock(_dbLock); vector<ProcessPtr> result; Session session = getSession(); session << "SELECT * FROM process", into(result), now; for (vector<ProcessPtr>::const_iterator it = result.begin(); it != result.end(); it++) { getProcessParams(session, *it); } return result; }
bool ThinningPlugin::getRegionOfDefinition( const OFX::RegionOfDefinitionArguments& args, OfxRectD& rod ) { ThinningProcessParams<Scalar> params = getProcessParams(); const OfxRectD srcRod = _clipSrc->getCanonicalRod( args.time ); switch( params._border ) { case eParamBorderPadded: rod = rectangleReduce( srcRod, 2 ); return true; default: break; } return false; }
void ImageStatisticsPlugin::getRegionsOfInterest( const OFX::RegionsOfInterestArguments& args, OFX::RegionOfInterestSetter& rois ) { ImageStatisticsProcessParams params = getProcessParams( args.time, args.renderScale ); if( params._chooseOutput == eParamChooseOutputSource ) { // In that case we need the full image input... // Not to compute statistics, but to copy the image. return; } OfxRectI inputRoi = params._rect; // we need the selected rectangle OfxRectD inputRoi_d = rectIntToDouble( inputRoi ); rois.setRegionOfInterest( *_clipSrc, inputRoi_d ); rois.setRegionOfInterest( *_clipMask, inputRoi_d ); }
ProcessPtr DatabaseSubsystem::getProcess(ClassificationObjectPtr clo) { RWLock::ScopedLock lock(_dbLock); ProcessPtr result; Session session = getSession(); session << "SELECT * FROM process INNER JOIN data_descriptor ON" " data_descriptor.process_id = process.process_id WHERE" " data_descriptor.descr_id IN " " (SELECT descr_id FROM classification_object_data WHERE" " object_id = ?)" "LIMIT 1", use(clo->objectID), into(result), now; if (!result.isNull()) getProcessParams(session, result); return result; }
bool Move2DPlugin::getRegionOfDefinition( const OFX::RegionOfDefinitionArguments& args, OfxRectD& rod ) { Move2DProcessParams<Scalar> params = getProcessParams(); OfxRectD srcRod = _clipSrc->getCanonicalRod( args.time ); // switch( params._border ) // { // case eParamBorderPadded: rod.x1 = srcRod.x1 + params._translation.x; rod.y1 = srcRod.y1 + params._translation.y; rod.x2 = srcRod.x2 + params._translation.x; rod.y2 = srcRod.y2 + params._translation.y; return true; // default: // break; // } // return false; }