62 return ((row == r.row) && (col == r.col));
68 return ((row != r.row) || (col != r.col));
74 return Point (row + r.row
, col + r.col
);
80 return Point (row - r.row
, col - r.col
);
96 PointList::const_iterator idx;
97 for (idx = pointList.begin (); idx != pointList.end (); idx++)
99 PushOnBack (
new Point (*(*idx)));
117 minRow = minCol = 999999;
118 maxRow = maxCol = -1;
120 for (iterator x = begin (); x != end (); x++)
142 for (iterator x = begin (); x != end (); x++)
149 kkint32 centerRow = (kkint32)((
double)totalRow / (
double)size () + 0.5);
150 kkint32 centerCol = (kkint32)((
double)totalCol / (
double)size () + 0.5);
151 return Point (centerRow
, centerCol
);
158 if (QueueSize () < 1)
161 KKStr result (QueueSize () * 10);
164 PointList::const_iterator idx;
165 for (idx = begin (); idx != end (); ++idx, ++count)
186 char endPairChar = 0;
190 else if (nextCh ==
'(')
199 result->PushOnBack (
new Point (row, col));
202 if (endPairChar != 0)
219 result->PushOnBack (
new Point (row, col));
221 if ((nextCh ==
',') || (nextCh ==
'\n') || (nextCh ==
'\r') || (nextCh ==
'\t'))
237 if (QueueSize () < 1)
240 float totalLen = 0.0f;
247 while (idx != end ())
249 PointPtr nextPoint = *idx; ++idx;
251 float deltaHeight = (
float)(nextPoint->Row () - lastPoint->Row ()) * heightFactor;
252 float deltaWidth = (
float)(nextPoint->Col () - lastPoint->Col ()) * widthFactor;
254 float segmentLen = sqrt (deltaHeight * deltaHeight + deltaWidth * deltaWidth);
256 totalLen += segmentLen;
257 lastPoint = nextPoint;
269 left <<
"[" << right
.Row () <<
", " << right
.Col () <<
"]";
275 ostream&
KKB::operator<< (std::ostream& left,
__int16 kkint16
16 bit signed integer.
Point & operator=(const Point &r)
kkint32 Find(char c, kkint32 pos=0) const
PointList(const PointList &pointList)
Point operator+(const Point &r) const
KKStr & operator=(const char *src)
static PointListPtr FromDelStr(const KKStr &s)
bool operator!=(const Point &r) const
float ComputeSegmentLens(float heightFactor, float widthFactor) const
Point(float _row, float _col)
KKStr & operator=(KKStr &&src)
Used by Raster class and MorphOp derived classes to denote a single pixel location in Raster image...
kkuint32 Len() const
Returns the number of characters in the string.
KKStr(const KKStr &str)
Copy Constructor.
void TrimLeft(const char *whiteSpaceChars="\n\r\t ")
KKStr SubStrPart(kkint32 firstChar, kkint32 lastChar) const
returns a SubString consisting of all characters starting at index 'firstChar' and ending at 'lastInd...
KKStr ToDelStr(char del) const
static KKStr Concat(const std::vector< std::string > &values)
Concatenates the list of 'std::string' strings.
Point(const Point &point)
std::ostream &__cdecl operator<<(std::ostream &os, const KKStr &str)
kkint32 ExtractTokenInt(const char *delStr)
Point(kkint32 _row, kkint32 _col)
Point CalculateCenterPoint()
Point operator-(const Point &r) const
KKStr & operator=(const KKStr &src)
Container object used to maintaining a list of pixel locations.
void BoxCoordinites(kkint32 &minRow, kkint32 &minCol, kkint32 &maxRow, kkint32 &maxCol)
Point(kkint16 _row, kkint16 _col)
KKStr SubStrPart(kkint32 firstChar) const
returns a SubString consisting of all characters starting at index 'firstChar' until the end of the s...
bool operator==(Point &r) const