Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Point2D< T > Class Template Reference

#include <Image/Point2D.H>

Collaboration diagram for Point2D< T >:

Collaboration graph
[legend]
List of all members.

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.

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
void clampToDims (const Dims &dims)
 clamp the coords such that the point fits into image of dimensions dims

Public Attributes

i
 2D coordinates
j


Constructor & Destructor Documentation

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

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

Definition at line 173 of file Point2D.H.

References Point2D< T >::i, and Point2D< T >::j.

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

Initialize the Point2D from horizontal & vertical coordinates.

Definition at line 178 of file Point2D.H.

References Point2D< T >::i, and Point2D< T >::j.

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

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

Definition at line 183 of file Point2D.H.

References Dims::h(), Point2D< T >::i, Point2D< T >::j, 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 189 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 332 of file Point2D.H.

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

Referenced by FrictionSaccadeController::computeWhenNewDecision(), EnvSegmenterColorRegion::getFoa(), SimulationViewerCompress::getTraj(), and V2::I_normalization().

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

the euclidean distance from p

Definition at line 327 of file Point2D.H.

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

Referenced by LandmarkDB::build(), TrivialSaccadeController::computeWhenNewDecision(), V2::cornerDetection(), V2::LineSegment::distance(), WaypointControllerI::evolve(), VisualBufferStd::findMostInterestingTargetLocMax(), getGeomRelProb(), getPotVal(), VisualObjectMatch::getSalDist(), BeoSubBin::getWeightedBinMass(), V2::J(), LineSegment2D::length(), SimulationViewerStd::linkFOAs(), SimulationViewerNerdCam::linkFOAs(), main(), Beobot2_GistSalLocalizerMasterI::objectUpdateBelief(), GSlocalizer::objectUpdateBelief(), TopologicalMap::read(), TrackFeature::run(), segmentColor(), Beobot2_GistSalLocalizerMasterI::setLocation(), GSlocalizer::setLocation(), trackPoint(), VisionRectangle::updateFrame(), BinFinder::updateFrame(), and V2::W().

template<class T>
bool Point2D< T >::isValid  )  const [inline]
 

test whether i and j are both positive

Definition at line 311 of file Point2D.H.

References Point2D< T >::i, and Point2D< T >::j.

Referenced by ComputeCMAP(), MonkeySaccadeController::computeWhenNewDecision(), ThresholdFrictionSaccadeController::computeWhenNewDecision(), ThresholdSaccadeController::computeWhenNewDecision(), FixedSaccadeController::computeWhenNewDecision(), TrivialSaccadeController::computeWhenNewDecision(), ThresholdFrictionSaccadeController::computeWhenNewPercept(), SimulationViewerStd::drawEye(), SimulationViewerStd::drawHead(), ENV_SHOWIMG(), VisualTrackerI::evolve(), V1::getDebugImage(), PCamera::getDebugImage(), Ganglion::getDebugImage(), SaccadeController::getDecision(), RetinaSpaceVariant::getOutput(), RetinaStd::getOutput(), EnvSaliencyMap::getSalmap(), WinnerTakeAllGreedy::integrate(), WTAwinner::isValid(), learnImage(), SimulationViewerStd::linkEyes(), SimulationViewerStd::linkHeads(), main(), Nv2UiJob::makeInputMarkup(), SaccadeController::resetPos(), LateralGeniculateNucleusI::run(), SimulationViewerI::run(), Nv2UiJob::run(), Ganglion::setInput(), VisualTracker::setTargets(), SHOWIMG(), SimulationViewerEyeSim::stop1(), submain(), and SimOutputFrameSeries::update().

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 279 of file Point2D.H.

References Point2D< T >::i, and Point2D< T >::j.

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 231 of file Point2D.H.

References Point2D< T >::i, and Point2D< T >::j.

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

*= operator

Definition at line 253 of file Point2D.H.

References Point2D< T >::i, and Point2D< T >::j.

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

*= operator

Definition at line 205 of file Point2D.H.

References Point2D< T >::i, and Point2D< T >::j.

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 265 of file Point2D.H.

References Point2D< T >::i, and Point2D< T >::j.

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 217 of file Point2D.H.

References Point2D< T >::i, and Point2D< T >::j.

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

+= operator

Definition at line 243 of file Point2D.H.

References Point2D< T >::i, and Point2D< T >::j.

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

+= operator

Definition at line 195 of file Point2D.H.

References Point2D< T >::i, and Point2D< T >::j.

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 272 of file Point2D.H.

References Point2D< T >::i, and Point2D< T >::j.

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 224 of file Point2D.H.

References Point2D< T >::i, and Point2D< T >::j.

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

-= operator

Definition at line 248 of file Point2D.H.

References Point2D< T >::i, and Point2D< T >::j.

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

-= operator

Definition at line 200 of file Point2D.H.

References Point2D< T >::i, and Point2D< T >::j.

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 286 of file Point2D.H.

References Point2D< T >::i, and Point2D< T >::j.

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 238 of file Point2D.H.

References Point2D< T >::i, and Point2D< T >::j.

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

/= operator

Definition at line 258 of file Point2D.H.

References Point2D< T >::i, and Point2D< T >::j.

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

/= operator

Definition at line 210 of file Point2D.H.

References Point2D< T >::i, and Point2D< T >::j.

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 317 of file Point2D.H.

References Point2D< T >::i, and Point2D< T >::j.

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


Member Data Documentation

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

2D coordinates

Definition at line 137 of file Point2D.H.

Referenced by CalibrationTransform::Data::addData(), LineSegment2D::angle(), V2::beta(), LandmarkDB::build(), DescriptorVec::buildDV(), WTAwinner::buildFromSMcoords(), DescriptorVec::buildLocalDV(), DescriptorVec::buildParticleCountDV(), InferoTemporalSalBayes::buildRawDV(), DescriptorVec::buildRawDV(), V4::buildRTables(), IT::buildRTables(), DescriptorVec::buildSingleChannelFV(), Contour::calcLineLikelihood(), V4d::calculateOrientationVector(), ThresholdSaccadeController::checkPercepts(), SceneGenerator::checkTargetPos(), checkWinnerLoc(), Point2D< T >::clampToDims(), cMapLearnProc(), cMapLeftBiasProc(), SurpriseModelOD::combineFrom(), SurpriseModelPM::combineFrom(), ComputeCMAP(), SceneRec::computeLocation(), FrictionSaccadeController::computeWhenNewPercept(), FrictionSaccadeController::computeWhenResetPos(), Rectangle::contains(), Contour::Contour(), convertFromString(), convertToString(), Image< T >::coordsOk(), CudaImage< T >::coordsOk(), XWindow::XWinImage::copyPixelsFrom(), V2::cornerDetection(), corrpatch(), countParticles(), V4d::createDescriptor(), crop(), cudaCrop(), SpatialMetrics::deg2pix(), SaliencyMapStdOptim::depress(), SaliencyMapFast::depress(), SaliencyMapTrivial::depress(), SaliencyMapStd::depress(), dilateImg(), lobot::direction(), PsychoDisplay::displayEyeTrackerCalibration(), SDLdisplay::displayImagePatch(), HippocampusI::displayMap(), PsychoDisplay::displayMovingDotBackground(), PsychoDisplay::displayNumbers(), PsychoDisplay::displaySmoothPursuitCalibration(), SDLdisplay::displayText(), distDegrade(), POMDP::doAction(), FrictionSaccadeController::doEvolve(), ScorrChannel::doInput(), ObjDetChannel::doInput(), POMDP::doPolicy(), doQuestion(), drawArrow(), PsychoDisplay::drawCalibPoint(), drawCircle(), drawContour2D(), drawCorner(), drawCross(), drawCrossOR(), drawDisk(), drawDiskCheckTarget(), SimulationViewerStd::drawEye(), drawFilledPolygon(), SimulationViewerStd::drawHead(), drawLine(), SimulationViewerStd::drawMaskOutline(), SimulationViewerNerdCam::drawMaskOutline(), LocalizationMapEntity::drawMe(), HippocampusI::drawObject(), drawPatch(), drawPatchBB(), PsychoDisplay::drawPoint(), PsychoDisplay::drawPointColor(), TemplateMatchChannel::drawResults(), VisualEventSet::drawTokens(), drawWorld(), SaccadeController::dumpQueues(), ENV_SHOWIMG(), erodeImg(), Contour::evolve(), InferotemporalCortexI::evolve(), BeoLRF::evolve(), VisualTrackerI::evolve(), SimulationViewerI::evolve(), SaliencyMapI::evolve(), HippocampusI::evolve(), SceneUnderstanding::evolveBrain(), SceneUnderstandingForm::evolveBrain(), BiasImageForm::evolveBrain(), evolveBrain(), V1::evolveGabor(), ObjRecSalBayes::extractFeatures(), filterAtLocation(), TemplateMatchChannel::findBestMatch(), findDirection(), findMax(), findMin(), VisualBufferStd::findMostInterestingTargetLocMax(), POMDP::findMultipleObjects(), POMDP::findObject(), findScaledMax(), findTargetDir(), flood(), floodCleanBB(), PyrFoveator::foveate(), BlurFoveator::foveate(), ObjRec::generateNewLineState(), ObjRec::generateNewSquareState(), KeypointTracker::getAbsLoc(), Beobot2_GistSalLocalizerMasterI::getBeliefImage(), GSlocalizer::getBeliefImage(), V4::getBias(), CMapThreads::getBias(), SaliencyMT::getBias(), BeoSubBin::getBinSceneMass(), AffineTransform::getCalibrated(), EyeTrackerISCAN::getCalibrationSet(), ImageSpring< T >::getClusteredImage(), BeoSubCross::getCrossCenter(), IT::getDebugImage(), SaccadeController::getDecision(), Beobot2_GistSalLocalizerMasterI::getDisplayImage(), getDisplayImage(), ObjRec::getEdgeLikelihood(), EyeTrackerISCAN::getEyePos(), getFacePartProb(), FeatureVector::getFeatureVectorImage(), getGeomRelProb(), V4::getGeonLikelihood(), ImageSpring< T >::getIndex(), BeobotVisualCortex::getInputSize(), getIntSalPt(), getKeypoints(), SceneRecServer_i::getLandmarkLoc(), V4d::getLineProbability(), V4::getLineProbability(), getLocalMax(), getLocalSalPt(), TopologicalMap::getLocationFloat(), TopologicalMap::getMapImage(), ImageSpring< T >::getNeighbor(), Nv2LabelReader::getNextLabeledImage(), TestImages::getObjectData(), IT::getObjectLikelihood(), TestImages::getObjFromPos(), SceneGenerator::getObjFromPos(), SimulationViewerRecStats::getObjNameAtLoc(), InferoTemporalSalBayes::getObjNameAtLoc(), RetinaSpaceVariant::getOutput(), RetinaStd::getOutput(), V4d::getParticleLikelihood(), Landmark::getPosition(), POMDP::getPropAction(), RetinaSpaceVariant::getRawInputRectangle(), RetinaStd::getRawInputRectangle(), VisualObject::getSalAndKeypointImage(), getSalDispImg(), VisualObjectMatch::getSalDist(), Attentionator::getSalientPoint(), EnvSaliencyMap::getSalmap(), getSalRegions(), WTAwinner::getSMcoords(), VisualObjectMatch::getSpatialDist(), ObjRec::getSquareLikelihood(), EnvSegmenterCannyContour::getSquares(), getSwpe(), SimulationViewerStd::getTraj(), SimulationViewerNerdCam::getTraj(), SimulationViewerCompress::getTraj(), VisualObjectMatch::getTransfTestOutline(), Layer::getUnit(), BotControlServer_i::getUserInput(), Image< T >::getVal(), Image< T >::getValInterp(), Image< T >::getValInterpScaled(), BeoSubBin::getWeightedBinMass(), getWindow(), BeobotVisualCortex::getWinner(), getWinnerLoc(), ImageSpring< T >::getXY(), lobot::global_flow(), POMDP::goalReached(), Beobot::highLevel(), houghEllipse(), ObjRec::houghLines(), houghTransform(), V2::I_normalization(), button::inBounds(), Ganglion::init(), Beobot2_GistSalLocalizerMasterI::initParticles(), GSlocalizer::initParticles(), inplacePaste(), inplacePasteGabor(), WinnerTakeAllStdOptim::integrate(), WinnerTakeAllTempNote::integrate(), WinnerTakeAllGreedy::integrate(), WinnerTakeAllFast::integrate(), WinnerTakeAllStd::integrate(), Beobot::intermediateLevel(), LineSegment2D::intersects(), Camera::inverseProjection(), iorHelper(), isLocalMax(), Point2DT::isValid(), Point2D< T >::isValid(), TestImages::labelScene(), learnImage(), linePlot(), V2::lineSegmentDetection(), ForwardVisionAgent::lookForBuoy(), lobot::magnitude(), main(), Nv2UiJob::makeInputMarkup(), POMDP::makePrediction(), SiftRec::matchObject(), meanRow(), PTZI::moveCameraToTarget(), moveToObject(), SurpriseImage< T >::neighborhoods(), VectorHistField::obstacleTemplate(), omniCorrectGen(), SimulationViewerEyeSim::onSimEventWTAwinner(), lobot::operator *(), Point2D< T >::operator *(), Point2D< T >::operator *=(), operator!=(), operator+(), Point2D< T >::operator+(), Point2D< T >::operator+=(), operator-(), Point2D< T >::operator-(), Point2D< T >::operator-=(), Point2D< T >::operator/(), Point2D< T >::operator/=(), operator<<(), operator==(), operator>(), Image< T >::operator[](), overlay_circle(), overlay_rect(), TrainingSet::p2p(), pasteImage(), SpatialMetrics::pix2deg(), World2DInput::placeLine(), World2DInput::placeSquare(), BeoSonar::plotDists(), VectorField::plotField(), pnpoly(), Point2D< T >::Point2D(), Point2D_xx_testConstructAdd_xx_1(), Point2D_xx_testConvertType_xx_1(), CINNICstatsRun::pointAndFlood(), Localization::predict(), PatchSet::predictDigit(), Particle::Print(), BeobotVisualCortex::process(), BeobotVisualCortex::processEnd(), processSalCue(), Camera::project(), V2::proposeContours(), V4d::proposeParticles(), reach(), TrainingSet::recordSample(), XWindow::XWinImage::redraw(), Layout< T >::renderInto(), TestSuite::Impl::requireImgEqFp(), Vector2D::reset(), SaccadeController::resetPos(), MapperI::resolvePosition(), retinalToVisualBuffer(), retinexCompareNeighbors(), LateralGeniculateNucleusI::run(), TrackFeature::run(), FindLandmark::run(), SimulationViewerI::run(), MissileLauncher::run(), Nv2UiJob::run(), BeoSubSaliency::run(), HeliPose::run_cameraPose(), runCanny(), ObjRec::samplePosterior(), SimulationViewerStats::save1(), segmentColor(), segmentLandmark(), segmentObject(), segmentObjectClean(), Nv2LabelReader::sendPatch(), DescriptorVec::setFovea(), SeaBee3MainDisplayForm::setImage(), Ganglion::setInput(), Beobot2_GistSalLocalizerMasterI::setLocation(), GSlocalizer::setLocation(), setNewBias(), LPTFoveator::setOrigin(), Foveator::setOrigin(), NeoBrain::setTarget(), VisualTrackerI::setTargets(), VisualTracker::setTargets(), TrackFeature::setTrackLoc(), PrefrontalCortexI::setTrackLoc(), Image< T >::setVal(), VectorField::setVectorAt(), XWindow::setVisible(), showHough(), SHOWIMG(), ObjRec::showSquaresWorld(), BeobotVisualCortex::singleCPUprocess(), Landmark::sort(), Point2D< T >::squdist(), SimulationViewerEyeMvt::start1(), SimulationViewerEyeSim::stop1(), submain(), SceneUnderstandingForm::submitDialog(), toOrb(), SimReqVCXfeatures::toString(), SimEventSaccadeStatus::toString(), SimEventWTAwinner::toString(), NeoBrain::trackObject(), VisualTrackerI::trackObjects(), VisualTracker::trackObjects(), MovementController::trackPipe(), VisualTracker::trackTemplObject(), ObjRecSalBayes::train(), SceneRec::trainFeature(), Localization::update(), updateDisplay(), VisualEventSet::updateEvents(), VectorHistField::updateField(), VisionRectangle::updateFrame(), StraightEdgeFinder::updateFrame(), SaliencyModuleI::updateFrame(), BinFinder::updateFrame(), Beobot2_GistSalLocalizerWorkerI::updateMessage(), Beobot2_GistSalLocalizerMasterI::updateMessage(), SeaBee3GUICommunicator::updateMessage(), Particle::updatePosition(), POMDP::updateStateTransitions(), TrackFeature::updateTemplate(), V1::V1(), TwoHalfDSketch::vanishingPoints(), Util::vectorTo(), visualBufferToRetinal(), vizDist(), V4d::voteForFeature(), V4::voteForFeature(), IT::voteForFeature(), V2::W(), World2DInput::World2DInput(), SimulationViewerNerdCam::writeStatusPage(), writeText(), NCursesUI::writeText(), and writeText2().


The documentation for this class was generated from the following file:
Generated on Sun Nov 22 13:46:12 2009 for iLab Neuromorphic Vision Toolkit by  doxygen 1.4.4