Point2D< T > Class Template Reference

This is a basic class to encode 2D integer coordinates. More...

#include <Image/Point2D.H>

Collaboration diagram for Point2D< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Point2D ()
 The default constructor initializes the coordinates to (0,0).
 Point2D (const T ii, const T jj)
 Initialize the Point2D from horizontal & vertical coordinates.
 Point2D (const Dims &d)
 Initialize from a Dims object; i=w, j=h.
template<class U >
 Point2D (const Point2D< U > &a)
 Explicit conversion from type T to another type U.
Point2D< T > & operator+= (const Point2D< T > &p)
 += operator
Point2D< T > & operator-= (const Point2D< T > &p)
 -= operator
Point2D< T > & operator*= (const Point2D< T > &p)
 *= operator
Point2D< T > & operator/= (const Point2D< T > &p)
 /= operator
template<class U >
Point2D< typename
promote_trait< T, U >::TP > 
operator+ (const Point2D< U > &p) const
 + operator
template<class U >
Point2D< typename
promote_trait< T, U >::TP > 
operator- (const Point2D< U > &p) const
 
  • operator

template<class U >
Point2D< typename
promote_trait< T, U >::TP > 
operator* (const Point2D< U > &p) const
 * operator
template<class U >
Point2D< typename
promote_trait< T, U >::TP > 
operator/ (const Point2D< U > &p) const
 / operator
Point2D< T > & operator+= (const T val)
 += operator
Point2D< T > & operator-= (const T val)
 -= operator
Point2D< T > & operator*= (const T val)
 *= operator
Point2D< T > & operator/= (const T val)
 /= operator
template<class U >
Point2D< typename
promote_trait< T, U >::TP > 
operator+ (const U val) const
 + operator
template<class U >
Point2D< typename
promote_trait< T, U >::TP > 
operator- (const U val) const
 
  • operator

template<class U >
Point2D< typename
promote_trait< T, U >::TP > 
operator* (const U val) const
 * operator
template<class U >
Point2D< typename
promote_trait< T, U >::TP > 
operator/ (const U val) const
 / operator
bool isValid () const
 test whether i and j are both positive
promote_trait< T, float >::TP squdist (const Point2D< T > &p) const
 the square of the euclidean distance
promote_trait< T, float >::TP distance (const Point2D< T > &p) const
 the euclidean distance from p
promote_trait< T, float >::TP magnitude () const
 the Magnitude
promote_trait< T, float >::TP distanceToLine (const Point2D< T > &p, const Point2D< T > &q, const bool getsigned=false) const
 the euclidean distance from line pq
promote_trait< T, float >::TP distanceToSegment (const Point2D< T > &p, const Point2D< T > &q) const
 the euclidean distance from segment pq
void clampToDims (const Dims &dims)
 clamp the coords such that the point fits into image of dimensions dims

Public Attributes

i
 2D coordinates
j

Detailed Description

template<class T>
class Point2D< T >

This is a basic class to encode 2D integer coordinates.

This is a completely public class whose goal is just to provide a shorthand notation for 2D integer coordinates.

Definition at line 53 of file Point2D.H.


Constructor & Destructor Documentation

template<class T >
Point2D< T >::Point2D (  )  [inline]

The default constructor initializes the coordinates to (0,0).

Definition at line 209 of file Point2D.H.

References Point2D< T >::i.

template<class T>
Point2D< T >::Point2D ( const T  ii,
const T  jj 
) [inline]

Initialize the Point2D from horizontal & vertical coordinates.

Definition at line 214 of file Point2D.H.

References Point2D< T >::i.

template<class T>
Point2D< T >::Point2D ( const Dims d  )  [inline, explicit]

Initialize from a Dims object; i=w, j=h.

Definition at line 219 of file Point2D.H.

References Dims::h(), Point2D< T >::i, and Dims::w().

template<class T >
template<class U >
Point2D< T >::Point2D ( const Point2D< U > &  a  )  [inline, explicit]

Explicit conversion from type T to another type U.

Note that this simply uses clamped_convert, so it will clamp coordinates to the available range of T, and may round down.

Definition at line 225 of file Point2D.H.


Member Function Documentation

template<class T >
void Point2D< T >::clampToDims ( const Dims dims  )  [inline]

clamp the coords such that the point fits into image of dimensions dims

Definition at line 399 of file Point2D.H.

References Dims::h(), Point2D< T >::i, Dims::isEmpty(), and Dims::w().

Referenced by FrictionSaccadeController::computeWhenNewDecision(), and SimulationViewerCompress::getTraj().

template<class T>
promote_trait< T, float >::TP Point2D< T >::distance ( const Point2D< T > &  p  )  const [inline]
template<class T>
promote_trait< T, float >::TP Point2D< T >::distanceToLine ( const Point2D< T > &  p,
const Point2D< T > &  q,
const bool  getsigned = false 
) const [inline]

the euclidean distance from line pq

Definition at line 375 of file Point2D.H.

References Point2D< T >::i, and sqrt().

Referenced by Point2D< T >::distanceToSegment().

template<class T>
promote_trait< T, float >::TP Point2D< T >::distanceToSegment ( const Point2D< T > &  p,
const Point2D< T > &  q 
) const [inline]

the euclidean distance from segment pq

Definition at line 388 of file Point2D.H.

References Point2D< T >::distance(), Point2D< T >::distanceToLine(), and Point2D< T >::i.

template<class T >
bool Point2D< T >::isValid (  )  const [inline]
template<class T >
promote_trait< T, float >::TP Point2D< T >::magnitude (  )  const [inline]

the Magnitude

Definition at line 369 of file Point2D.H.

References Point2D< T >::i, and sqrt().

template<class T >
template<class U >
Point2D< typename promote_trait< T, U >::TP > Point2D< T >::operator* ( const U  val  )  const [inline]

* operator

Definition at line 315 of file Point2D.H.

References Point2D< T >::i.

template<class T >
template<class U >
Point2D< typename promote_trait< T, U >::TP > Point2D< T >::operator* ( const Point2D< U > &  p  )  const [inline]

* operator

Definition at line 267 of file Point2D.H.

References Point2D< T >::i.

template<class T>
Point2D< T > & Point2D< T >::operator*= ( const T  val  )  [inline]

*= operator

Definition at line 289 of file Point2D.H.

References Point2D< T >::i.

template<class T>
Point2D< T > & Point2D< T >::operator*= ( const Point2D< T > &  p  )  [inline]

*= operator

Definition at line 241 of file Point2D.H.

References Point2D< T >::i.

template<class T >
template<class U >
Point2D< typename promote_trait< T, U >::TP > Point2D< T >::operator+ ( const U  val  )  const [inline]

+ operator

Definition at line 301 of file Point2D.H.

References Point2D< T >::i.

template<class T >
template<class U >
Point2D< typename promote_trait< T, U >::TP > Point2D< T >::operator+ ( const Point2D< U > &  p  )  const [inline]

+ operator

Definition at line 253 of file Point2D.H.

References Point2D< T >::i.

template<class T>
Point2D< T > & Point2D< T >::operator+= ( const T  val  )  [inline]

+= operator

Definition at line 279 of file Point2D.H.

References Point2D< T >::i.

template<class T>
Point2D< T > & Point2D< T >::operator+= ( const Point2D< T > &  p  )  [inline]

+= operator

Definition at line 231 of file Point2D.H.

References Point2D< T >::i.

template<class T >
template<class U >
Point2D< typename promote_trait< T, U >::TP > Point2D< T >::operator- ( const U  val  )  const [inline]

  • operator

Definition at line 308 of file Point2D.H.

References Point2D< T >::i.

template<class T >
template<class U >
Point2D< typename promote_trait< T, U >::TP > Point2D< T >::operator- ( const Point2D< U > &  p  )  const [inline]

  • operator

Definition at line 260 of file Point2D.H.

References Point2D< T >::i.

template<class T>
Point2D< T > & Point2D< T >::operator-= ( const T  val  )  [inline]

-= operator

Definition at line 284 of file Point2D.H.

References Point2D< T >::i.

template<class T>
Point2D< T > & Point2D< T >::operator-= ( const Point2D< T > &  p  )  [inline]

-= operator

Definition at line 236 of file Point2D.H.

References Point2D< T >::i.

template<class T >
template<class U >
Point2D< typename promote_trait< T, U >::TP > Point2D< T >::operator/ ( const U  val  )  const [inline]

/ operator

Definition at line 322 of file Point2D.H.

References Point2D< T >::i.

template<class T >
template<class U >
Point2D< typename promote_trait< T, U >::TP > Point2D< T >::operator/ ( const Point2D< U > &  p  )  const [inline]

/ operator

Definition at line 274 of file Point2D.H.

References Point2D< T >::i.

template<class T>
Point2D< T > & Point2D< T >::operator/= ( const T  val  )  [inline]

/= operator

Definition at line 294 of file Point2D.H.

References Point2D< T >::i.

template<class T>
Point2D< T > & Point2D< T >::operator/= ( const Point2D< T > &  p  )  [inline]

/= operator

Definition at line 246 of file Point2D.H.

References Point2D< T >::i.

template<class T>
promote_trait< T, float >::TP Point2D< T >::squdist ( const Point2D< T > &  p  )  const [inline]

the square of the euclidean distance

Definition at line 353 of file Point2D.H.

References Point2D< T >::i.

Referenced by ThresholdSaccadeController::checkPercepts(), ThresholdSaccadeController::computeWhenNewDecision(), and Point2D< T >::distance().


Member Data Documentation

template<class T>
T Point2D< T >::i

2D coordinates

Definition at line 150 of file Point2D.H.

Referenced by GeometricHashing::addModel(), angle(), LineSegment2D::angle(), angleMeasure(), approximateHull(), InferoTemporalSIFT::attentionShift(), LandmarkDB::build(), DescriptorVec::buildDV(), WTAwinner::buildFromSMcoords(), DescriptorVec::buildParticleCountDV(), DescriptorVec::buildRawDV(), DescriptorVec::buildSingleChannelFV(), CudaSaliency::calcInertia(), JunctionHOG::calculateJunctionHistogram(), Rectangle::centerDims(), ThresholdSaccadeController::checkPercepts(), SceneGenerator::checkTargetPos(), Point2D< T >::clampToDims(), cMapLearnProc(), cMapLeftBiasProc(), SurpriseModelOD::combineFrom(), SurpriseModelPM::combineFrom(), SceneRec::computeLocation(), FrictionSaccadeController::computeWhenNewPercept(), FrictionSaccadeController::computeWhenResetPos(), Rectangle::contains(), convertFromString(), convertToString(), DPM::convolveComponent(), Image< T >::coordsOk(), CudaImage< T >::coordsOk(), corrpatch(), countParticles(), GHough::createInvRTable(), GHough::createRTable(), SpaceVariantModule::cropTransform(), cudaCrop(), cudaInplaceOverlay(), cudaInplacePaste(), SpatialMetrics::deg2pix(), SaliencyMapStdOptim::depress(), SaliencyMapFast::depress(), SaliencyMapTrivial::depress(), SaliencyMapStd::depress(), dilateImg(), PsychoDisplay::displayEyeTrackerCalibration(), SDLdisplay::displayImagePatch(), HippocampusI::displayMap(), PsychoDisplay::displayMovingDotBackground(), PsychoDisplay::displayNumbers(), PsychoDisplay::displaySmoothPursuitCalibration(), SDLdisplay::displayText(), Point2D< T >::distanceToLine(), Point2D< T >::distanceToSegment(), distDegrade(), FrictionSaccadeController::doEvolve(), ScorrChannel::doInput(), ObjDetChannel::doInput(), drawDiskCheckTarget(), SimulationViewerStd::drawEye(), ViewPort3D::drawGround(), SimulationViewerHand::drawHand(), SimulationViewerEyeHand::drawHand(), SimulationViewerStd::drawHead(), SimulationViewerStd::drawMaskOutline(), SimulationViewerNerdCam::drawMaskOutline(), CudaFramework::drawRectangle_centrepoint(), TemplateMatchChannel::drawResults(), drawSuperquadric(), VisualEventSet::drawTokens(), SaccadeController::dumpQueues(), erodeImg(), InferotemporalCortexI::evolve(), RG_Lane::evolve(), BeoLRF::evolve(), SceneUnderstanding::evolveBrain(), filterAtLocation(), TemplateMatchChannel::findBestMatch(), findBoundingRect(), GeometricHashing::findInHash(), findMax(), findMin(), VisualBufferStd::findMostInterestingTargetLocMax(), fixationMask(), flood(), floodCleanBB(), PyrFoveator::foveate(), BlurFoveator::foveate(), SpaceVariantModule::fromSvCoords(), SpaceVariantModule::fromSvCoordsMap(), gaussianBlob(), gaussianBlobUnnormalized(), KeypointTracker::getAbsLoc(), Graph::getAngle(), Beobot2_GistSalLocalizerMasterI::getBeliefImage(), GSlocalizer::getBeliefImage(), SaliencyMT::getBias(), EyeTrackerISCAN::getCalibrationSet(), ImageSpring< T >::getClusteredImage(), SaccadeController::getDecision(), EyeTrackerISCAN::getEyePos(), FeatureVector::getFeatureVectorImage(), FoeDetector::getFoe(), FoeDetector::getFoeMap(), ViewPort3D::getFrameLines(), PGH::getGeometricHistogram(), GeometricHashing::getHashTableImage(), ImageSpring< T >::getIndex(), BeobotVisualCortex::getInputSize(), SceneRecServer_i::getLandmarkLoc(), getLocalAvg(), LineGrouping::getLocalLines(), getLocalMax(), TopologicalMap::getLocationFloat(), TopologicalMap::getMapImage(), ImageSpring< T >::getNeighbor(), TestImages::getObjectData(), TestImages::getObjFromPos(), SceneGenerator::getObjFromPos(), RetinaAdapter::getOutput(), Landmark::getPosition(), RetinaAdapter::getRawInputRectangle(), VisualObject::getSalAndKeypointImage(), VisualObjectMatch::getSalDist(), SalientRegionSegmenter::getSalientRegion(), getSalRegions(), WTAwinner::getSMcoords(), VisualObjectMatch::getSpatialDist(), SimulationViewerStd::getTraj(), SimulationViewerNerdCam::getTraj(), SimulationViewerCompress::getTraj(), VisualObjectMatch::getTransfTestOutline(), Image< T >::getVal(), Image< T >::getValInterp(), Image< T >::getValInterpScaled(), VectorField::getVectorAt(), GeometricHashing::getVotes(), BeoSubBin::getWeightedBinMass(), BeobotVisualCortex::getWinner(), ImageSpring< T >::getXY(), Beobot::highLevel(), Beobot2_GistSalLocalizerMasterI::initParticles(), GSlocalizer::initParticles(), inplacePasteGabor(), WinnerTakeAllStdOptim::integrate(), WinnerTakeAllTempNote::integrate(), WinnerTakeAllGreedy::integrate(), WinnerTakeAllFast::integrate(), WinnerTakeAllStd::integrate(), Beobot::intermediateLevel(), LineSegment2D::intersects(), Camera::inverseProjection(), isLocalMax(), Point2DT::isValid(), Point2D< T >::isValid(), TestImages::labelScene(), linePlot(), Point2D< T >::magnitude(), main(), EyeTrackerEyeLink::manualDriftCorrection(), meanRow(), multilinePlot(), SurpriseImage< T >::neighborhoods(), VectorHistField::obstacleTemplate(), omniCorrectGen(), SimulationViewerEyeSim::onSimEventWTAwinner(), operator!=(), Point2D< T >::operator*(), Point2D< T >::operator*=(), Point2D< T >::operator+(), Point2D< T >::operator+=(), Point2D< T >::operator-(), Point2D< T >::operator-=(), Point2D< T >::operator/(), Point2D< T >::operator/=(), operator<<(), operator==(), operator>(), operator>>(), Image< T >::operator[](), SimEventSaliencyMapOutput::origToSm(), pasteImage(), SpatialMetrics::pix2deg(), plotData(), VectorField::plotField(), VectorField::plotGridField(), pnpoly(), pnTriangle(), Point2D< T >::Point2D(), CINNICstatsRun::pointAndFlood(), Localization::predict(), BeobotVisualCortex::process(), BeobotVisualCortex::processEnd(), Camera::project(), Vector2D::reset(), SaccadeController::resetPos(), retinalToVisualBuffer(), VectorField::rotateField(), BeoSubSaliency::run(), HeliPose::run_cameraPose(), SimulationViewerStats::save1(), segmentLandmark(), segmentObject(), segmentObjectClean(), DescriptorVec::setFovea(), Beobot2_GistSalLocalizerMasterI::setLocation(), GSlocalizer::setLocation(), setNewBias(), LPTFoveator::setOrigin(), Foveator::setOrigin(), VisualTracker::setTargets(), Image< T >::setVal(), VectorField::setVectorAt(), XWindow::setVisible(), VectorHistField::shiftField(), BeobotVisualCortex::singleCPUprocess(), SimEventSaliencyMapOutput::smToOrig(), Landmark::sort(), Point2D< T >::squdist(), SimulationViewerEyeHand::start1(), SimulationViewerEyeSim::stop1(), SimReqVCXfeatures::toString(), SimEventSaccadeStatus::toString(), SimEventWTAwinner::toString(), SpaceVariantModule::toSvCoords(), SpaceVariantModule::toSvCoordsMap(), VisualTracker::trackObjects(), trackPoint(), VisualTracker::trackTemplObject(), SceneRec::trainFeature(), SpaceVariantModule::transform(), Localization::update(), VisualEventSet::updateEvents(), VectorHistField::updateField(), Beobot2_GistSalLocalizerWorkerI::updateMessage(), Beobot2_GistSalLocalizerMasterI::updateMessage(), visualBufferToRetinal(), vizDist(), and SimulationViewerNerdCam::writeStatusPage().


The documentation for this class was generated from the following file:
Generated on Sun May 8 08:43:39 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3