![]() |
ImFusion SDK 4.3
|
#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...
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) |
| SharedImage * | image1 () const |
| void | setImage2 (SharedImage *img) |
| SharedImage * | image2 () 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. | |
| SharedImage * | warpMoving (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. | |
|
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.
| 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)
| 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.