Unigine::Plugins::SpiderVision::WarpGridData Class
Header: | #include <plugins/Unigine/SpiderVision/UnigineSpiderVision.h> |
The object of this class stores the information on the warp grid — a set of points and their handles that create a mesh based on which the displayed image is reshaped.
Warping of the image is required to render the projected image on a distorted surface in such a way that it would look undistorted.
This object is accessible via the corresponding method of the ViewportData class.
The mask data are stored in the configuration file.
WarpGridData Class
枚举
VIEWPORT_FLIP_TYPE#
WARP_HANDLE_ROLE#
Members
void setGridSize ( int row, int column ) #
Sets the number of columns and rows on the warping grid.Arguments
- int row - Number of grid rows.
- int column - Number of grid columns.
void setPoint ( int x, int y, const Math::vec2 & point ) #
Sets the coordinates of the warping control point on the grid.Arguments
- int x - Position of the warping control point in the row, starting from 0 on the left.
- int y - Position of the warping control point in the column, starting from 0 at the bottom.
- const Math::vec2 & point - Screen-space coordinates of the point.
void setPoint ( int index, const Math::vec2 & point ) #
Sets the coordinates of the warping control point on the grid.Arguments
- int index - Warping control point index. The point with the 0 index is in the bottom left corner with the progression going upwards, and then to the next column bottom point.
- const Math::vec2 & point - Screen-space coordinates of the point.
Math::vec2 getPoint ( int x, int y ) const#
Returns the coordinates of the warping control point on the grid.Arguments
- int x - Position of the warping control point in the row, starting from 0 on the left.
- int y - Position of the warping control point in the column, starting from 0 at the bottom.
Return value
Screen-space coordinates of the point.Math::vec2 getPoint ( int index ) const#
Returns the coordinates of the warping control point on the grid.Arguments
- int index - Warping control point index. The point with the 0 index is in the bottom left corner with the progression going upwards, and then to the next column bottom point.
Return value
Screen-space coordinates of the point.void setPointHandle ( int x, int y, WarpGridData::WARP_HANDLE_ROLE type, const Math::vec2 & point ) #
Sets the type and position of the handle point for the specified warp grid point.Arguments
- int x - Position of the warping control point in the row, starting from 0 on the left.
- int y - Position of the warping control point in the column, starting from 0 at the bottom.
- WarpGridData::WARP_HANDLE_ROLE type - Type of control handle of the warping control point.
- const Math::vec2 & point - Screen-space coordinates of the point.
void setPointHandle ( int index, WarpGridData::WARP_HANDLE_ROLE type, const Math::vec2 & point ) #
Sets the type and position of the handle point for the specified warp grid point.Arguments
- int index - Warping control point index. The point with the 0 index is in the bottom left corner with the progression going upwards, and then to the next column bottom point.
- WarpGridData::WARP_HANDLE_ROLE type - Type of control handle of the warping control point.
- const Math::vec2 & point - Screen-space coordinates of the point.
Math::vec2 getPointHandle ( int x, int y, WarpGridData::WARP_HANDLE_ROLE type ) const#
Returns the type and position of the handle point for the specified warp grid point.Arguments
- int x - Position of the warping control point in the row, starting from 0 on the left.
- int y - Position of the warping control point in the column, starting from 0 at the bottom.
- WarpGridData::WARP_HANDLE_ROLE type - Type of control handle of the warping control point.
Return value
Screen-space coordinates of the point.Math::vec2 getPointHandle ( int index, WarpGridData::WARP_HANDLE_ROLE type ) const#
Returns the type and position of the handle point for the specified warp grid point.Arguments
- int index - Warping control point index. The point with the 0 index is in the bottom left corner with the progression going upwards, and then to the next column bottom point.
- WarpGridData::WARP_HANDLE_ROLE type - Type of control handle of the warping control point.
Return value
Screen-space coordinates of the point.void setPointHandleSmoothType ( int x, int y, ViewportData::POINT_SMOOTH_TYPE smooth_type ) #
Sets the type of line curving for the handle point of the specified warp grid point.Arguments
- int x - Position of the warping control point in the row, starting from 0 on the left.
- int y - Position of the warping control point in the column, starting from 0 at the bottom.
- ViewportData::POINT_SMOOTH_TYPE smooth_type - The type of line curving for the handle point.
void setPointHandleSmoothType ( int index, ViewportData::POINT_SMOOTH_TYPE smooth_type ) #
Sets the type of line curving for the handle point of the specified warp grid point.Arguments
- int index - Warping control point index. The point with the 0 index is in the bottom left corner with the progression going upwards, and then to the next column bottom point.
- ViewportData::POINT_SMOOTH_TYPE smooth_type - The type of line curving for the handle point.
ViewportData::POINT_SMOOTH_TYPE getPointHandleSmoothType ( int x, int y ) const#
Returns the type of line curving for the handle point of the specified warp grid point.Arguments
- int x - Position of the warping control point in the row, starting from 0 on the left.
- int y - Position of the warping control point in the column, starting from 0 at the bottom.
Return value
The type of line curving for the handle point.ViewportData::POINT_SMOOTH_TYPE getPointHandleSmoothType ( int index ) const#
Returns the type of line curving for the handle point of the specified warp grid point.Arguments
- int index - Warping control point index. The point with the 0 index is in the bottom left corner with the progression going upwards, and then to the next column bottom point.
Return value
The type of line curving for the handle point.void saveXml ( const Ptr<Xml> & xml ) #
Saves the warp grid data to the given instance of the Xml class.Arguments
bool restoreXml ( const Ptr<Xml> & xml ) #
Loads the warp grid data from the specified instance of the Xml class.Arguments
Return value
true if the data has been loaded successfully, otherwise false.void save ( const Ptr<Stream> & stream ) #
Saves the warp grid data to the specified stream.Arguments
void restore ( const Ptr<Stream> & stream ) #
Loads the warp grid data from the specified stream.Arguments
Last update:
2024-12-13
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)