My Project
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
OrientedLineSegment Class Reference

#include <lineSegments.h>

Public Member Functions

int read (FILE *fp)
float getWeight (const int &x, const int &y) const
float length (void) const
float distance (const int &x, const int &y) const
void getPerpendicular (float &x, float &y) const

Static Public Member Functions

static void Blend (const OrientedLineSegment &segment1, const OrientedLineSegment &segment2, const float &blendWeight, OrientedLineSegment &outSegment)
static void GetSourcePosition (const OrientedLineSegment &source, const OrientedLineSegment &destination, const int &destinationX, const int &destinationY, float &sourceX, float &sourceY)

Public Attributes

int x1
int y1
int x2
int y2

Static Public Attributes

static const float A =1
static const float B =1
static const float P =1

Detailed Description

This class represents an oriented line segment.

Member Function Documentation

void OrientedLineSegment::Blend ( const OrientedLineSegment segment1,
const OrientedLineSegment segment2,
const float &  blendWeight,
OrientedLineSegment outSegment 

This static method blends between two sets line segments, using the value of blendWeight to specify the the ratio of the blend, and writes out the blended line segment into outSegment.

float OrientedLineSegment::distance ( const int &  x,
const int &  y 
) const

This method returns the (signed) distance of a point from the line segment/

void OrientedLineSegment::getPerpendicular ( float &  x,
float &  y 
) const

This method sets the values (x,y) to the coordinates of the unit-vector perpendicular to the direction of the line segment.

void OrientedLineSegment::GetSourcePosition ( const OrientedLineSegment source,
const OrientedLineSegment destination,
const int &  destinationX,
const int &  destinationY,
float &  sourceX,
float &  sourceY 

This static method sets the value of the source pixel position (sourceX,sourceY), given the destination pixel position and a pair of corresponding source and destination line segments/

float OrientedLineSegment::getWeight ( const int &  x,
const int &  y 
) const

Given a point at position (x,y), this method returns the weight of the line segment's contribution to the point.

float OrientedLineSegment::length ( void  ) const

This method returns the length of the line segment.

int OrientedLineSegment::read ( FILE *  fp)

This method reads in a line segment from a file.

Member Data Documentation

const float OrientedLineSegment::A =1

The constants that define the weight of the contribution of a line segment to a particular point.

int OrientedLineSegment::x1

The coordinates of the end-points of the line segment.

The documentation for this class was generated from the following files: