59 int x()
const {
return d->myDataWindow.x(); }
60 int y()
const {
return d->myDataWindow.y(); }
62 int width()
const {
return d->myDataWindow.width(); }
63 int height()
const {
return d->myDataWindow.height(); }
65 int r()
const {
return d->myDataWindow.x2(); }
66 int t()
const {
return d->myDataWindow.y2(); }
79 {
return d->myPixelAspectRatio * d->myDisplayWindowSize[0] / d->myDisplayWindowSize[1]; }
84 bool isOrtho()
const {
return d->myProjection == ORTHOGRAPHIC; }
128 {
return d->myImageToPixelScale / myBufferToPixelScale; }
130 {
return (d->myImageToPixelTranslate - myBufferToPixelTranslate) / myBufferToPixelScale; }
132 {
return myBufferToPixelScale / d->myImageToPixelScale; }
136 {
return v * imageToPixelScale() + imageToPixelTranslate(); }
138 {
return (v - imageToPixelTranslate()) / imageToPixelScale(); }
142 {
return (v - bufferToPixelTranslate()) / bufferToPixelScale(); }
144 {
return v * bufferToPixelScale() + bufferToPixelTranslate(); }
148 {
return pixelToBuffer(imageToPixel(v)); }
150 {
return pixelToImage(bufferToPixel(v)); }
155 {
return (v + 0.5
f) * bufferToTextureScale(); }
157 {
return v * textureToBufferScale() - 0.5f; }
161 {
return bufferToTexture(imageToBuffer(v)); }
163 {
return bufferToImage(textureToBuffer(v)); }
167 {
return bufferToPixel(textureToBuffer(v)); }
169 {
return bufferToTexture(pixelToBuffer(v)); }
184 template <
typename T>
199 myBufferToPixelScale = a.myBufferToPixelScale;
200 myBufferToPixelTranslate = a.myBufferToPixelTranslate;
203 myAttributes = a.myAttributes;
213 wd()->myDataWindow.set(x, y, w, h);
214 setDisplayWindow(x, y, w, h);
227 w->myDisplayWindowSize = wh;
228 const fpreal64 pa = w->myPixelAspectRatio;
229 const fpreal64 m = (pa * wh[0] >= wh[1]) ? wh[0] / 2 : wh[1] / 2 / pa;
230 w->myImageToPixelScale.
assign(m, m * pa);
231 w->myImageToPixelTranslate = xy + wh / 2;
282 myBufferToPixelScale = 1;
283 myBufferToPixelTranslate.assign(
x()+0.5
f,
y()+0.5
f);
301 void setBufferToPixelTranslate(
const UT_Vector2D &p);
304 { myAttributes = attrib; }
306 {
return myAttributes; }
312 template <
typename OP>
314 { myAttributes.update(op); }
339 Projection myProjection = ORTHOGRAPHIC;
354 mutable bool fixICXform =
true;
362 Metadata *wdf() { Metadata *
w = wd(); w->fixICXform =
true;
return w; }
void setAttributes(const UT_OptionsHolder &attrib)
UT_Vector2T< int64 > UT_Vector2I
void copyMetadata(const IMX_Buffer &source)
void setProjection(Projection p)
UT_Vector2D bufferToPixel(const UT_Vector2D &v) const
UT_Vector2D textureToImage(const UT_Vector2D &v) const
UT_Vector2D imageToBuffer(const UT_Vector2D &v) const
Image <-> Buffer.
void setCameraPosition(const UT_Vector3D &p)
fpreal64 focalLength() const
void updateAttributes(const OP &op)
const UT_Vector2D & imageToPixelTranslate() const
getFileOption("OpenEXR:storage") storage
const UT_Vector2D & pixelScale() const
void setPixelAspectRatio(fpreal64 pa)
Set pixel aspect ratio. This must be done before setDataWindow.
void setTransform(const UT_Matrix4D &m)
set the imageToWorld transform. This can be done at any time
UT_Vector2D imageToTexture(const UT_Vector2D &v) const
UT_Vector2D textureToPixel(const UT_Vector2D &v) const
const UT_Matrix4D & transform() const
Transform from image space to world space.
UT_Vector2D bufferToTexture(const UT_Vector2D &v) const
UT_Vector2T< fpreal64 > UT_Vector2D
GLdouble GLdouble GLdouble z
UT_Vector2D textureToBuffer(const UT_Vector2D &v) const
void setApertureOffset(const UT_Vector2D &p)
const UT_DimRect & dataWindow() const
The dataWindow surrounds all the pixels.
GLboolean GLboolean GLboolean GLboolean a
const UT_Vector2D & bufferToPixelScale() const
UT_OptionsHolder attributes() const
const UT_Vector2D & clippingRange() const
fpreal64 apertureMax() const
void setLensDiameter(fpreal64 mm)
const UT_StringHolder & getName() const
IMX_Layer(const IMX_Layer &a, bool)
"copy constructor" that does not copy the buffer pixels
int bufferHeight() const
Get height (number of rows) of the buffer.
UT_Vector2D pixelToImage(const UT_Vector2D &v) const
void copyMetadata(const IMX_Layer &a)
UT_Vector2D pixelToBuffer(const UT_Vector2D &v) const
Pixel <-> Buffer.
GLint GLsizei GLsizei height
const UT_Vector2D & displayWindowSize() const
Aperture in pixels.
void setFocalLength(fpreal64 mm)
UT_Vector2D imageToBufferTranslate() const
UT_Vector2D pixelToTexture(const UT_Vector2D &v) const
void setBufferSize(int width, int height)
Sets size of this buffer.
void setApertureCenter(const UT_Vector2D &p)
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
void setDisplayWindow(const UT_Vector2D &xy, const UT_Vector2D &wh)
UT_SharedPtr< const IMX_Layer > IMX_LayerConstPtr
const UT_Matrix4D & imageToWorldXform() const
bool isPerspective() const
fpreal64 apertureAspect() const
width / height of the aperture / displayWindow
UT_Vector2D textureToBufferScale() const
UT_Vector2D bufferPixelSize() const
void setAperture(fpreal64 mm)
void setApertureAspect(int n, int d)
UT_Vector2D imageToPixel(const UT_Vector2D &v) const
Image <-> Pixel.
GLuint const GLchar * name
const UT_Vector3D & cameraPosition() const
fpreal64 pixelAspectRatio() const
Distortion in image->pixel space transform.
fpreal64 lensDiameter() const
void setDataWindowOnly(int x, int y, int w, int h)
Set dataWindow w/o changing displayWindow.
void setDisplayWindow(int x, int y, int w, int h)
void setDataWindow(int x, int y, int w, int h)
bool isPixelScale() const
UT_Vector2D bufferToImage(const UT_Vector2D &v) const
GLfloat GLfloat GLfloat GLfloat h
UT_Vector2D apertureOffset() const
const UT_Vector2D & shutter() const
fpreal64 focusPlane() const
void setFocusPlane(fpreal64 f)
IMX_Layer(const PXL_Raster &rp)
Construct a layer from a PXL_Raster.
Projection projection() const
const UT_Vector2D & imageToPixelScale() const
Coordinate transforms.
void transform(const UT_Matrix4D &m)
void setBufferXforms(const UT_Vector2F &buffer_to_image_scale, const UT_Vector2F &buffer_to_image_xlate, const UT_Vector2F &buffer_from_image_scale, const UT_Vector2F &buffer_from_image_xlate, const UT_Vector2F &buffer_to_pixel_scale, const UT_Vector2F &buffer_to_pixel_xlate, const UT_Matrix4F &image_to_world, const UT_Matrix4F &world_to_image)
Set transform between image and buffer space.
void setDataWindow(int w, int h)
Set both dataWindow and displayWindow to the same rectangle.
void preTransform(const UT_Matrix4D &m)
void setClippingRange(const UT_Vector2D &v)
void setFStop(fpreal64 f)
int bufferWidth() const
Get width (number of columns in a row) of the buffer.
GLubyte GLubyte GLubyte GLubyte w
void assign(T xx=0.0f, T yy=0.0f)
Set the values of the vector components.
IMX_Layer(int width, int height, CE_Image::StorageType storage, int channels)
Initialize the IMX_Buffer.
UT_Vector2D imageToBufferScale() const
void setName(const UT_StringHolder &name)
void setShutter(const UT_Vector2D &v)
UT_SharedPtr< IMX_Layer > IMX_LayerPtr
void setDisplayWindow(int w, int h)
Set the displayWindow w/o changing dataWindow.
ImageBuf OIIO_API channels(const ImageBuf &src, int nchannels, cspan< int > channelorder, cspan< float > channelvalues={}, cspan< std::string > newchannelnames={}, bool shuffle_channel_names=false, int nthreads=0)
UT_Vector2D bufferToTextureScale() const
const UT_Vector2D & bufferToPixelTranslate() const
void setCameraZ(fpreal64 z)
UT_Vector2D displayWindowRT() const
UT_Vector2D displayWindowXY() const