HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IMX_Layer Class Reference

#include <IMX_Layer.h>

+ Inheritance diagram for IMX_Layer:

Public Member Functions

 IMX_Layer ()
 
 IMX_Layer (const IMX_Layer &a, bool)
 "copy constructor" that does not copy the buffer pixels More...
 
 IMX_Layer (int width, int height, CE_Image::StorageType storage, int channels)
 Initialize the IMX_Buffer. More...
 
 IMX_Layer (const PXL_Raster &rp)
 Construct a layer from a PXL_Raster. More...
 
bool save (std::ostream &os) const
 Returns true for successful save. More...
 
bool saveJSON (UT_JSONWriter &w) const
 
void copyMetadataToOptions (UT_Options &opt) const
 
void updateMetadataFromOptions (const UT_Options &opt)
 Load ourselves from the options, ignoring fields we don't know. More...
 
const UT_DimRectdataWindow () const
 The dataWindow surrounds all the pixels. More...
 
int x () const
 
int y () const
 
UT_Vector2I xy () const
 
int width () const
 
int height () const
 
UT_Vector2I wh () const
 
int r () const
 
int t () const
 
UT_Vector2I rt () const
 
fpreal64 pixelAspectRatio () const
 Distortion in image->pixel space transform. More...
 
const UT_Vector2DdisplayWindowSize () const
 Aperture in pixels. More...
 
UT_Vector2D displayWindowXY () const
 
UT_Vector2D displayWindowRT () const
 
fpreal64 apertureAspect () const
 width / height of the aperture / displayWindow More...
 
IMX_Projection projection () const
 Camera. More...
 
bool isOrtho () const
 
bool isPerspective () const
 
fpreal64 apertureMax () const
 
fpreal64 focalLength () const
 
fpreal64 fStop () const
 
fpreal64 lensDiameter () const
 
const UT_Vector2DclippingRange () const
 
fpreal64 focusDistance () const
 
const UT_Vector3DcameraPosition () const
 
fpreal64 cameraZ () const
 
const UT_Vector2Dshutter () const
 
UT_Matrix4D projectionXform () const
 Transform from camera space to image space. More...
 
UT_Matrix4D projectionXformVk () const
 Transform from camera space to texture space for Vulkan rasterization. More...
 
UT_Matrix4D baseTransform () const
 Transform from image space to world space. More...
 
UT_Matrix4D transform () const
 
UT_Matrix4D imageToWorldXform () const
 
UT_Matrix4D inverseCameraXform () const
 
const UT_Vector2DimageToPixelScale () const
 Coordinate transforms. More...
 
const UT_Vector2DimageToPixelTranslate () const
 
const UT_Vector2DbufferToPixelScale () const
 
UT_Vector2D bufferToTextureScale () const
 
UT_Vector2D textureToBufferScale () const
 
const UT_Vector2DpixelScale () const
 
bool isPixelScale () const
 
const UT_Vector2DbufferToPixelTranslate () const
 
UT_Vector2D imageToBufferScale () const
 
UT_Vector2D imageToBufferTranslate () const
 
UT_Vector2D bufferPixelSize () const
 
UT_Vector2D imageToPixel (const UT_Vector2D &v) const
 Image <-> Pixel. More...
 
UT_Vector2D pixelToImage (const UT_Vector2D &v) const
 
UT_Vector2D pixelToBuffer (const UT_Vector2D &v) const
 Pixel <-> Buffer. More...
 
UT_Vector2D bufferToPixel (const UT_Vector2D &v) const
 
UT_Vector2D imageToBuffer (const UT_Vector2D &v) const
 Image <-> Buffer. More...
 
UT_Vector2D bufferToImage (const UT_Vector2D &v) const
 
UT_Vector2D bufferToTexture (const UT_Vector2D &v) const
 
UT_Vector2D textureToBuffer (const UT_Vector2D &v) const
 
UT_Vector2D imageToTexture (const UT_Vector2D &v) const
 
UT_Vector2D textureToImage (const UT_Vector2D &v) const
 
UT_Vector2D textureToPixel (const UT_Vector2D &v) const
 
UT_Vector2D pixelToTexture (const UT_Vector2D &v) const
 
UT_Matrix4D bufferUVToWorldXform (fpreal *taper=nullptr) const
 
void setBufferUVToWorldXform (UT_Matrix4D xform, fpreal taper)
 
template<typename T >
void initFromVoxels (const UT_VoxelArray< T > &src, bool data_too)
 
void setDefault ()
 Modifications to layer metadata, in approximate order you call them. More...
 
void copyMetadata (const IMX_Layer &a)
 
void setPixelAspectRatio (fpreal64 pa)
 Set pixel aspect ratio. This must be done before setDataWindow. More...
 
void setDataWindow (int w, int h)
 Set both dataWindow and displayWindow to the same rectangle. More...
 
void setDataWindow (int x, int y, int w, int h)
 
void setDataWindowOnly (int x, int y, int w, int h)
 Set dataWindow w/o changing displayWindow. More...
 
void setDisplayWindow (int w, int h)
 Set the displayWindow w/o changing dataWindow. More...
 
void setDisplayWindow (int x, int y, int w, int h)
 
void setDisplayWindow (const UT_Vector2D &xy, const UT_Vector2D &wh)
 
void setApertureAspect (int n, int d)
 
void setApertureAspect (fpreal64 a)
 
void setProjection (IMX_Projection p)
 
void setOrtho ()
 
void setPerspective ()
 
void setCameraPosition (const UT_Vector3D &p)
 
void setCameraZ (fpreal64 z)
 
void setImagingDist (fpreal64 z)
 
void setAperture (fpreal64 mm)
 
void setApertureOffset (const UT_Vector2D &p)
 
void setApertureCenter (const UT_Vector2D &p)
 
void setFocalLength (fpreal64 mm)
 
void setFStop (fpreal64 f)
 
void setLensDiameter (fpreal64 mm)
 
void setClippingRange (const UT_Vector2D &v)
 
void setFocusDistance (fpreal64 f)
 
void setShutter (const UT_Vector2D &v)
 
void setBaseTransform (const UT_Matrix4D &m)
 set the imageToWorld transform. This can be done at any time More...
 
void transform (const UT_Matrix4D &m)
 
void preTransform (const UT_Matrix4D &m)
 
void setInverseCameraXform (const UT_Matrix4D &m)
 
void setBufferSize (int w, int h)
 
void setPixelScale (const UT_Vector2D &)
 
void setBufferToPixels ()
 
void setAligned (const IMX_Layer &src)
 
void setBufferToPixelScale (const UT_Vector2D &p)
 
void setBufferToPixelTranslate (const UT_Vector2D &p)
 
void setAttributes (const UT_OptionsHolder &attrib)
 
UT_OptionsHolder attributes () const
 
template<typename OP >
void updateAttributes (const OP &op)
 
- Public Member Functions inherited from IMX_Buffer
 IMX_Buffer ()
 Creates a new buffer. You must call setSize to make this buffer usable. More...
 
 IMX_Buffer (int width, int height, CE_Image::StorageType storage, int channels)
 Create and call setSize. More...
 
 IMX_Buffer (const IMX_Buffer &other)
 
 IMX_Buffer (IMX_Buffer &&other) noexcept
 
 IMX_Buffer (const PXL_Raster &rp)
 
 ~IMX_Buffer () override
 
EntryType poolTypeID () const override
 
void copyMetadata (const IMX_Buffer &source)
 
void copyStorageType (const IMX_Buffer &i)
 Set storesIntegers, isFixedPoint, bytes, channels. More...
 
void setStorageType (CE_Image::StorageType storage, int channels)
 Set storesIntegers, isFixedPoint, bytes, channels. More...
 
void setStorageType (CE_Image::StorageType storage)
 Set storesIntegers, isFixedPoint, bytes. More...
 
void setStorageBytes (int)
 
void setStorageBytes (int, bool)
 
void setChannels (int channels)
 Set channels, don't change storesIntegers, isFixedPoint, or bytes. More...
 
CE_Image::StorageType getStorageType () const
 Get the data type used to store pixel data for each channel. More...
 
bool storesIntegers () const
 Does this buffer store integers? More...
 
bool isFixedPoint () const
 Does this buffer use fixed point to store non-integer data? More...
 
int getChannels () const
 Get the number of channels per pixel. More...
 
int getStorageBytes () const
 Number of bytes per channel. More...
 
void setBufferSize (int width, int height)
 Sets size of this buffer. More...
 
exint bufferWidth () const
 Get width (number of columns in a row) of the buffer. More...
 
exint bufferHeight () const
 Get height (number of rows) of the buffer. More...
 
int64 getBufferSize () const
 Returns the number of bytes required to store the entire buffer. More...
 
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. More...
 
void setBorder (IMX_BorderType border)
 Sets the border type of this image. Constant means it is zero. More...
 
IMX_BorderType getBorderType () const
 Returns type of the border. More...
 
void setTypeInfo (IMX_TypeInfo typeinfo)
 Sets the semantic type info of this image. More...
 
IMX_TypeInfo getTypeInfo () const
 Returns the semantic type. More...
 
void setStatProjection (IMX_Projection projection)
 
IMX_Projection statProjection () const
 Returns the projection type. More...
 
void setDefaultColor (const UT_Vector4F &)
 
UT_Vector4F getDefaultColor () const
 
UT_Vector4I getDefaultColorI () const
 return the current integer value, which might be different More...
 
void copy (const IMX_Buffer &other)
 
IMX_Bufferoperator= (const IMX_Buffer &other)
 
void deepCopy (const IMX_Buffer &other)
 
void swap (IMX_Buffer &other)
 
IMX_Bufferoperator= (IMX_Buffer &&other)
 
bool stealable () const
 
void setStealable (bool v) const
 
bool isAligned (const IMX_Buffer &src) const
 True if the buffer pixels line up: width and the transforms from image space match. More...
 
void copyBuffer (const IMX_Buffer &other)
 Only copy the buffer pointers, the stat data is left unchanged. More...
 
void moveBuffer (IMX_Buffer &src)
 Move the buffer to this from src, src is left dirty. More...
 
void makeBufferUnique ()
 
void adoptRaster (PXL_Raster &raster, bool convert_colorspace)
 
void copyOrConvert (const IMX_Buffer &other)
 
bool extract (void *dst, exint dstsize, CE_Image::StorageType dststorage, int dstchannels) const
 
bool insert (const void *src, exint srcsize, CE_Image::StorageType srcstorage, int srcchannels)
 
UT_UniquePtr< TIL_RasterbuildRaster () const
 
const UT_SharedPtr
< CE_BufferHostByte > & 
CPUBufferPtr () const
 for debugging More...
 
const UT_SharedPtr< CE_Image > & GPUBufferPtr () const
 
void setPixelV4 (int x, int y, const UT_Vector4F &c)
 Sets an individual pixel. More...
 
void setPixelF (int x, int y, fpreal32 i)
 
void setPixelI (int x, int y, int i)
 
UT_Vector4F getPixelV4 (int x, int y) const
 Fetches the value of an individual pixel. More...
 
int getPixelI (int x, int y) const
 
UT_Vector4F getPixelV4 (fpreal64 x, fpreal64 y) const
 
void getPixelRaw (UT_Array< uint8 > &dest, int x, int y) const
 
const int16getCPUBufferRFixed16 () const
 
int16getCPUBufferWFixed16 ()
 
const uint8getCPUBufferRFixed8 () const
 
uint8getCPUBufferWFixed8 ()
 
const fpreal16getCPUBufferRF16 () const
 
fpreal16getCPUBufferWF16 ()
 
const fpreal32getCPUBufferRF32 () const
 
fpreal32getCPUBufferWF32 ()
 
const unsigned char * getCPUBufferRI8 () const
 
unsigned char * getCPUBufferWI8 ()
 
const int16getCPUBufferRI16 () const
 
int16getCPUBufferWI16 ()
 
const int32getCPUBufferRI32 () const
 
int32getCPUBufferWI32 ()
 
voidgetCPUBuffer (bool read, bool write)
 
voidgetCPUBufferR () const
 
voidgetCPUBufferW ()
 
template<CE_Image::StorageType STORAGE>
const CE_StorageTypeTraits
< STORAGE >::DataType * 
getCPUBufferR () const
 
template<CE_Image::StorageType STORAGE>
CE_StorageTypeTraits< STORAGE >
::DataType * 
getCPUBuffer (bool read, bool write)
 
CE_ImagegetGPUBuffer (bool read, bool write)
 
const CE_ImagegetGPUBufferR () const
 
CE_ImagegetGPUBufferW ()
 
bool isOnGPU () const
 Returns true if this buffer's data is currently on the GPU. More...
 
bool isOnCPU () const
 
cl::Buffer getGPUStat () const
 
bool isDirty () const
 False if there are computed pixels in the CPU or GPU buffer. More...
 
void freeBuffers ()
 Frees the pixel memory (also does setDirty()) More...
 
void destroy ()
 Frees all the memory used by buffer. More...
 
bool allocated () const
 True if getCPU/GPUBuffer has been done since last freeBuffers() More...
 
void setConstantV4 (const UT_Vector4F &i)
 
void setConstantV3 (const UT_Vector3F &i)
 
void setConstantF (fpreal32 i=0.0f)
 
void setConstantI (int32 i=0)
 
void setUninitialized ()
 
bool isConstant () const
 
bool validateBuffer () const
 
template<typename T >
void matchAndCopyToVoxels (UT_VoxelArray< T > &dest) const
 
int64 getMemoryUsage () const
 
int64 getDeviceMemoryUsage () const
 
- Public Member Functions inherited from IMX_PoolEntry
 IMX_PoolEntry ()
 Creates a new buffer. You must call setSize to make this buffer usable. More...
 
virtual ~IMX_PoolEntry ()
 
 IMX_PoolEntry (const IMX_PoolEntry &)=delete
 
IMX_PoolEntryoperator= (const IMX_PoolEntry &)=delete
 
bool isInUseGPU () const
 
void setInUseGPUFlag () const
 
void clearInUseGPUFlag () const
 

Static Public Member Functions

static IMX_LayerPtr load (UT_IStream &is)
 
static IMX_LayerPtr loadJSON (UT_JSONParser &p)
 
static int registerLayer (IMX_LayerConstPtr layer, UT_IntArray &registered)
 
static void unregisterLayers (UT_IntArray &registered)
 
static IMX_LayerConstPtr lookupLayer (int handle)
 Look up a registered layer by handle. More...
 

Additional Inherited Members

- Public Types inherited from IMX_PoolEntry
enum  EntryType { EntryType::BUFFER = 0, EntryType::VDB }
 To avoid the need for dynamic casts: More...
 
- Protected Member Functions inherited from IMX_Buffer
void poolResetGPUBuffer () override
 These implement methods required by the pool. More...
 
void poolSetOnGPU (bool ongpu) override
 Update OnGPU. More...
 
bool poolIsGPUBufferEmpty () const override
 True if the gpu buffer is null. More...
 
bool poolIsGPUBufferValid () const override
 True if the gpu buffer is not null and valid. More...
 
bool poolSwapGPUBuffer (IMX_PoolEntry *otherbase) override
 True if the swap does something. More...
 
void poolShallowCopyGPUBuffer (const IMX_PoolEntry *srcbase) override
 Shallow copy. More...
 
- Protected Attributes inherited from IMX_PoolEntry
int myGPUInUseCount = 0
 

Detailed Description

Definition at line 29 of file IMX_Layer.h.

Constructor & Destructor Documentation

IMX_Layer::IMX_Layer ( )
inline

Definition at line 33 of file IMX_Layer.h.

IMX_Layer::IMX_Layer ( const IMX_Layer a,
bool   
)
inline

"copy constructor" that does not copy the buffer pixels

Definition at line 36 of file IMX_Layer.h.

IMX_Layer::IMX_Layer ( int  width,
int  height,
CE_Image::StorageType  storage,
int  channels 
)
inline

Initialize the IMX_Buffer.

Definition at line 39 of file IMX_Layer.h.

IMX_Layer::IMX_Layer ( const PXL_Raster rp)
inline

Construct a layer from a PXL_Raster.

Definition at line 46 of file IMX_Layer.h.

Member Function Documentation

fpreal64 IMX_Layer::apertureAspect ( ) const
inline

width / height of the aperture / displayWindow

Definition at line 93 of file IMX_Layer.h.

fpreal64 IMX_Layer::apertureMax ( ) const
inline

Definition at line 100 of file IMX_Layer.h.

UT_OptionsHolder IMX_Layer::attributes ( ) const
inline

Definition at line 322 of file IMX_Layer.h.

UT_Matrix4D IMX_Layer::baseTransform ( ) const
inline

Transform from image space to world space.

Definition at line 117 of file IMX_Layer.h.

UT_Vector2D IMX_Layer::bufferPixelSize ( ) const
inline

Definition at line 146 of file IMX_Layer.h.

UT_Vector2D IMX_Layer::bufferToImage ( const UT_Vector2D v) const
inline

Definition at line 164 of file IMX_Layer.h.

UT_Vector2D IMX_Layer::bufferToPixel ( const UT_Vector2D v) const
inline

Definition at line 158 of file IMX_Layer.h.

const UT_Vector2D& IMX_Layer::bufferToPixelScale ( ) const
inline

Definition at line 133 of file IMX_Layer.h.

const UT_Vector2D& IMX_Layer::bufferToPixelTranslate ( ) const
inline

Definition at line 140 of file IMX_Layer.h.

UT_Vector2D IMX_Layer::bufferToTexture ( const UT_Vector2D v) const
inline

Definition at line 169 of file IMX_Layer.h.

UT_Vector2D IMX_Layer::bufferToTextureScale ( ) const
inline

Definition at line 134 of file IMX_Layer.h.

UT_Matrix4D IMX_Layer::bufferUVToWorldXform ( fpreal taper = nullptr) const

This is used to convert the layer to a volume, so the resulting buffer coordinates will line up with the canonical "volume" space.

const UT_Vector3D& IMX_Layer::cameraPosition ( ) const
inline

Definition at line 106 of file IMX_Layer.h.

fpreal64 IMX_Layer::cameraZ ( ) const
inline

Definition at line 107 of file IMX_Layer.h.

const UT_Vector2D& IMX_Layer::clippingRange ( ) const
inline

Definition at line 104 of file IMX_Layer.h.

void IMX_Layer::copyMetadata ( const IMX_Layer a)
inline

Copy everything except the buffer allocations, leaving the result dirty. This avoids any chance that writing this layer will modify the original layer. It also avoids shared pointer overhead and keeping buffers around longer than needed.

Definition at line 211 of file IMX_Layer.h.

void IMX_Layer::copyMetadataToOptions ( UT_Options opt) const

Write our fields into the provided options: THis does not include the stat block, nor attributes.

const UT_DimRect& IMX_Layer::dataWindow ( ) const
inline

The dataWindow surrounds all the pixels.

Definition at line 73 of file IMX_Layer.h.

UT_Vector2D IMX_Layer::displayWindowRT ( ) const
inline

Definition at line 90 of file IMX_Layer.h.

const UT_Vector2D& IMX_Layer::displayWindowSize ( ) const
inline

Aperture in pixels.

Definition at line 88 of file IMX_Layer.h.

UT_Vector2D IMX_Layer::displayWindowXY ( ) const
inline

Definition at line 89 of file IMX_Layer.h.

fpreal64 IMX_Layer::focalLength ( ) const
inline

Definition at line 101 of file IMX_Layer.h.

fpreal64 IMX_Layer::focusDistance ( ) const
inline

Definition at line 105 of file IMX_Layer.h.

fpreal64 IMX_Layer::fStop ( ) const
inline

Definition at line 102 of file IMX_Layer.h.

int IMX_Layer::height ( ) const
inline

Definition at line 78 of file IMX_Layer.h.

UT_Vector2D IMX_Layer::imageToBuffer ( const UT_Vector2D v) const
inline

Image <-> Buffer.

Definition at line 162 of file IMX_Layer.h.

UT_Vector2D IMX_Layer::imageToBufferScale ( ) const
inline

Definition at line 142 of file IMX_Layer.h.

UT_Vector2D IMX_Layer::imageToBufferTranslate ( ) const
inline

Definition at line 144 of file IMX_Layer.h.

UT_Vector2D IMX_Layer::imageToPixel ( const UT_Vector2D v) const
inline

Image <-> Pixel.

Definition at line 150 of file IMX_Layer.h.

const UT_Vector2D& IMX_Layer::imageToPixelScale ( ) const
inline

Coordinate transforms.

Definition at line 130 of file IMX_Layer.h.

const UT_Vector2D& IMX_Layer::imageToPixelTranslate ( ) const
inline

Definition at line 131 of file IMX_Layer.h.

UT_Vector2D IMX_Layer::imageToTexture ( const UT_Vector2D v) const
inline

Definition at line 175 of file IMX_Layer.h.

UT_Matrix4D IMX_Layer::imageToWorldXform ( ) const
inline

Definition at line 119 of file IMX_Layer.h.

template<typename T >
void IMX_Layer::initFromVoxels ( const UT_VoxelArray< T > &  src,
bool  data_too 
)

Initializes this layer from a given voxel array. Number of channels in the image will be set to tuple size of T, and the data type will also be set accordingly. Z-resolution of src must be 1. If data_too is true, the data is also copied from the source array; otherwise, this layer is only appropriate formatted and sized to match the input.

UT_Matrix4D IMX_Layer::inverseCameraXform ( ) const

Transform from world space to camera space. Equal to invert(transform()).translate(-cameraPosition())

bool IMX_Layer::isOrtho ( ) const
inline

Definition at line 98 of file IMX_Layer.h.

bool IMX_Layer::isPerspective ( ) const
inline

Definition at line 99 of file IMX_Layer.h.

bool IMX_Layer::isPixelScale ( ) const
inline

Definition at line 139 of file IMX_Layer.h.

fpreal64 IMX_Layer::lensDiameter ( ) const
inline

Definition at line 103 of file IMX_Layer.h.

static IMX_LayerPtr IMX_Layer::load ( UT_IStream is)
static

Returns a newly created Layer loaded from the stream, or null if load failure.

static IMX_LayerPtr IMX_Layer::loadJSON ( UT_JSONParser p)
static
static IMX_LayerConstPtr IMX_Layer::lookupLayer ( int  handle)
static

Look up a registered layer by handle.

fpreal64 IMX_Layer::pixelAspectRatio ( ) const
inline

Distortion in image->pixel space transform.

Definition at line 85 of file IMX_Layer.h.

const UT_Vector2D& IMX_Layer::pixelScale ( ) const
inline

Definition at line 138 of file IMX_Layer.h.

UT_Vector2D IMX_Layer::pixelToBuffer ( const UT_Vector2D v) const
inline

Pixel <-> Buffer.

Definition at line 156 of file IMX_Layer.h.

UT_Vector2D IMX_Layer::pixelToImage ( const UT_Vector2D v) const
inline

Definition at line 152 of file IMX_Layer.h.

UT_Vector2D IMX_Layer::pixelToTexture ( const UT_Vector2D v) const
inline

Definition at line 183 of file IMX_Layer.h.

void IMX_Layer::preTransform ( const UT_Matrix4D m)
inline

Definition at line 276 of file IMX_Layer.h.

IMX_Projection IMX_Layer::projection ( ) const
inline

Camera.

Definition at line 97 of file IMX_Layer.h.

UT_Matrix4D IMX_Layer::projectionXform ( ) const

Transform from camera space to image space.

UT_Matrix4D IMX_Layer::projectionXformVk ( ) const

Transform from camera space to texture space for Vulkan rasterization.

int IMX_Layer::r ( ) const
inline

Definition at line 80 of file IMX_Layer.h.

static int IMX_Layer::registerLayer ( IMX_LayerConstPtr  layer,
UT_IntArray registered 
)
static

Layer registration to allow layers to be converted to integers across HOM boundaries. Registers & returns the handle, adding the handle to the registered list

UT_Vector2I IMX_Layer::rt ( ) const
inline

Definition at line 82 of file IMX_Layer.h.

bool IMX_Layer::save ( std::ostream &  os) const

Returns true for successful save.

bool IMX_Layer::saveJSON ( UT_JSONWriter w) const
void IMX_Layer::setAligned ( const IMX_Layer src)

Sets the buffer so isAligned(src) is true. Pretty much the same as copying the pixelScale but this will allow the buffer edges to not match the datawindow at all.

void IMX_Layer::setAperture ( fpreal64  mm)
inline

Definition at line 262 of file IMX_Layer.h.

void IMX_Layer::setApertureAspect ( int  n,
int  d 
)
inline

Set the aspect ratio of displayWindow exactly, centering the new displayWindow into the old one, two sides will be unchanged, others may be non-integers.

Definition at line 250 of file IMX_Layer.h.

void IMX_Layer::setApertureAspect ( fpreal64  a)
void IMX_Layer::setApertureCenter ( const UT_Vector2D p)
inline

Definition at line 264 of file IMX_Layer.h.

void IMX_Layer::setApertureOffset ( const UT_Vector2D p)
inline

Definition at line 263 of file IMX_Layer.h.

void IMX_Layer::setAttributes ( const UT_OptionsHolder attrib)
inline

Definition at line 320 of file IMX_Layer.h.

void IMX_Layer::setBaseTransform ( const UT_Matrix4D m)
inline

set the imageToWorld transform. This can be done at any time

Definition at line 274 of file IMX_Layer.h.

void IMX_Layer::setBufferSize ( int  w,
int  h 
)

One of these functions must be called after changing the display or dataWindow. This will correctly set up the buffer size and transformations. Directly set the buffer size. The bufferToPixel transform is set so this rectangle is mapped to the dataWindow. Note this overrides the IMX_Buffer method.

void IMX_Layer::setBufferToPixels ( )
inline

Make the buffer pixels match the pixels. Same as setPixelScale(1), or setBufferSize(width(), height())

Definition at line 297 of file IMX_Layer.h.

void IMX_Layer::setBufferToPixelScale ( const UT_Vector2D p)

Exactly set pixelScale, however upper-right pixels of buffer may go outside of the dataWindow. Values outside the range 1..width() are not recommended.

void IMX_Layer::setBufferToPixelTranslate ( const UT_Vector2D p)

Adjust the transform so the lower-left corner of the dataWindow and buffer don't match. This value is where the center of the lower-left buffer pixel is in pixel space.

void IMX_Layer::setBufferUVToWorldXform ( UT_Matrix4D  xform,
fpreal  taper 
)

Sets the world transform such that the given transformation becomes this layer's UV to world.

void IMX_Layer::setCameraPosition ( const UT_Vector3D p)
inline

Definition at line 259 of file IMX_Layer.h.

void IMX_Layer::setCameraZ ( fpreal64  z)
inline

Definition at line 260 of file IMX_Layer.h.

void IMX_Layer::setClippingRange ( const UT_Vector2D v)
inline

Definition at line 269 of file IMX_Layer.h.

void IMX_Layer::setDataWindow ( int  w,
int  h 
)
inline

Set both dataWindow and displayWindow to the same rectangle.

Definition at line 224 of file IMX_Layer.h.

void IMX_Layer::setDataWindow ( int  x,
int  y,
int  w,
int  h 
)
inline

Definition at line 225 of file IMX_Layer.h.

void IMX_Layer::setDataWindowOnly ( int  x,
int  y,
int  w,
int  h 
)
inline

Set dataWindow w/o changing displayWindow.

Definition at line 232 of file IMX_Layer.h.

void IMX_Layer::setDefault ( )

Modifications to layer metadata, in approximate order you call them.

reset metadata to default value

void IMX_Layer::setDisplayWindow ( int  w,
int  h 
)
inline

Set the displayWindow w/o changing dataWindow.

Definition at line 235 of file IMX_Layer.h.

void IMX_Layer::setDisplayWindow ( int  x,
int  y,
int  w,
int  h 
)
inline

Definition at line 236 of file IMX_Layer.h.

void IMX_Layer::setDisplayWindow ( const UT_Vector2D xy,
const UT_Vector2D wh 
)
inline

Definition at line 238 of file IMX_Layer.h.

void IMX_Layer::setFocalLength ( fpreal64  mm)
inline

Definition at line 266 of file IMX_Layer.h.

void IMX_Layer::setFocusDistance ( fpreal64  f)
inline

Definition at line 270 of file IMX_Layer.h.

void IMX_Layer::setFStop ( fpreal64  f)
inline

Definition at line 267 of file IMX_Layer.h.

void IMX_Layer::setImagingDist ( fpreal64  z)
void IMX_Layer::setInverseCameraXform ( const UT_Matrix4D m)

set the inverseCameraTransform which will set the transform. Using this avoids multiple inverts of the matrix to get the value back.

void IMX_Layer::setLensDiameter ( fpreal64  mm)
inline

Definition at line 268 of file IMX_Layer.h.

void IMX_Layer::setOrtho ( )
inline

Definition at line 257 of file IMX_Layer.h.

void IMX_Layer::setPerspective ( )
inline

Definition at line 258 of file IMX_Layer.h.

void IMX_Layer::setPixelAspectRatio ( fpreal64  pa)
inline

Set pixel aspect ratio. This must be done before setDataWindow.

Definition at line 221 of file IMX_Layer.h.

void IMX_Layer::setPixelScale ( const UT_Vector2D )

Set buffer size so each buffer pixel is approximately this many pixels. Value is adjusted down so the width() and height() are an integer number of buffer pixels. Very tiny numbers are clamped to a minimum.

void IMX_Layer::setProjection ( IMX_Projection  p)
inline

Definition at line 254 of file IMX_Layer.h.

void IMX_Layer::setShutter ( const UT_Vector2D v)
inline

Definition at line 271 of file IMX_Layer.h.

const UT_Vector2D& IMX_Layer::shutter ( ) const
inline

Definition at line 108 of file IMX_Layer.h.

int IMX_Layer::t ( ) const
inline

Definition at line 81 of file IMX_Layer.h.

UT_Vector2D IMX_Layer::textureToBuffer ( const UT_Vector2D v) const
inline

Definition at line 171 of file IMX_Layer.h.

UT_Vector2D IMX_Layer::textureToBufferScale ( ) const
inline

Definition at line 136 of file IMX_Layer.h.

UT_Vector2D IMX_Layer::textureToImage ( const UT_Vector2D v) const
inline

Definition at line 177 of file IMX_Layer.h.

UT_Vector2D IMX_Layer::textureToPixel ( const UT_Vector2D v) const
inline

Definition at line 181 of file IMX_Layer.h.

UT_Matrix4D IMX_Layer::transform ( ) const
inline

Definition at line 118 of file IMX_Layer.h.

void IMX_Layer::transform ( const UT_Matrix4D m)
inline

Definition at line 275 of file IMX_Layer.h.

static void IMX_Layer::unregisterLayers ( UT_IntArray registered)
static

Unregister all layers corresponding to the provided list, erase the list afterwards. Assertion if handle wasn't regsitered

template<typename OP >
void IMX_Layer::updateAttributes ( const OP &  op)
inline

Updates the contents of the attributes, first making sure it is unique. The provided operator should take a reference to a UT_Options that it will update. this->update([](UT_Options &opt) { opt.setOptionS("test", "bar"); });

Definition at line 330 of file IMX_Layer.h.

void IMX_Layer::updateMetadataFromOptions ( const UT_Options opt)

Load ourselves from the options, ignoring fields we don't know.

UT_Vector2I IMX_Layer::wh ( ) const
inline

Definition at line 79 of file IMX_Layer.h.

int IMX_Layer::width ( ) const
inline

Definition at line 77 of file IMX_Layer.h.

int IMX_Layer::x ( ) const
inline

Definition at line 74 of file IMX_Layer.h.

UT_Vector2I IMX_Layer::xy ( ) const
inline

Definition at line 76 of file IMX_Layer.h.

int IMX_Layer::y ( ) const
inline

Definition at line 75 of file IMX_Layer.h.


The documentation for this class was generated from the following file: