ImFusion SDK 4.3
ImageTransformer Class Reference

#include <ImFusion/Reg/ImageTransformer.h>

The ImageTransformer class provides a generic way of transforming from the pixel coordinates of one image to the pixel coordinates of another image including any world transformations. More...

Detailed Description

The ImageTransformer class provides a generic way of transforming from the pixel coordinates of one image to the pixel coordinates of another image including any world transformations.

It also provides a GLSL shader include (see ImageTransformations.glh). Currently supports linear transformations (SharedImage::matrix) and deformations (SharedImage::deformation).

Public Member Functions

 ImageTransformer (SharedImage *img1, SharedImage *img2)
 Creates an ImageTransform to transfer from img1 pixel coordinates to img2 pixel coordinates.
 
void setImage1 (SharedImage *img)
 
SharedImageimage1 () const
 
void setImage2 (SharedImage *img)
 
SharedImageimage2 () const
 
vec3 getMovingCoord (vec3 img1PixelCoords) const
 Transforms the given pixel coordinates of img1 into pixel coordinates of img2.
 
void warpMoving (SharedImage *output, int device) const
 Samples img2 into output including any transformations.
 
SharedImagewarpMoving (int device) const
 Convenient method that creates a new image with the same size as img1 and calls warpMoving(SharedImage*, int)
 

Static Public Member Functions

static void initShaderInclude (const ImageTransformer *t, GL::Program *p)
 Initializes all uniforms required by the ImageTransformer.
 

Member Function Documentation

◆ initShaderInclude()

static void initShaderInclude ( const ImageTransformer * t,
GL::Program * p )
static

Initializes all uniforms required by the ImageTransformer.

If t is null, default values will be set. If you include the ImageTransformations.glh header, you should ALWAYS call this method, otherwise samplers in p and samplers in the header can collide! This method may trigger a rebuild of the shader which also resets all previous that uniforms. Therefore this method should be called right after the program is enabled and before any setUniform or other calls.

◆ warpMoving() [1/2]

void warpMoving ( SharedImage * output,
int device ) const

Samples img2 into output including any transformations.

TODO: for now output must have the same size as img1 TODO: device is ignored for now (always uses OpenGL)

◆ warpMoving() [2/2]

SharedImage * warpMoving ( int device) const

Convenient method that creates a new image with the same size as img1 and calls warpMoving(SharedImage*, int)

The created image will have the same type and number of channels as img1 but the extent of img1. The caller is responsable for deleting the returned image.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close