MCPcopy Create free account
hub / github.com/NatronGitHub/openfx-misc / getInputFormat

Method getInputFormat

Reformat/Reformat.cpp:326–350  ·  view source on GitHub ↗

recturn the input format in pixel units (we use a RectD in case the input format is the RoD)

Source from the content-addressed store, hash-verified

324
325// recturn the input format in pixel units (we use a RectD in case the input format is the RoD)
326void
327ReformatPlugin::getInputFormat(const double time,
328 double* par,
329 OfxRectD* rect) const
330{
331 *par = _srcClip->getPixelAspectRatio();
332#ifdef OFX_EXTENSIONS_NATRON
333 if (gHostSupportsFormat && !_useRoD->getValueAtTime(time)) {
334 OfxRectI format;
335 _srcClip->getFormat(format);
336 if ( !Coords::rectIsEmpty(format) ) {
337 // host returned a non-empty format
338 rect->x1 = format.x1;
339 rect->y1 = format.y1;
340 rect->x2 = format.x2;
341 rect->y2 = format.y2;
342 return;
343 }
344 }
345 // host does not support format
346#endif
347 OfxRectD srcRod = _srcClip->getRegionOfDefinition(time);
348 const OfxPointD rsOne = {1., 1.}; // format is with respect to unit renderscale
349 Coords::toPixelSub(srcRod, rsOne, *par, rect);
350}
351
352void
353ReformatPlugin::getOutputFormat(const double time,

Callers

nothing calls this directly

Calls 2

getValueAtTimeMethod · 0.80
getRegionOfDefinitionMethod · 0.45

Tested by

no test coverage detected