DD::Image::ProxyContext Class Reference

Inherited by DD::Image::OutputContext.

Public Types

enum  ProxySetting {
  PROXY_OFF, PROXY_NEVER, PROXY_SCALE_DOWN, PROXY_NEAREST,
  PROXY_ALWAYS
}
 

Public Member Functions

ProxySetting proxy () const
 
void setProxy (ProxySetting v)
 
float scale_x () const
 
float scale_y () const
 
float translate_x () const
 
float translate_y () const
 
void setProxyscale (float scale)
 
void setProxyscale (float sx, float sy)
 
void setProxyscale (const Format &fullsize, const Format &proxysize)
 
void setProxyscale (const Matrix4 &)
 
void scale (float scale)
 
void scale (float sx, float sy)
 
void translate (float x, float y)
 
bool isIdentity () const
 
void to_proxy (Matrix4 &) const
 
void to_proxy_wh (double &w, double &h) const
 
void to_proxy_wh (float &w, float &h) const
 
double to_proxy_w (double w) const
 
double to_proxy_h (double w) const
 
void to_proxy_xy (double &x, double &y) const
 
void to_proxy_xy (float &x, float &y) const
 
double to_proxy_x (double w) const
 
double to_proxy_y (double w) const
 
double from_proxy_x (double x) const
 
double from_proxy_y (double y) const
 
void to_proxy_box (DD::Image::Box &box) const
 
void to_proxy_area (double &w, double &h) const
 
double to_proxy_area (double area) const
 
void to_proxy (const Format &from, Format &to) const
 
const Formatto_proxy_rel (const Format &from, Format &to, const ProxyContext &) const
 
double to_proxy_pixel_aspect (double pa) const
 
void from_proxy (Matrix4 &) const
 
void from_proxy_xy (double &x, double &y) const
 
void from_proxy_wh (double &w, double &h) const
 
void from_proxy_xy (float &x, float &y) const
 
void from_proxy_wh (float &w, float &h) const
 
double from_proxy_area (double area) const
 
double from_proxy_pixel_aspect (double pa) const
 
void appendProxy (Hash &hash) const
 Append the values affecting proxy scaling to the hash (i.e. not frame or view)
 

Protected Member Functions

 ProxyContext ()
 
bool isEqualTo (const ProxyContext &other) const
 
bool isLessThan (const ProxyContext &other) const
 

Friends

std::ostream & operator<< (std::ostream &o, const ProxyContext &)
 

Detailed Description

See also class DD::Image::OutputContext

This is the part out OutputContext which deals with proxy and should NOT be instantiated.

It is intentionaly non-virtual in order to not loose any performance and does NOT contain any allocations that would otherwise need cleaning up.

It contains a ProxySetting to denote how to Scale and a representation of a 3x2 matrix with b,c missing, to denote Scale and Translation properties.

Member Enumeration Documentation

Enumerator
PROXY_OFF 

Nuke's proxy mode is turned off.

PROXY_NEVER 

Always use full-size image.

PROXY_SCALE_DOWN 

Use smallest image >= desired size, or largest if none.

PROXY_NEAREST 

Use image closest to the desired size.

PROXY_ALWAYS 

Always use proxy image.

Constructor & Destructor Documentation

DD::Image::ProxyContext::ProxyContext ( )
inlineprotected

! Protected C'tor Should only be constructed by children such as OutputContext

Member Function Documentation

void ProxyContext::setProxyscale ( const Format fullsize,
const Format proxysize 
)

Set the scaling to the conversion from full to proxy.

References DD::Image::Format::pixel_aspect(), DD::Image::Box::t(), DD::Image::Box::w(), DD::Image::Box::x(), and DD::Image::Box::y().

void ProxyContext::setProxyscale ( const Matrix4 m)

Set the scaling to the transform in the matrix (which had better only have scale and translations).

void ProxyContext::to_proxy ( Matrix4 m) const

Multiply the matrix by the transformation from full-size space to proxy space. If the matrix was the identity, it will now be a transform from full size to proxy.

References DD::Image::Matrix4::scale(), and DD::Image::Matrix4::translate().

void ProxyContext::to_proxy ( const Format from,
Format to 
) const

Replace the contents of to with the scaled version of from. Integer values are rounded to the nearest match. The name of the format is set to null.

References fast_rint(), DD::Image::Format::height(), DD::Image::Format::name(), DD::Image::Format::pixel_aspect(), DD::Image::Box::r(), DD::Image::Box::t(), DD::Image::Format::width(), DD::Image::Box::x(), and DD::Image::Box::y().

const Format * ProxyContext::to_proxy_rel ( const Format from,
Format to,
const ProxyContext rel 
) const

from is the result of rel.to_proxy. Undoes the rel.to_proxy, and then applies this.to_proxy to the result. If this results in from then from is returned. Otherwise the result is written over to and that is returned. This is a weird action used by Nuke.

References fast_rint(), DD::Image::Format::height(), DD::Image::Format::name(), DD::Image::Format::pixel_aspect(), DD::Image::Box::r(), DD::Image::Box::t(), DD::Image::Format::width(), DD::Image::Box::x(), and DD::Image::Box::y().

void ProxyContext::from_proxy ( Matrix4 m) const

Multiply the matrix by the transformation from proxy space to full-size space. If the matrix was the identity, it will now be a transform from proxy to full-size;

References DD::Image::Matrix4::scale(), and DD::Image::Matrix4::translate().



©2021 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.thefoundry.co.uk