#include <HxVec2Int.h>
Constructors | |
| HxVec2Int () | |
| Default constructor. More... | |
| HxVec2Int (int x, int y) | |
| Conversion from native type. More... | |
| HxVec2Int (const HxVec2Int &v) | |
| Copy constructor. More... | |
Inquiry | |
| int | dim () const |
| Dimensionality. More... | |
| int | x () const |
| Value of first element. More... | |
| int | y () const |
| Value of second element. More... | |
| int | getValue (int dimension) const |
| Element in given dimension. More... | |
| void | setValue (int dimension, int value) |
Conversion | |
| operator HxScalarInt () const | |
| Cast to HxScalarInt. More... | |
| operator HxScalarDouble () const | |
| Cast to HxScalarDouble. More... | |
| operator HxVec2Double () const | |
| Cast to HxVec2Double. More... | |
| operator HxVec3Int () const | |
| Cast to HxVec3Int. More... | |
| operator HxVec3Double () const | |
| Cast to HxVec3Double. More... | |
| operator HxComplex () const | |
| Cast to HxComplex. More... | |
Operators | |
| Mathematical definition: Binary operations on pixel values | |
| int | operator== (const HxVec2Int &v) const |
| Equal. More... | |
| int | operator!= (const HxVec2Int &v) const |
| Not equal. More... | |
| int | operator< (const HxVec2Int &v) const |
| Less than. More... | |
| int | operator<= (const HxVec2Int &v) const |
| Less equal. More... | |
| int | operator> (const HxVec2Int &v) const |
| Greater than. More... | |
| int | operator>= (const HxVec2Int &v) const |
| Greater equal. More... | |
| const HxVec2Int | SMALL_VAL = HxVec2Int(0, 0) |
| A small value w.r.t to the comparison operators "<" and ">". More... | |
| const HxVec2Int | LARGE_VAL = HxVec2Int(200000000, 200000000) |
| A large value w.r.t to the comparison operators "<" and ">". More... | |
Unary operations | |
| Mathematical definition: Unary operations on pixel values | |
| HxVec2Int | operator- () const |
| Negation. More... | |
| HxVec2Int | complement () const |
| Complement. More... | |
| HxVec2Int | abs () const |
| Absolute value. More... | |
| HxVec2Int | ceil () const |
| Ceiling. More... | |
| HxVec2Int | floor () const |
| Floor. More... | |
| HxVec2Int | round () const |
| Round. More... | |
| HxScalarInt | sum () const |
| Sum. More... | |
| HxScalarInt | product () const |
| Product. More... | |
| HxScalarInt | min () const |
| Minimum. More... | |
| HxScalarInt | max () const |
| Maximum. More... | |
| HxScalarInt | norm1 () const |
| L1 norm. More... | |
| HxScalarDouble | norm2 () const |
| L2 norm. More... | |
| HxScalarInt | normInf () const |
| L infinity norm. More... | |
| HxVec2Double | sqrt () const |
| Square root. More... | |
| HxVec2Double | sin () const |
| Sine. More... | |
| HxVec2Double | cos () const |
| Cosine. More... | |
| HxVec2Double | tan () const |
| Tangent. More... | |
| HxVec2Double | asin () const |
| Arc sine. More... | |
| HxVec2Double | acos () const |
| Arc cosine. More... | |
| HxVec2Double | atan () const |
| Arc tangent. More... | |
| HxScalarDouble | atan2 () const |
| Arc tangent. More... | |
| HxVec2Double | sinh () const |
| Hyperbolic sine. More... | |
| HxVec2Double | cosh () const |
| Hyperbolic cosine. More... | |
| HxVec2Double | tanh () const |
| Hyperbolic tangent. More... | |
| HxVec2Double | exp () const |
| Exponent. More... | |
| HxVec2Double | log () const |
| Natural logarithm. More... | |
| HxVec2Double | log10 () const |
| Base 10 logarithm. More... | |
Binary operations | |
| Mathematical definition: Binary operations on pixel values | |
| HxVec2Int & | operator+= (const HxVec2Int &v) |
| Addition and assignment. More... | |
| HxVec2Int & | operator-= (const HxVec2Int &v) |
| Subtraction and assignment. More... | |
| HxVec2Int & | operator *= (const HxVec2Int &v) |
| Multiplication and assignment. More... | |
| HxVec2Int & | operator/= (const HxVec2Int &v) |
| Division and assignment. More... | |
| HxVec2Int | min (const HxVec2Int &v) const |
| Minimum. More... | |
| HxVec2Int & | minAssign (const HxVec2Int &v) |
| Minimum and assignment. More... | |
| HxVec2Int | max (const HxVec2Int &v) const |
| Maximum. More... | |
| HxVec2Int & | maxAssign (const HxVec2Int &v) |
| Maximum and assignment. More... | |
| HxVec2Int | inf (const HxVec2Int &v) const |
| Infimum. More... | |
| HxVec2Int & | infAssign (const HxVec2Int &v) |
| Infimum and assignment. More... | |
| HxVec2Int | sup (const HxVec2Int &v) const |
| Supremum. More... | |
| HxVec2Int & | supAssign (const HxVec2Int &v) |
| Supremum and assignment. More... | |
| HxVec2Int | pow (const HxVec2Int &v) const |
| Power. More... | |
| HxVec2Int | mod (const HxVec2Int &v) const |
| Modulo. More... | |
| HxVec2Int | and (const HxVec2Int &v) const |
| And. More... | |
| HxVec2Int | or (const HxVec2Int &v) const |
| Or. More... | |
| HxVec2Int | xor (const HxVec2Int &v) const |
| Xor. More... | |
| HxVec2Int | leftShift (const HxVec2Int &v) const |
| Left shift. More... | |
| HxVec2Int | rightShift (const HxVec2Int &v) const |
| Right shift. More... | |
| HxScalarInt | dot (const HxVec2Int &v) const |
| Dot product. More... | |
| HxVec2Int | cross (const HxVec2Int &v) const |
| Cross product. More... | |
| HxVec2Int | operator+ (const HxVec2Int &v1, const HxVec2Int &v2) |
| Addition. More... | |
| HxVec2Int | operator- (const HxVec2Int &v1, const HxVec2Int &v2) |
| Subtraction. More... | |
| HxVec2Int | operator * (const HxVec2Int &v1, const HxVec2Int &v2) |
| Multiplication. More... | |
| HxVec2Int | operator/ (const HxVec2Int &v1, const HxVec2Int &v2) |
| Division. More... | |
Output | |
| STD_OSTREAM & | put (STD_OSTREAM &os) const |
| Print value on stream. More... | |
| HxString | toString () const |
| Value as a string. More... | |
Public Methods | |
| void * | operator new (size_t, void *=0) |
|
|
Default constructor.
00319 {
00320 }
|
|
||||||||||||
|
Conversion from native type.
|
|
|
Copy constructor.
|
|
|
Dimensionality.
00344 {
00345 return 2;
00346 }
|
|
|
Value of first element.
00350 {
00351 return _values[0];
00352 }
|
|
|
Value of second element.
00356 {
00357 return _values[1];
00358 }
|
|
|
Element in given dimension.
00362 {
00363 return _values[dim - 1];
00364 }
|
|
|
Cast to HxScalarInt.
00026 {
00027 return _values[0];
00028 }
|
|
|
Cast to HxScalarDouble.
00031 {
00032 return (double) _values[0];
00033 }
|
|
|
Cast to HxVec2Double.
00036 {
00037 return HxVec2Double(_values[0], _values[1]);
00038 }
|
|
|
Cast to HxVec3Int.
00041 {
00042 return HxVec3Int(_values[0], _values[1], 0);
00043 }
|
|
|
Cast to HxVec3Double.
00046 {
00047 return HxVec3Double(_values[0], _values[1], 0);
00048 }
|
|
|
Cast to HxComplex.
00051 {
00052 return HxComplex(_values[0], _values[1]);
00053 }
|
|
|
Equal.
|
|
|
Not equal.
|
|
|
Less than.
|
|
|
Less equal.
|
|
|
Greater than.
|
|
|
Greater equal.
|
|
|
Negation.
00414 {
00415 return HxVec2Int(-_values[0], -_values[1]);
00416 }
|
|
|
Complement.
00420 {
00421 return HxVec2Int(~_values[0], ~_values[1]);
00422 }
|
|
|
Absolute value.
|
|
|
Ceiling.
00432 {
00433 return *this;
00434 }
|
|
|
Floor.
00438 {
00439 return *this;
00440 }
|
|
|
Round.
00444 {
00445 return *this;
00446 }
|
|
|
Sum.
00625 {
00626 return _values[0] + _values[1];
00627 }
|
|
|
Product.
00631 {
00632 return _values[0] * _values[1];
00633 }
|
|
|
Minimum.
00637 {
00638 return (_values[0] < _values[1]) ? _values[0] : _values[1];
00639 }
|
|
|
Maximum.
00643 {
00644 return (_values[0] > _values[1]) ? _values[0] : _values[1];
00645 }
|
|
|
L1 norm.
00057 {
00058 return ::abs(_values[0]) + ::abs(_values[1]);
00059 }
|
|
|
L2 norm.
00063 {
00064 return ::sqrt(double(_values[0])*_values[0] + double(_values[1])*_values[1]);
00065 }
|
|
|
L infinity norm.
00069 {
00070 return (::abs(_values[0]) > ::abs(_values[1])) ? ::abs(_values[0]) :
00071 ::abs(_values[1]);
00072 }
|
|
|
Square root.
00076 {
00077 return HxVec2Double(::sqrt(double(_values[0])), ::sqrt(double(_values[1])));
00078 }
|
|
|
Sine.
00082 {
00083 return HxVec2Double(::sin(double(_values[0])), ::sin(double(_values[1])));
00084 }
|
|
|
Cosine.
00088 {
00089 return HxVec2Double(::cos(double(_values[0])), ::cos(double(_values[1])));
00090 }
|
|
|
Tangent.
00094 {
00095 return HxVec2Double(::tan(double(_values[0])), ::tan(double(_values[1])));
00096 }
|
|
|
Arc sine.
00100 {
00101 return HxVec2Double(::asin(double(_values[0])), ::asin(double(_values[1])));
00102 }
|
|
|
Arc cosine.
00106 {
00107 return HxVec2Double(::acos(double(_values[0])), ::acos(double(_values[1])));
00108 }
|
|
|
Arc tangent.
00112 {
00113 return HxVec2Double(::atan(double(_values[0])), ::atan(double(_values[1])));
00114 }
|
|
|
Arc tangent.
00118 {
00119 return HxScalarDouble(::atan2(double(_values[0]), double(_values[1])));
00120 }
|
|
|
Hyperbolic sine.
00124 {
00125 return HxVec2Double(::sinh(double(_values[0])), ::sinh(double(_values[1])));
00126 }
|
|
|
Hyperbolic cosine.
00130 {
00131 return HxVec2Double(::cosh(double(_values[0])), ::cosh(double(_values[1])));
00132 }
|
|
|
Hyperbolic tangent.
00136 {
00137 return HxVec2Double(::tanh(double(_values[0])), ::tanh(double(_values[1])));
00138 }
|
|
|
Exponent.
00142 {
00143 return HxVec2Double(::exp(double(_values[0])), ::exp(double(_values[1])));
00144 }
|
|
|
Natural logarithm.
00148 {
00149 return HxVec2Double(::log(double(_values[0])), ::log(double(_values[1])));
00150 }
|
|
|
Base 10 logarithm.
00154 {
00155 return HxVec2Double(::log10(double(_values[0])), ::log10(double(_values[1])));
00156 }
|
|
|
Addition and assignment.
|
|
|
Subtraction and assignment.
|
|
|
Multiplication and assignment.
|
|
|
Division and assignment.
|
|
|
Minimum.
00510 {
00511 return (operator<(v)) ? (*this) : v;
00512 }
|
|
|
Minimum and assignment.
00516 {
00517 if (operator<(v))
00518 return *this;
00519 operator=(v);
00520 return *this;
00521 }
|
|
|
Maximum.
00525 {
00526 return (operator>(v)) ? (*this) : v;
00527 }
|
|
|
Maximum and assignment.
00531 {
00532 if (operator>(v))
00533 return *this;
00534 operator=(v);
00535 return *this;
00536 }
|
|
|
Infimum.
|
|
|
Infimum and assignment.
|
|
|
Supremum.
|
|
|
Supremum and assignment.
|
|
|
Power.
|
|
|
Modulo.
|
|
|
And.
|
|
|
Or.
|
|
|
Xor.
|
|
|
Left shift.
|
|
|
Right shift.
|
|
|
Dot product.
|
|
|
Cross product.
00619 {
00620 return HxVec2Int(0, 0);
00621 }
|
|
|
Print value on stream. For global operator<<
00166 {
00167 return os << "(" << _values[0] << "," << _values[1] << ")";
00168 }
|
|
|
Value as a string.
00171 {
00172 return HxString("(") + makeString(_values[0]) + ", "
00173 + makeString(_values[1]) + ")";
00174 }
|
|
||||||||||||
|
Addition.
|
|
||||||||||||
|
Subtraction.
|
|
||||||||||||
|
Multiplication.
|
|
||||||||||||
|
Division.
|
|
|
A small value w.r.t to the comparison operators "<" and ">". Not actually the minimum to avoid overflow. |
|
|
A large value w.r.t to the comparison operators "<" and ">". Not actually the maximum to avoid overflow. |
1.2.12 written by Dimitri van Heesch,
© 1997-2001