Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

HxVec2Int Class Reference

Class definition vector of 2 integers. More...

#include <HxVec2Int.h>

List of all members.

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)


Detailed Description

Class definition vector of 2 integers.


Constructor & Destructor Documentation

HxVec2Int::HxVec2Int   [inline]
 

Default constructor.

00319 { 
00320 }

HxVec2Int::HxVec2Int int    x,
int    y
[inline]
 

Conversion from native type.

00324 {
00325     _values[0] = x;
00326     _values[1] = y;
00327 }

HxVec2Int::HxVec2Int const HxVec2Int &    v [inline]
 

Copy constructor.

00331 {
00332     _values[0] = v._values[0];
00333     _values[1] = v._values[1];
00334 }


Member Function Documentation

int HxVec2Int::dim   const [inline]
 

Dimensionality.

00344 { 
00345     return 2;
00346 }

int HxVec2Int::x   const [inline]
 

Value of first element.

00350 { 
00351     return _values[0]; 
00352 }

int HxVec2Int::y   const [inline]
 

Value of second element.

00356 { 
00357     return _values[1]; 
00358 }

int HxVec2Int::getValue int    dim const [inline]
 

Element in given dimension.

00362 { 
00363     return _values[dim - 1]; 
00364 }

HxVec2Int::operator HxScalarInt   const
 

Cast to HxScalarInt.

00026 {
00027     return _values[0];
00028 }

HxVec2Int::operator HxScalarDouble   const
 

Cast to HxScalarDouble.

00031 {
00032     return (double) _values[0];
00033 }

HxVec2Int::operator HxVec2Double   const
 

Cast to HxVec2Double.

00036 {
00037     return HxVec2Double(_values[0], _values[1]);
00038 }

HxVec2Int::operator HxVec3Int   const
 

Cast to HxVec3Int.

00041 {
00042     return HxVec3Int(_values[0], _values[1], 0);
00043 }

HxVec2Int::operator HxVec3Double   const
 

Cast to HxVec3Double.

00046 {
00047     return HxVec3Double(_values[0], _values[1], 0);
00048 }

HxVec2Int::operator HxComplex   const
 

Cast to HxComplex.

00051 {
00052     return HxComplex(_values[0], _values[1]);
00053 }

int HxVec2Int::operator== const HxVec2Int &    v const [inline]
 

Equal.

00374 {
00375     return (_values[0] == v._values[0]) && (_values[1] == v._values[1]);
00376 }

int HxVec2Int::operator!= const HxVec2Int &    v const [inline]
 

Not equal.

00380 {
00381     return (_values[0] != v._values[0]) || (_values[1] != v._values[1]);
00382 }

int HxVec2Int::operator< const HxVec2Int &    v const [inline]
 

Less than.

00386 {
00387     return (::abs(_values[0]) + ::abs(_values[1])) < 
00388            (::abs(v._values[0]) + ::abs(v._values[1]));
00389 }

int HxVec2Int::operator<= const HxVec2Int &    v const [inline]
 

Less equal.

00393 {
00394     return (::abs(_values[0]) + ::abs(_values[1])) <=
00395            (::abs(v._values[0]) + ::abs(v._values[1]));
00396 }

int HxVec2Int::operator> const HxVec2Int &    v const [inline]
 

Greater than.

00400 {
00401     return (::abs(_values[0]) + ::abs(_values[1])) >
00402            (::abs(v._values[0]) + ::abs(v._values[1]));
00403 }

int HxVec2Int::operator>= const HxVec2Int &    v const [inline]
 

Greater equal.

00407 {
00408     return (::abs(_values[0]) + ::abs(_values[1])) >=
00409            (::abs(v._values[0]) + ::abs(v._values[1]));
00410 }

HxVec2Int HxVec2Int::operator-   const [inline]
 

Negation.

00414 {
00415     return HxVec2Int(-_values[0], -_values[1]);
00416 }

HxVec2Int HxVec2Int::complement   const [inline]
 

Complement.

00420 {
00421     return HxVec2Int(~_values[0], ~_values[1]);
00422 }

HxVec2Int HxVec2Int::abs   const [inline]
 

Absolute value.

00426 {
00427     return HxVec2Int(::abs(_values[0]), ::abs(_values[1]));
00428 }

HxVec2Int HxVec2Int::ceil   const [inline]
 

Ceiling.

00432 {
00433     return *this;
00434 }

HxVec2Int HxVec2Int::floor   const [inline]
 

Floor.

00438 {
00439     return *this;
00440 }

HxVec2Int HxVec2Int::round   const [inline]
 

Round.

00444 {
00445     return *this;
00446 }

HxScalarInt HxVec2Int::sum   const [inline]
 

Sum.

00625 {
00626     return _values[0] + _values[1];
00627 }

HxScalarInt HxVec2Int::product   const [inline]
 

Product.

00631 {
00632     return _values[0] * _values[1];
00633 }

HxScalarInt HxVec2Int::min   const [inline]
 

Minimum.

00637 {
00638     return (_values[0] < _values[1]) ? _values[0] : _values[1];
00639 }

HxScalarInt HxVec2Int::max   const [inline]
 

Maximum.

00643 {
00644     return (_values[0] > _values[1]) ? _values[0] : _values[1];
00645 }

HxScalarInt HxVec2Int::norm1   const
 

L1 norm.

00057 {
00058     return ::abs(_values[0]) + ::abs(_values[1]);
00059 }

HxScalarDouble HxVec2Int::norm2   const
 

L2 norm.

00063 {
00064     return ::sqrt(double(_values[0])*_values[0] + double(_values[1])*_values[1]);
00065 }

HxScalarInt HxVec2Int::normInf   const
 

L infinity norm.

00069 {
00070     return (::abs(_values[0]) > ::abs(_values[1])) ? ::abs(_values[0]) :
00071                                                      ::abs(_values[1]);
00072 }

HxVec2Double HxVec2Int::sqrt   const
 

Square root.

00076 {
00077     return HxVec2Double(::sqrt(double(_values[0])), ::sqrt(double(_values[1])));
00078 }

HxVec2Double HxVec2Int::sin   const
 

Sine.

00082 {
00083     return HxVec2Double(::sin(double(_values[0])), ::sin(double(_values[1])));
00084 }

HxVec2Double HxVec2Int::cos   const
 

Cosine.

00088 {
00089     return HxVec2Double(::cos(double(_values[0])), ::cos(double(_values[1])));
00090 }

HxVec2Double HxVec2Int::tan   const
 

Tangent.

00094 {
00095     return HxVec2Double(::tan(double(_values[0])), ::tan(double(_values[1])));
00096 }

HxVec2Double HxVec2Int::asin   const
 

Arc sine.

00100 {
00101     return HxVec2Double(::asin(double(_values[0])), ::asin(double(_values[1])));
00102 }

HxVec2Double HxVec2Int::acos   const
 

Arc cosine.

00106 {
00107     return HxVec2Double(::acos(double(_values[0])), ::acos(double(_values[1])));
00108 }

HxVec2Double HxVec2Int::atan   const
 

Arc tangent.

00112 {
00113     return HxVec2Double(::atan(double(_values[0])), ::atan(double(_values[1])));
00114 }

HxScalarDouble HxVec2Int::atan2   const
 

Arc tangent.

00118 {
00119     return HxScalarDouble(::atan2(double(_values[0]), double(_values[1])));
00120 }

HxVec2Double HxVec2Int::sinh   const
 

Hyperbolic sine.

00124 {
00125     return HxVec2Double(::sinh(double(_values[0])), ::sinh(double(_values[1])));
00126 }

HxVec2Double HxVec2Int::cosh   const
 

Hyperbolic cosine.

00130 {
00131     return HxVec2Double(::cosh(double(_values[0])), ::cosh(double(_values[1])));
00132 }

HxVec2Double HxVec2Int::tanh   const
 

Hyperbolic tangent.

00136 {
00137     return HxVec2Double(::tanh(double(_values[0])), ::tanh(double(_values[1])));
00138 }

HxVec2Double HxVec2Int::exp   const
 

Exponent.

00142 {
00143     return HxVec2Double(::exp(double(_values[0])), ::exp(double(_values[1])));
00144 }

HxVec2Double HxVec2Int::log   const
 

Natural logarithm.

00148 {
00149     return HxVec2Double(::log(double(_values[0])), ::log(double(_values[1])));
00150 }

HxVec2Double HxVec2Int::log10   const
 

Base 10 logarithm.

00154 {
00155     return HxVec2Double(::log10(double(_values[0])), ::log10(double(_values[1])));
00156 }

HxVec2Int & HxVec2Int::operator+= const HxVec2Int &    v [inline]
 

Addition and assignment.

00450 {
00451     _values[0] += v._values[0];
00452     _values[1] += v._values[1];
00453     return *this;
00454 }

HxVec2Int & HxVec2Int::operator-= const HxVec2Int &    v [inline]
 

Subtraction and assignment.

00458 {
00459     _values[0] -= v._values[0];
00460     _values[1] -= v._values[1];
00461     return *this;
00462 }

HxVec2Int & HxVec2Int::operator *= const HxVec2Int &    v [inline]
 

Multiplication and assignment.

00466 {
00467     _values[0] *= v._values[0];
00468     _values[1] *= v._values[1];
00469     return *this;
00470 }

HxVec2Int & HxVec2Int::operator/= const HxVec2Int &    v [inline]
 

Division and assignment.

00474 {
00475     _values[0] /= v._values[0];
00476     _values[1] /= v._values[1];
00477     return *this;
00478 }

HxVec2Int HxVec2Int::min const HxVec2Int &    v const [inline]
 

Minimum.

00510 {
00511     return (operator<(v)) ? (*this) : v;
00512 }

HxVec2Int & HxVec2Int::minAssign const HxVec2Int &    v [inline]
 

Minimum and assignment.

00516 {
00517     if (operator<(v))
00518         return *this;
00519     operator=(v);
00520     return *this;
00521 }

HxVec2Int HxVec2Int::max const HxVec2Int &    v const [inline]
 

Maximum.

00525 {
00526     return (operator>(v)) ? (*this) : v;
00527 }

HxVec2Int & HxVec2Int::maxAssign const HxVec2Int &    v [inline]
 

Maximum and assignment.

00531 {
00532     if (operator>(v))
00533         return *this;
00534     operator=(v);
00535     return *this;
00536 }

HxVec2Int HxVec2Int::inf const HxVec2Int &    v const [inline]
 

Infimum.

00540 {
00541     return HxVec2Int((_values[0] < v._values[0]) ? _values[0] : v._values[0],
00542                      (_values[1] < v._values[1]) ? _values[1] : v._values[1]);
00543 }

HxVec2Int & HxVec2Int::infAssign const HxVec2Int &    v [inline]
 

Infimum and assignment.

00547 {
00548     _values[0] = (_values[0] < v._values[0]) ? _values[0] : v._values[0];
00549     _values[1] = (_values[1] < v._values[1]) ? _values[1] : v._values[1];
00550     return *this;
00551 }

HxVec2Int HxVec2Int::sup const HxVec2Int &    v const [inline]
 

Supremum.

00555 {
00556     return HxVec2Int((_values[0] > v._values[0]) ? _values[0] : v._values[0],
00557                      (_values[1] > v._values[1]) ? _values[1] : v._values[1]);
00558 }

HxVec2Int & HxVec2Int::supAssign const HxVec2Int &    v [inline]
 

Supremum and assignment.

00562 {
00563     _values[0] = (_values[0] > v._values[0]) ? _values[0] : v._values[0];
00564     _values[1] = (_values[1] > v._values[1]) ? _values[1] : v._values[1];
00565     return *this;
00566 }

HxVec2Int HxVec2Int::pow const HxVec2Int &    v const [inline]
 

Power.

00570 {
00571     return HxVec2Int((int) (::pow(_values[0], v._values[0]) + 0.5),
00572                      (int) (::pow(_values[1], v._values[1]) + 0.5));
00573 }

HxVec2Int HxVec2Int::mod const HxVec2Int &    v const [inline]
 

Modulo.

00577 {
00578     return HxVec2Int(_values[0] % v._values[0],
00579                      _values[1] % v._values[1]);
00580 }

HxVec2Int HxVec2Int::and const HxVec2Int &    v const [inline]
 

And.

00584 {
00585     return HxVec2Int(_values[0] & v._values[0],
00586                      _values[1] & v._values[1]);
00587 }

HxVec2Int HxVec2Int::or const HxVec2Int &    v const [inline]
 

Or.

00591 {
00592     return HxVec2Int(_values[0] | v._values[0],
00593                      _values[1] | v._values[1]);
00594 }

HxVec2Int HxVec2Int::xor const HxVec2Int &    v const [inline]
 

Xor.

00598 {
00599     return HxVec2Int(_values[0] ^ v._values[0],
00600                      _values[1] ^ v._values[1]);
00601 }

HxVec2Int HxVec2Int::leftShift const HxVec2Int &    v const [inline]
 

Left shift.

00605 {
00606     return HxVec2Int(_values[0] << v._values[0],
00607                      _values[1] << v._values[1]);
00608 }

HxVec2Int HxVec2Int::rightShift const HxVec2Int &    v const [inline]
 

Right shift.

00612 {
00613     return HxVec2Int(_values[0] >> v._values[0],
00614                      _values[1] >> v._values[1]);
00615 }

HxScalarInt HxVec2Int::dot const HxVec2Int &    v const
 

Dot product.

00160 {
00161     return (_values[0] * v._values[0]) + (_values[1] * v._values[1]);
00162 }

HxVec2Int HxVec2Int::cross const HxVec2Int &    v const [inline]
 

Cross product.

00619 {
00620     return HxVec2Int(0, 0);
00621 }

STD_OSTREAM & HxVec2Int::put STD_OSTREAM &    os const
 

Print value on stream.

For global operator<<

00166 {
00167     return os << "(" << _values[0] << "," << _values[1] << ")";
00168 }

HxString HxVec2Int::toString   const
 

Value as a string.

00171                           {
00172     return HxString("(") + makeString(_values[0]) + ", "
00173             + makeString(_values[1]) + ")";
00174 }


Friends And Related Function Documentation

HxVec2Int operator+ const HxVec2Int &    v1,
const HxVec2Int &    v2
[friend]
 

Addition.

00482 {
00483     return HxVec2Int(v1._values[0] + v2._values[0],
00484                      v1._values[1] + v2._values[1]);
00485 }

HxVec2Int operator- const HxVec2Int &    v1,
const HxVec2Int &    v2
[friend]
 

Subtraction.

00489 {
00490     return HxVec2Int(v1._values[0] - v2._values[0],
00491                      v1._values[1] - v2._values[1]);
00492 }

HxVec2Int operator * const HxVec2Int &    v1,
const HxVec2Int &    v2
[friend]
 

Multiplication.

00496 {
00497     return HxVec2Int(v1._values[0] * v2._values[0],
00498                      v1._values[1] * v2._values[1]);
00499 }

HxVec2Int operator/ const HxVec2Int &    v1,
const HxVec2Int &    v2
[friend]
 

Division.

00503 {
00504     return HxVec2Int(v1._values[0] / v2._values[0],
00505                      v1._values[1] / v2._values[1]);
00506 }


Member Data Documentation

const HxVec2Int HxVec2Int::SMALL_VAL = HxVec2Int(0, 0) [static]
 

A small value w.r.t to the comparison operators "<" and ">".

Not actually the minimum to avoid overflow.

const HxVec2Int HxVec2Int::LARGE_VAL = HxVec2Int(200000000, 200000000) [static]
 

A large value w.r.t to the comparison operators "<" and ">".

Not actually the maximum to avoid overflow.


The documentation for this class was generated from the following files:
Generated on Mon Jan 27 15:49:11 2003 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001