55 bool save(std::ostream &os)
const;
65 void copyMetadataToOptions(
UT_Options &opt)
const;
67 void updateMetadataFromOptions(
const UT_Options &opt);
74 int x()
const {
return d->myDataWindow.x(); }
75 int y()
const {
return d->myDataWindow.y(); }
77 int width()
const {
return d->myDataWindow.width(); }
78 int height()
const {
return d->myDataWindow.height(); }
80 int r()
const {
return d->myDataWindow.x2(); }
81 int t()
const {
return d->myDataWindow.y2(); }
94 {
return d->myPixelAspectRatio * d->myDisplayWindowSize[0] / d->myDisplayWindowSize[1]; }
120 {
UT_Matrix4D toimage = d->myTransform; toimage.
prescale(d->myImagingScale);
return toimage; }
143 {
return d->myImageToPixelScale / myBufferToPixelScale; }
145 {
return (d->myImageToPixelTranslate - myBufferToPixelTranslate) / myBufferToPixelScale; }
147 {
return myBufferToPixelScale / d->myImageToPixelScale; }
151 {
return v * imageToPixelScale() + imageToPixelTranslate(); }
153 {
return (v - imageToPixelTranslate()) / imageToPixelScale(); }
157 {
return (v - bufferToPixelTranslate()) / bufferToPixelScale(); }
159 {
return v * bufferToPixelScale() + bufferToPixelTranslate(); }
163 {
return pixelToBuffer(imageToPixel(v)); }
165 {
return pixelToImage(bufferToPixel(v)); }
170 {
return (v + 0.5
f) * bufferToTextureScale(); }
172 {
return v * textureToBufferScale() - 0.5f; }
176 {
return bufferToTexture(imageToBuffer(v)); }
178 {
return bufferToImage(textureToBuffer(v)); }
182 {
return bufferToPixel(textureToBuffer(v)); }
184 {
return bufferToTexture(pixelToBuffer(v)); }
199 template <
typename T>
214 myBufferToPixelScale = a.myBufferToPixelScale;
215 myBufferToPixelTranslate = a.myBufferToPixelTranslate;
217 myAttributes = a.myAttributes;
227 wd()->myDataWindow.set(x, y, w, h);
228 setDisplayWindow(x, y, w, h);
241 w->myDisplayWindowSize = wh;
242 const fpreal64 pa = w->myPixelAspectRatio;
243 const fpreal64 m = (pa * wh[0] >= wh[1]) ? wh[0] / 2 : wh[1] / 2 / pa;
244 w->myImageToPixelScale.
assign(m, m * pa);
245 w->myImageToPixelTranslate = xy + wh / 2;
299 myBufferToPixelScale = 1;
300 myBufferToPixelTranslate.assign(
x()+0.5
f,
y()+0.5
f);
318 void setBufferToPixelTranslate(
const UT_Vector2D &p);
321 { myAttributes = attrib; }
323 {
return myAttributes; }
329 template <
typename OP>
331 { myAttributes.update(op); }
341 static void unregisterLayers(
UT_IntArray ®istered);
398 mutable bool fixICXform =
true;
406 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)
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.
UT_Vector2D imageToTexture(const UT_Vector2D &v) const
UT_Vector2D textureToPixel(const UT_Vector2D &v) const
UT_Vector2D bufferToTexture(const UT_Vector2D &v) const
UT_Vector2T< fpreal64 > UT_Vector2D
fpreal64 focusDistance() const
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
JSON reader class which handles parsing of JSON or bJSON files.
fpreal64 apertureMax() const
Class which writes ASCII or binary JSON streams.
void setLensDiameter(fpreal64 mm)
IMX_Layer(const IMX_Layer &a, bool)
"copy constructor" that does not copy the buffer pixels
GLenum GLuint GLint GLint layer
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.
IMX_Projection statProjection() const
Returns the projection type.
void setDisplayWindow(const UT_Vector2D &xy, const UT_Vector2D &wh)
UT_SharedPtr< const IMX_Layer > IMX_LayerConstPtr
bool isPerspective() const
fpreal64 apertureAspect() const
width / height of the aperture / displayWindow
UT_Vector2D textureToBufferScale() const
void prescale(T sx, T sy, T sz, T sw=1)
UT_Vector2D bufferPixelSize() const
void setAperture(fpreal64 mm)
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, const UT_Matrix4F &camera_to_world, const UT_Vector3F &camera_image_pos)
Set transform between image and buffer space.
void setApertureAspect(int n, int d)
exint bufferHeight() const
Get height (number of rows) of the buffer.
UT_Vector2D imageToPixel(const UT_Vector2D &v) const
Image <-> Pixel.
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
UT_Matrix4D transform() const
GLfloat GLfloat GLfloat GLfloat h
A map of string to various well defined value types.
const UT_Vector2D & shutter() const
IMX_Layer(const PXL_Raster &rp)
Construct a layer from a PXL_Raster.
const UT_Vector2D & imageToPixelScale() const
Coordinate transforms.
void transform(const UT_Matrix4D &m)
void setProjection(IMX_Projection p)
void setDataWindow(int w, int h)
Set both dataWindow and displayWindow to the same rectangle.
exint bufferWidth() const
Get width (number of columns in a row) of the buffer.
UT_Matrix4D baseTransform() const
Transform from image space to world space.
void setFocusDistance(fpreal64 f)
void preTransform(const UT_Matrix4D &m)
void setClippingRange(const UT_Vector2D &v)
void setFStop(fpreal64 f)
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.
IMX_Projection projection() const
Camera.
UT_Vector2D imageToBufferScale() const
void setBaseTransform(const UT_Matrix4D &m)
set the imageToWorld transform. This can be done at any time
void setStatProjection(IMX_Projection projection)
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.
UT_Matrix4D imageToWorldXform() const
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