Namespace for rasterization templates.
More...
Functions |
SP_EXPORT void | rasterizeTriangle (const RenderPixelCallback &RenderCallback, dim::point2di PointA, dim::point2di PointB, dim::point2di PointC, void *UserData) |
SP_EXPORT void | rasterizeCircle (const RenderPixelCallback &RenderCallback, const dim::point2di &Position, s32 Radius, void *UserData) |
SP_EXPORT void | rasterizeEllipse (const RenderPixelCallback &RenderCallback, const dim::point2di &Position, const dim::size2di &Radius, void *UserData) |
template<class VtxT > |
void | computeRasterScanline (const VtxT *(&v)[3], s32 y, s32 yStart, s32 yMiddle, VtxT &a, VtxT &b) |
| Only used internally for the rasterizeTriangle template function.
|
template<class VtxT > |
void | rasterizeTriangle (const boost::function< void(s32 x, s32 y, const VtxT &Vertex, void *UserData)> &RenderPixelCallback, const VtxT &VertexA, const VtxT &VertexB, const VtxT &VertexC, void *UserData=0) |
template<class VtxT > |
void | rasterizeLine (const boost::function< void(s32 x, s32 y, const VtxT &Vertex, void *UserData)> &RenderPixelCallback, const VtxT &VertexA, const VtxT &VertexB, void *UserData=0) |
Detailed Description
Namespace for rasterization templates.
Function Documentation
template<class VtxT >
void sp::math::Rasterizer::computeRasterScanline |
( |
const VtxT *(&) |
v[3], |
|
|
s32 |
y, |
|
|
s32 |
yStart, |
|
|
s32 |
yMiddle, |
|
|
VtxT & |
a, |
|
|
VtxT & |
b | |
|
) |
| | |
Only used internally for the rasterizeTriangle template function.
SP_EXPORT void sp::math::Rasterizer::rasterizeCircle |
( |
const RenderPixelCallback & |
RenderCallback, |
|
|
const dim::point2di & |
Position, |
|
|
s32 |
Radius, |
|
|
void * |
UserData = 0 | |
|
) |
| | |
Rasterizes a circle onto a 2D screen using the "Bresenham" algorithm.
- Parameters:
-
[in] | RenderCallback | Specifies the pixel rendering callback. Without this callback the function renders nothing. Use this to draw a pixel onto a screen or image buffer with the given x and y coordainte. |
[in] | Position | Specifies the 2D position of the circle. |
[in] | Radius | Specifies the radius of the circle. |
[in] | UserData | Any user data which will be passed to the render callback. |
SP_EXPORT void sp::math::Rasterizer::rasterizeEllipse |
( |
const RenderPixelCallback & |
RenderCallback, |
|
|
const dim::point2di & |
Position, |
|
|
const dim::size2di & |
Radius, |
|
|
void * |
UserData = 0 | |
|
) |
| | |
Rasterizes an ellipse onto a 2D screen using the "Bresenham" algorithm.
- Parameters:
-
[in] | RenderCallback | Specifies the pixel rendering callback. Without this callback the function renders nothing. Use this to draw a pixel onto a screen or image buffer with the given x and y coordainte. |
[in] | Position | Specifies the 2D position of the ellipse. |
[in] | Radius | Specifies the radius of the ellipse. |
[in] | UserData | Any user data which will be passed to the render callback. |
template<class VtxT >
void sp::math::Rasterizer::rasterizeLine |
( |
const boost::function< void(s32 x, s32 y, const VtxT &Vertex, void *UserData)> & |
RenderPixelCallback, |
|
|
const VtxT & |
VertexA, |
|
|
const VtxT & |
VertexB, |
|
|
void * |
UserData = 0 | |
|
) |
| | |
Rasterizes a line onto a 2D screen using the "Bresenham" algorithm.
- Template Parameters:
-
| VtxT | Specifies your own vertex class. See the RasterizerVertex class and implement your own vertex class with the same interface. |
- Parameters:
-
[in] | RenderPixelCallback | Specifies the pixel rendering callback. Without this callback the function renders nothing. Use this to draw a pixel onto a screen or image buffer with the given x and y coordainte. |
[in] | VertexA | First vertex for the line. |
[in] | VertexB | Second vertex for the line. |
[in] | UserData | Any user data which will be passed to the render callback. |
- See also:
- RasterizerVertex
template<class VtxT >
void sp::math::Rasterizer::rasterizeTriangle |
( |
const boost::function< void(s32 x, s32 y, const VtxT &Vertex, void *UserData)> & |
RenderPixelCallback, |
|
|
const VtxT & |
VertexA, |
|
|
const VtxT & |
VertexB, |
|
|
const VtxT & |
VertexC, |
|
|
void * |
UserData = 0 | |
|
) |
| | |
Rasterizes a triangle onto a 2D screen.
- Template Parameters:
-
| VtxT | Specifies your own vertex class. See the RasterizerVertex class and implement your own vertex class with the same interface. |
- Parameters:
-
[in] | RenderPixelCallback | Specifies the pixel rendering callback. Without this callback the function renders nothing. Use this to draw a pixel onto a screen or image buffer with the given x and y coordainte. |
[in] | VertexA | First vertex for the triangle. |
[in] | VertexB | Second vertex for the triangle. |
[in] | VertexC | Third vertex for the triangle. |
[in] | UserData | Any user data which will be passed to the render callback. |
- See also:
- RasterizerVertex
SP_EXPORT void sp::math::Rasterizer::rasterizeTriangle |
( |
const RenderPixelCallback & |
RenderCallback, |
|
|
dim::point2di |
PointA, |
|
|
dim::point2di |
PointB, |
|
|
dim::point2di |
PointC, |
|
|
void * |
UserData = 0 | |
|
) |
| | |
Rasterizes a triangle onto a 2D screen.
- Parameters:
-
[in] | RenderCallback | Specifies the pixel rendering callback. Without this callback the function renders nothing. Use this to draw a pixel onto a screen or image buffer with the given x and y coordainte. |
[in] | PointA | Specifies the first 2D point of the triangle. |
[in] | PointB | Specifies the second 2D point of the triangle. |
[in] | PointC | Specifies the third 2D point of the triangle. |
[in] | UserData | Any user data which will be passed to the render callback. |
- Note:
- This function does not interpolate any values between the triangle points. For this feature use the template variant.