Krita Source Code Documentation
Loading...
Searching...
No Matches
GridIterationTools::CellOp< ProcessPolygon, ForwardTransform > Struct Template Reference

#include <kis_grid_interpolation_tools.h>

Public Member Functions

 CellOp (ProcessPolygon &_polygonOp, ForwardTransform &_transformOp)
 
void nextLine ()
 
void processPoint (int col, int row, int prevCol, int prevRow, int colIndex, int rowIndex)
 

Public Attributes

QVector< QPointF > currLinePoints
 
ProcessPolygon & polygonOp
 
QVector< QPointF > prevLinePoints
 
ForwardTransform & transformOp
 

Detailed Description

template<class ProcessPolygon, class ForwardTransform>
struct GridIterationTools::CellOp< ProcessPolygon, ForwardTransform >

Definition at line 55 of file kis_grid_interpolation_tools.h.

Constructor & Destructor Documentation

◆ CellOp()

template<class ProcessPolygon , class ForwardTransform >
GridIterationTools::CellOp< ProcessPolygon, ForwardTransform >::CellOp ( ProcessPolygon & _polygonOp,
ForwardTransform & _transformOp )
inline

Definition at line 57 of file kis_grid_interpolation_tools.h.

58 : polygonOp(_polygonOp),
59 transformOp(_transformOp)
60 {
61 }

Member Function Documentation

◆ nextLine()

template<class ProcessPolygon , class ForwardTransform >
void GridIterationTools::CellOp< ProcessPolygon, ForwardTransform >::nextLine ( )
inline

Definition at line 90 of file kis_grid_interpolation_tools.h.

90 {
92
93 // we are erasing elements for not freeing the occupied
94 // memory, which is more efficient since we are going to fill
95 // the vector again
96 currLinePoints.erase(currLinePoints.begin(), currLinePoints.end());
97 }

References GridIterationTools::CellOp< ProcessPolygon, ForwardTransform >::currLinePoints, and GridIterationTools::CellOp< ProcessPolygon, ForwardTransform >::prevLinePoints.

◆ processPoint()

template<class ProcessPolygon , class ForwardTransform >
void GridIterationTools::CellOp< ProcessPolygon, ForwardTransform >::processPoint ( int col,
int row,
int prevCol,
int prevRow,
int colIndex,
int rowIndex )
inline

Definition at line 63 of file kis_grid_interpolation_tools.h.

65 {
66
67 QPointF dstPosF = transformOp(QPointF(col, row));
68 currLinePoints << dstPosF;
69
70 if (rowIndex >= 1 && colIndex >= 1) {
71 QPolygonF srcPolygon;
72
73 srcPolygon << QPointF(prevCol, prevRow);
74 srcPolygon << QPointF(col, prevRow);
75 srcPolygon << QPointF(col, row);
76 srcPolygon << QPointF(prevCol, row);
77
78 QPolygonF dstPolygon;
79
80 dstPolygon << prevLinePoints.at(colIndex - 1);
81 dstPolygon << prevLinePoints.at(colIndex);
82 dstPolygon << currLinePoints.at(colIndex);
83 dstPolygon << currLinePoints.at(colIndex - 1);
84
85 polygonOp(srcPolygon, dstPolygon);
86 }
87
88 }

References GridIterationTools::CellOp< ProcessPolygon, ForwardTransform >::currLinePoints, GridIterationTools::CellOp< ProcessPolygon, ForwardTransform >::polygonOp, GridIterationTools::CellOp< ProcessPolygon, ForwardTransform >::prevLinePoints, and GridIterationTools::CellOp< ProcessPolygon, ForwardTransform >::transformOp.

Member Data Documentation

◆ currLinePoints

template<class ProcessPolygon , class ForwardTransform >
QVector<QPointF> GridIterationTools::CellOp< ProcessPolygon, ForwardTransform >::currLinePoints

Definition at line 100 of file kis_grid_interpolation_tools.h.

◆ polygonOp

template<class ProcessPolygon , class ForwardTransform >
ProcessPolygon& GridIterationTools::CellOp< ProcessPolygon, ForwardTransform >::polygonOp

Definition at line 101 of file kis_grid_interpolation_tools.h.

◆ prevLinePoints

template<class ProcessPolygon , class ForwardTransform >
QVector<QPointF> GridIterationTools::CellOp< ProcessPolygon, ForwardTransform >::prevLinePoints

Definition at line 99 of file kis_grid_interpolation_tools.h.

◆ transformOp

template<class ProcessPolygon , class ForwardTransform >
ForwardTransform& GridIterationTools::CellOp< ProcessPolygon, ForwardTransform >::transformOp

Definition at line 102 of file kis_grid_interpolation_tools.h.


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