OSDL::Video::TwoDimensional::Line Namespace Reference

This namespace gathers all line-oriented graphics output. More...

Functions

OSDL_DLL bool drawHorizontal (Surface &targetSurface, Coordinate xStart, Coordinate xStop, Coordinate y, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque)
 Draws an horizontal line ranging from point (xStart;y), included, to point (xStop;y), which is included if and only if endpoint drawing mode is set, with specified RGBA color.
OSDL_DLL bool drawHorizontal (Surface &targetSurface, Coordinate xStart, Coordinate xStop, Coordinate y, Pixels::PixelColor actualColor)
 Draws an horizontal line ranging from point (xStart;y), included, to point (xStop;y), which is included if and only if endpoint drawing mode is set, with specified RGBA color, already expressed according to targetSurface pixel format.
OSDL_DLL bool drawHorizontal (Surface &targetSurface, Coordinate xStart, Coordinate xStop, Coordinate y, Pixels::ColorDefinition=Pixels::White)
 Draws an horizontal line ranging from point (xStart;y), included, to point (xStop;y), which is included if and only if endpoint drawing mode is set, with specified RGBA color.
OSDL_DLL bool drawVertical (Surface &targetSurface, Coordinate x, Coordinate yStart, Coordinate yStop, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque)
 Draws a vertical line ranging from point (x;yStart), included, to point (x;yStop), which is included if and only if endpoint drawing mode is set, with specified RGBA color.
OSDL_DLL bool drawVertical (Surface &targetSurface, Coordinate x, Coordinate yStart, Coordinate yStop, Pixels::ColorDefinition=Pixels::White)
 Draws a vertical line ranging from point (x;yStart), included, to point (x;yStop), which is included if and only if endpoint drawing mode is set, with specified RGBA color.
OSDL_DLL bool draw (Surface &targetSurface, Coordinate xStart, Coordinate yStart, Coordinate xStop, Coordinate yStop, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque)
 Draws a line ranging from point (xStart;yStart), included, to point (xStop;yStop), which is included if and only if endpoint drawing mode is set, with specified RGBA color.
OSDL_DLL bool draw (Surface &targetSurface, Coordinate xStart, Coordinate yStart, Coordinate xStop, Coordinate yStop, Pixels::ColorDefinition colorDef=Pixels::White)
 Draws a line ranging from point (xStart;yStart), included, to point (xStop;yStop), which is included if and only if endpoint drawing mode is set, with specified RGBA color.
OSDL_DLL bool draw (Surface &targetSurface, Point2D &firstPoint, Point2D &secondPoint, Pixels::ColorElement red, Pixels::ColorElement green, Pixels::ColorElement blue, Pixels::ColorElement alpha=Pixels::AlphaOpaque)
 Draws a line ranging from firstpoint, included, to secondPoint, which is included if and only if endpoint drawing mode is set, with specified RGBA color.
OSDL_DLL bool draw (Surface &targetSurface, Point2D &firstPoint, Point2D &secondPoint, Pixels::ColorDefinition colorDef=Pixels::White)
 Draws a line ranging from firstpoint, included, to secondPoint, which is included if and only if endpoint drawing mode is set, with specified RGBA color.
OSDL_DLL bool drawCross (Surface &targetSurface, const Point2D &center, Pixels::ColorDefinition colorDef=Pixels::White, Length squareEdge=5)
 Draws a cross centered in center, included in a square whose length of edge is squareEdge.
OSDL_DLL bool drawCross (Surface &targetSurface, Coordinate xCenter, Coordinate yCenter, Pixels::ColorDefinition colorDef=Pixels::White, Length squareEdge=5)
 Draws a cross centered in center, included in a square whose length of edge is squareEdge.

Detailed Description

This namespace gathers all line-oriented graphics output.

Colors expressed as raw (non-converted to surface's pixel format) 32-bit color must respect the 0xRRGGBBAA structure, i.e. one byte for each of the four color components.

Note:
Line clipping is elementary: a line will not be drawn unless both endpoints are in clipped area. However, a line might be partially visible even if neither of them are in clipping area, therefore an improvement would be to draw the onscreen remaining part.

Function Documentation

bool OSDL::Video::TwoDimensional::Line::draw ( Surface targetSurface,
Point2D firstPoint,
Point2D secondPoint,
Pixels::ColorDefinition  colorDef = Pixels::White 
)

Draws a line ranging from firstpoint, included, to secondPoint, which is included if and only if endpoint drawing mode is set, with specified RGBA color.

Returns:
false if and only if something went wrong, for example if surface locking failed.
Note:
Locks surface if needed.
Clipping is performed.
This line will be antialiased if antialias mode is set.
See also:
drawHorizontal, drawVertical
VideoModule::GetEndPointDrawState, VideoModule::GetAntiAliasingState

Definition at line 306 of file OSDLLine.cc.

References draw(), OSDL::Video::TwoDimensional::Point2D::getX(), and OSDL::Video::TwoDimensional::Point2D::getY().

bool OSDL::Video::TwoDimensional::Line::draw ( Surface targetSurface,
Point2D firstPoint,
Point2D secondPoint,
Pixels::ColorElement  red,
Pixels::ColorElement  green,
Pixels::ColorElement  blue,
Pixels::ColorElement  alpha = Pixels::AlphaOpaque 
)

Draws a line ranging from firstpoint, included, to secondPoint, which is included if and only if endpoint drawing mode is set, with specified RGBA color.

Returns:
false if and only if something went wrong, for example if surface locking failed.
Note:
Locks surface if needed.
Clipping is performed.
This line will be antialiased if antialias mode is set.
See also:
drawHorizontal, drawVertical
VideoModule::GetEndPointDrawState, VideoModule::GetAntiAliasingState

Definition at line 293 of file OSDLLine.cc.

References draw(), OSDL::Video::TwoDimensional::Point2D::getX(), and OSDL::Video::TwoDimensional::Point2D::getY().

OSDL_DLL bool OSDL::Video::TwoDimensional::Line::draw ( Surface &  targetSurface,
Coordinate  xStart,
Coordinate  yStart,
Coordinate  xStop,
Coordinate  yStop,
Pixels::ColorDefinition  colorDef = Pixels::White 
)

Draws a line ranging from point (xStart;yStart), included, to point (xStop;yStop), which is included if and only if endpoint drawing mode is set, with specified RGBA color.

Returns:
false if and only if something went wrong, for example if surface locking failed.
Note:
Locks surface if needed.
Clipping is performed.
This line will be antialiased if antialias mode is set.
See also:
drawHorizontal, drawVertical
VideoModule::GetEndPointDrawState, VideoModule::GetAntiAliasingState
OSDL_DLL bool OSDL::Video::TwoDimensional::Line::draw ( Surface &  targetSurface,
Coordinate  xStart,
Coordinate  yStart,
Coordinate  xStop,
Coordinate  yStop,
Pixels::ColorElement  red,
Pixels::ColorElement  green,
Pixels::ColorElement  blue,
Pixels::ColorElement  alpha = Pixels::AlphaOpaque 
)

Draws a line ranging from point (xStart;yStart), included, to point (xStop;yStop), which is included if and only if endpoint drawing mode is set, with specified RGBA color.

Returns:
false if and only if something went wrong, for example if surface locking failed.
Note:
Locks surface if needed.
Clipping is performed.
This line will be antialiased if antialias mode is set.
See also:
drawHorizontal, drawVertical
VideoModule::GetEndPointDrawState, VideoModule::GetAntiAliasingState

Referenced by draw(), and drawCross().

bool OSDL::Video::TwoDimensional::Line::drawCross ( Surface targetSurface,
Coordinate  xCenter,
Coordinate  yCenter,
Pixels::ColorDefinition  colorDef = Pixels::White,
Length  squareEdge = 5 
)

Draws a cross centered in center, included in a square whose length of edge is squareEdge.

Note:
Useful to mark a specified pixel.
Locks surface if needed.
Clipping is performed.
This cross will be antialiased if antialias mode is set.
Returns:
false if and only if something went wrong, for example if surface locking failed.

Definition at line 329 of file OSDLLine.cc.

References draw().

bool OSDL::Video::TwoDimensional::Line::drawCross ( Surface targetSurface,
const Point2D center,
Pixels::ColorDefinition  colorDef = Pixels::White,
Length  squareEdge = 5 
)

Draws a cross centered in center, included in a square whose length of edge is squareEdge.

Note:
Useful to mark a specified pixel.
Locks surface if needed.
Clipping is performed.
This cross will be antialiased if antialias mode is set.
Returns:
false if and only if something went wrong, for example if surface locking failed.

Definition at line 318 of file OSDLLine.cc.

References OSDL::Video::TwoDimensional::Point2D::getX(), and OSDL::Video::TwoDimensional::Point2D::getY().

OSDL_DLL bool OSDL::Video::TwoDimensional::Line::drawHorizontal ( Surface &  targetSurface,
Coordinate  xStart,
Coordinate  xStop,
Coordinate  y,
Pixels::ColorDefinition  = Pixels::White 
)

Draws an horizontal line ranging from point (xStart;y), included, to point (xStop;y), which is included if and only if endpoint drawing mode is set, with specified RGBA color.

Returns:
false if and only if something went wrong, for example if surface locking failed.
Note:
Locks surface if needed.
Clipping is performed.
This line will be antialiased if antialias mode is set.
See also:
drawVertical, draw
VideoModule::GetEndPointDrawState
bool OSDL::Video::TwoDimensional::Line::drawHorizontal ( Surface targetSurface,
Coordinate  xStart,
Coordinate  xStop,
Coordinate  y,
Pixels::PixelColor  actualColor 
)

Draws an horizontal line ranging from point (xStart;y), included, to point (xStop;y), which is included if and only if endpoint drawing mode is set, with specified RGBA color, already expressed according to targetSurface pixel format.

Returns:
false if and only if something went wrong, for example if surface locking failed.
Note:
Locks surface if needed.
Clipping is performed.
This line will be antialiased if antialias mode is set.
See also:
drawVertical, draw
VideoModule::GetEndPointDrawState

Definition at line 102 of file OSDLLine.cc.

References OSDL::Video::Surface::getSDLSurface().

OSDL_DLL bool OSDL::Video::TwoDimensional::Line::drawHorizontal ( Surface &  targetSurface,
Coordinate  xStart,
Coordinate  xStop,
Coordinate  y,
Pixels::ColorElement  red,
Pixels::ColorElement  green,
Pixels::ColorElement  blue,
Pixels::ColorElement  alpha = Pixels::AlphaOpaque 
)

Draws an horizontal line ranging from point (xStart;y), included, to point (xStop;y), which is included if and only if endpoint drawing mode is set, with specified RGBA color.

Returns:
false if and only if something went wrong, for example if surface locking failed.
Note:
Locks surface if needed.
Clipping is performed.
This line will be antialiased if antialias mode is set.
See also:
drawVertical, draw
VideoModule::GetEndPointDrawState

Referenced by OSDL::Video::Surface::drawHorizontalLine().

OSDL_DLL bool OSDL::Video::TwoDimensional::Line::drawVertical ( Surface &  targetSurface,
Coordinate  x,
Coordinate  yStart,
Coordinate  yStop,
Pixels::ColorDefinition  = Pixels::White 
)

Draws a vertical line ranging from point (x;yStart), included, to point (x;yStop), which is included if and only if endpoint drawing mode is set, with specified RGBA color.

Returns:
false if and only if something went wrong, for example if surface locking failed.
Note:
Locks surface if needed.
Clipping is performed.
This line will be antialiased if antialias mode is set.
See also:
drawHorizontal, draw
VideoModule::GetEndPointDrawState
OSDL_DLL bool OSDL::Video::TwoDimensional::Line::drawVertical ( Surface &  targetSurface,
Coordinate  x,
Coordinate  yStart,
Coordinate  yStop,
Pixels::ColorElement  red,
Pixels::ColorElement  green,
Pixels::ColorElement  blue,
Pixels::ColorElement  alpha = Pixels::AlphaOpaque 
)

Draws a vertical line ranging from point (x;yStart), included, to point (x;yStop), which is included if and only if endpoint drawing mode is set, with specified RGBA color.

Returns:
false if and only if something went wrong, for example if surface locking failed.
Note:
Locks surface if needed.
Clipping is performed.
This line will be antialiased if antialias mode is set.
See also:
drawHorizontal, draw
VideoModule::GetEndPointDrawState

Referenced by OSDL::Video::Surface::drawVerticalLine().

Generated on Mon Nov 29 14:06:32 2010 for OSDL by  doxygen 1.6.3