ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

Graphics::VectorRendererSpec< PixelType > Class Template Reference

VectorRendererSpec: Specialized Vector Renderer Class. More...

#include <VectorRendererSpec.h>

Inheritance diagram for Graphics::VectorRendererSpec< PixelType >:
Collaboration diagram for Graphics::VectorRendererSpec< PixelType >:

List of all members.

Public Member Functions

 VectorRendererSpec (PixelFormat format)
void drawLine (int x1, int y1, int x2, int y2)
 LINES.
void drawLineClip (int x1, int y1, int x2, int y2, Common::Rect clipping)
void drawCircle (int x, int y, int r)
 CIRCLES.
void drawCircleClip (int x, int y, int r, Common::Rect clipping)
void drawSquare (int x, int y, int w, int h)
 SQUARES.
void drawSquareClip (int x, int y, int w, int h, Common::Rect clipping)
void drawRoundedSquare (int x, int y, int r, int w, int h)
 ROUNDED SQUARES.
void drawRoundedSquareClip (int x, int y, int r, int w, int h, Common::Rect clipping)
void drawTriangle (int x, int y, int base, int height, TriangleOrientation orient)
 Draws a triangle starting at (x,y) with the given base and height.
void drawTriangleClip (int x, int y, int base, int height, TriangleOrientation orient, Common::Rect clipping)
void drawTab (int x, int y, int r, int w, int h)
 Draws a tab-like shape, specially thought for the Tab widget.
void drawTabClip (int x, int y, int r, int w, int h, Common::Rect clipping)
void drawBeveledSquare (int x, int y, int w, int h, int bevel)
 Draws a beveled square like the ones in the Classic GUI themes.
void drawBeveledSquareClip (int x, int y, int w, int h, int bevel, Common::Rect clipping)
void drawString (const Graphics::Font *font, const Common::String &text, const Common::Rect &area, Graphics::TextAlign alignH, GUI::ThemeEngine::TextAlignVertical alignV, int deltax, bool elipsis, const Common::Rect &textDrawableArea=Common::Rect(0, 0, 0, 0))
 Draws a string into the screen.
void setFgColor (uint8 r, uint8 g, uint8 b)
 Set the active foreground painting color for the renderer.
void setBgColor (uint8 r, uint8 g, uint8 b)
 Set the active background painting color for the renderer.
void setBevelColor (uint8 r, uint8 g, uint8 b)
void setGradientColors (uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2)
 Set the active gradient color.
void copyFrame (OSystem *sys, const Common::Rect &r)
 Copies the part of the current frame to the system overlay.
void copyWholeFrame (OSystem *sys)
 Copies the current surface to the system overlay.
void fillSurface ()
 Fills the active surface with the specified fg/bg color or the active gradient.
void fillSurfaceClip (Common::Rect clipping)
void blitSurface (const Graphics::Surface *source, const Common::Rect &r)
 Blits a given graphics surface on top of the current drawing surface.
void blitSubSurface (const Graphics::Surface *source, const Common::Rect &r)
 Blits a given graphics surface into a small area of the current drawing surface.
void blitSubSurfaceClip (const Graphics::Surface *source, const Common::Rect &r, const Common::Rect &clipping)
void blitKeyBitmap (const Graphics::Surface *source, const Common::Rect &r)
void blitKeyBitmapClip (const Graphics::Surface *source, const Common::Rect &r, const Common::Rect &clipping)
void blitAlphaBitmap (Graphics::TransparentSurface *source, const Common::Rect &r, GUI::ThemeEngine::AutoScaleMode autoscale=GUI::ThemeEngine::kAutoScaleNone, Graphics::DrawStep::VectorAlignment xAlign=Graphics::DrawStep::kVectorAlignManual, Graphics::DrawStep::VectorAlignment yAlign=Graphics::DrawStep::kVectorAlignManual, int alpha=255)
void applyScreenShading (GUI::ThemeEngine::ShadingStyle shadingStyle)
 Applies a whole-screen shading effect, used before opening a new dialog.

Protected Member Functions

void putPixel (int x, int y, PixelType color)
 Draws a single pixel on the surface with the given coordinates and the given color.
void blendPixel (int x, int y, PixelType color, uint8 alpha)
 Blends a single pixel on the surface with the given coordinates, color and Alpha intensity.
void blendPixelPtr (PixelType *ptr, PixelType color, uint8 alpha)
 Blends a single pixel on the surface in the given pixel pointer, using supplied color and Alpha intensity.
void blendPixelPtrClip (PixelType *ptr, PixelType color, uint8 alpha, int x, int y)
void blendPixelDestAlphaPtr (PixelType *ptr, PixelType color, uint8 alpha)
 Blends a single pixel on the surface in the given pixel pointer, using supplied color and Alpha intensity.
virtual void drawLineAlg (int x1, int y1, int x2, int y2, uint dx, uint dy, PixelType color)
 PRIMITIVE DRAWING ALGORITHMS.
virtual void drawLineAlgClip (int x1, int y1, int x2, int y2, uint dx, uint dy, PixelType color)
virtual void drawCircleAlg (int x, int y, int r, PixelType color, FillMode fill_m)
 CIRCLE ALGORITHM.
virtual void drawCircleAlgClip (int x, int y, int r, PixelType color, FillMode fill_m)
virtual void drawRoundedSquareAlg (int x1, int y1, int r, int w, int h, PixelType color, FillMode fill_m)
virtual void drawRoundedSquareAlgClip (int x1, int y1, int r, int w, int h, PixelType color, FillMode fill_m)
virtual void drawBorderRoundedSquareAlg (int x1, int y1, int r, int w, int h, PixelType color, FillMode fill_m, uint8 alpha_t, uint8 alpha_r, uint8 alpha_b, uint8 alpha_l)
 ROUNDED SQUARE ALGORITHM.
virtual void drawBorderRoundedSquareAlgClip (int x1, int y1, int r, int w, int h, PixelType color, FillMode fill_m, uint8 alpha_t, uint8 alpha_r, uint8 alpha_b, uint8 alpha_l)
virtual void drawInteriorRoundedSquareAlg (int x1, int y1, int r, int w, int h, PixelType color, FillMode fill_m)
virtual void drawInteriorRoundedSquareAlgClip (int x1, int y1, int r, int w, int h, PixelType color, FillMode fill_m)
virtual void drawSquareAlg (int x, int y, int w, int h, PixelType color, FillMode fill_m)
 SQUARE ALGORITHM.
virtual void drawSquareAlgClip (int x, int y, int w, int h, PixelType color, FillMode fill_m)
virtual void drawTriangleVertAlg (int x, int y, int w, int h, bool inverted, PixelType color, FillMode fill_m)
virtual void drawTriangleVertAlgClip (int x, int y, int w, int h, bool inverted, PixelType color, FillMode fill_m)
virtual void drawTriangleFast (int x, int y, int size, bool inverted, PixelType color, FillMode fill_m)
 VERTICAL TRIANGLE DRAWING - FAST VERSION FOR SQUARED TRIANGLES.
virtual void drawBevelSquareAlg (int x, int y, int w, int h, int bevel, PixelType top_color, PixelType bottom_color, bool fill)
 SQUARE ALGORITHM.
virtual void drawBevelSquareAlgClip (int x, int y, int w, int h, int bevel, PixelType top_color, PixelType bottom_color, bool fill)
virtual void drawTabAlg (int x, int y, int w, int h, int r, PixelType color, VectorRenderer::FillMode fill_m, int baseLeft=0, int baseRight=0)
 TAB ALGORITHM - NON AA.
virtual void drawTabAlgClip (int x, int y, int w, int h, int r, PixelType color, VectorRenderer::FillMode fill_m, int baseLeft=0, int baseRight=0)
virtual void drawTabShadow (int x, int y, int w, int h, int r)
virtual void drawTabShadowClip (int x, int y, int w, int h, int r)
virtual void drawBevelTabAlg (int x, int y, int w, int h, int bevel, PixelType topColor, PixelType bottomColor, int baseLeft=0, int baseRight=0)
 BEVELED TABS FOR CLASSIC THEME.
virtual void drawBevelTabAlgClip (int x, int y, int w, int h, int bevel, PixelType topColor, PixelType bottomColor, int baseLeft=0, int baseRight=0)
virtual void drawSquareShadow (int x, int y, int w, int h, int offset)
 SHADOW DRAWING ALGORITHMS.
virtual void drawSquareShadowClip (int x, int y, int w, int h, int offset)
virtual void drawRoundedSquareShadow (int x, int y, int r, int w, int h, int offset)
virtual void drawRoundedSquareShadowClip (int x, int y, int r, int w, int h, int offset)
PixelType calcGradient (uint32 pos, uint32 max)
 Calculates the color gradient on a given point.
void precalcGradient (int h)
void gradientFill (PixelType *first, int width, int x, int y)
void gradientFillClip (PixelType *first, int width, int x, int y, int realX, int realY)
void blendFill (PixelType *first, PixelType *last, PixelType color, uint8 alpha)
 Fills several pixels in a row with a given color and the specified alpha blending.
void blendFillClip (PixelType *first, PixelType *last, PixelType color, uint8 alpha, int realX, int realY)
void darkenFill (PixelType *first, PixelType *last)
void darkenFillClip (PixelType *first, PixelType *last, int x, int y)

Protected Attributes

Common::Rect _clippingArea
const PixelFormat _format
const PixelType _redMask
const PixelType _greenMask
const PixelType _blueMask
const PixelType _alphaMask
PixelType _fgColor
 Foreground color currently being used to draw on the renderer.
PixelType _bgColor
 Background color currently being used to draw on the renderer.
PixelType _gradientStart
 Start color for the fill gradient.
PixelType _gradientEnd
 End color for the fill gradient.
int _gradientBytes [3]
 Color bytes of the active gradient, used to speed up calculation.
Common::Array< PixelType > _gradCache
Common::Array< int > _gradIndexes
PixelType _bevelColor
PixelType _bitmapAlphaColor

Private Types

typedef VectorRenderer Base

Detailed Description

template<typename PixelType>
class Graphics::VectorRendererSpec< PixelType >

VectorRendererSpec: Specialized Vector Renderer Class.

This templated class implements the basic subset of vector operations for all platforms by allowing the user to provide the actual Pixel Type and pixel information structs.

This class takes two template parameters:

Parameters:
PixelType Defines a type which may hold the color value of a single pixel, such as "byte" or "uint16" for 8 and 16 BPP respectively.

TODO: Expand documentation.

See also:
VectorRenderer

Definition at line 47 of file VectorRendererSpec.h.


Member Typedef Documentation

template<typename PixelType >
typedef VectorRenderer Graphics::VectorRendererSpec< PixelType >::Base [private]

Reimplemented in Graphics::VectorRendererAA< PixelType >.

Definition at line 48 of file VectorRendererSpec.h.


Constructor & Destructor Documentation

template<typename PixelType >
Graphics::VectorRendererSpec< PixelType >::VectorRendererSpec ( PixelFormat  format  ) 

Definition at line 534 of file VectorRendererSpec.cpp.


Member Function Documentation

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::applyScreenShading ( GUI::ThemeEngine::ShadingStyle   )  [virtual]

Applies a whole-screen shading effect, used before opening a new dialog.

Currently supports screen dimmings and luminance (b&w).

Implements Graphics::VectorRenderer.

Definition at line 975 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::blendFill ( PixelType *  first,
PixelType *  last,
PixelType  color,
uint8  alpha 
) [inline, protected]

Fills several pixels in a row with a given color and the specified alpha blending.

See also:
blendPixelPtr
blendPixel
Parameters:
first Pointer to the first pixel to fill.
last Pointer to the last pixel to fill.
color Color of the pixel
alpha Alpha intensity of the pixel (0-255)

Definition at line 291 of file VectorRendererSpec.h.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::blendFillClip ( PixelType *  first,
PixelType *  last,
PixelType  color,
uint8  alpha,
int  realX,
int  realY 
) [inline, protected]

Definition at line 296 of file VectorRendererSpec.h.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::blendPixel ( int  x,
int  y,
PixelType  color,
uint8  alpha 
) [inline, protected]

Blends a single pixel on the surface with the given coordinates, color and Alpha intensity.

Parameters:
x Horizontal coordinate of the pixel.
y Vertical coordinate of the pixel.
color Color of the pixel
alpha Alpha intensity of the pixel (0-255)

Definition at line 132 of file VectorRendererSpec.h.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::blendPixelDestAlphaPtr ( PixelType *  ptr,
PixelType  color,
uint8  alpha 
) [inline, protected]

Blends a single pixel on the surface in the given pixel pointer, using supplied color and Alpha intensity.

If the destination pixel has 0 alpha, set the color and alpha channels, overwriting the destination pixel entirely. If the destination pixel has non-zero alpha, blend dest with src.

This is implemented to prevent blendPixel() to calculate the surface pointer on each call. Optimized drawing algorithms should call this function when possible.

See also:
blendPixel
Parameters:
ptr Pointer to the pixel to blend on top of
color Color of the pixel
alpha Alpha intensity of the pixel (0-255)

Definition at line 1059 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::blendPixelPtr ( PixelType *  ptr,
PixelType  color,
uint8  alpha 
) [inline, protected]

Blends a single pixel on the surface in the given pixel pointer, using supplied color and Alpha intensity.

This is implemented to prevent blendPixel() to calculate the surface pointer on each call. Optimized drawing algorithms should call this function when possible.

See also:
blendPixel
Parameters:
ptr Pointer to the pixel to blend on top of
color Color of the pixel
alpha Alpha intensity of the pixel (0-255)

Definition at line 1005 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::blendPixelPtrClip ( PixelType *  ptr,
PixelType  color,
uint8  alpha,
int  x,
int  y 
) [inline, protected]

Definition at line 1052 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::blitAlphaBitmap ( Graphics::TransparentSurface source,
const Common::Rect r,
GUI::ThemeEngine::AutoScaleMode  autoscale = GUI::ThemeEngine::kAutoScaleNone,
Graphics::DrawStep::VectorAlignment  xAlign = Graphics::DrawStep::kVectorAlignManual,
Graphics::DrawStep::VectorAlignment  yAlign = Graphics::DrawStep::kVectorAlignManual,
int  alpha = 255 
) [virtual]

Implements Graphics::VectorRenderer.

Definition at line 890 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::blitKeyBitmap ( const Graphics::Surface source,
const Common::Rect r 
) [virtual]

Implements Graphics::VectorRenderer.

Definition at line 854 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::blitKeyBitmapClip ( const Graphics::Surface source,
const Common::Rect r,
const Common::Rect clipping 
) [virtual]

Implements Graphics::VectorRenderer.

Definition at line 924 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::blitSubSurface ( const Graphics::Surface source,
const Common::Rect r 
) [virtual]

Blits a given graphics surface into a small area of the current drawing surface.

Note that the given surface is expected to be smaller than the active drawing surface, hence the WHOLE source surface will be blitted into the active surface, at the position specified by "r".

Implements Graphics::VectorRenderer.

Definition at line 783 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::blitSubSurfaceClip ( const Graphics::Surface source,
const Common::Rect r,
const Common::Rect clipping 
) [virtual]

Implements Graphics::VectorRenderer.

Definition at line 802 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::blitSurface ( const Graphics::Surface source,
const Common::Rect r 
) [virtual]

Blits a given graphics surface on top of the current drawing surface.

Note that the source surface and the active surface are expected to be of the same size, hence the area delimited by "r" in the source surface will be blitted into the area delimited by "r" on the current surface.

If you wish to blit a smaller surface into the active drawing area, use VectorRenderer::blitSubSurface().

Parameters:
source Surface to blit into the drawing surface.
r Position in the active drawing surface to do the blitting.

Implements Graphics::VectorRenderer.

Definition at line 762 of file VectorRendererSpec.cpp.

template<typename PixelType >
PixelType Graphics::VectorRendererSpec< PixelType >::calcGradient ( uint32  pos,
uint32  max 
) [inline, protected]

Calculates the color gradient on a given point.

This function assumes that the gradient start/end colors have been set beforehand from the API function call.

Parameters:
pos Progress of the gradient.
max Maximum amount of the progress.
Returns:
Composite color of the gradient at the given "progress" amount.

Definition at line 568 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::copyFrame ( OSystem sys,
const Common::Rect r 
) [virtual]

Copies the part of the current frame to the system overlay.

Parameters:
sys Pointer to the global System class
r Zone of the surface to copy into the overlay.

Implements Graphics::VectorRenderer.

Definition at line 751 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::copyWholeFrame ( OSystem sys  )  [inline, virtual]

Copies the current surface to the system overlay.

Parameters:
sys Pointer to the global System class

Implements Graphics::VectorRenderer.

Definition at line 89 of file VectorRendererSpec.h.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::darkenFill ( PixelType *  first,
PixelType *  last 
) [inline, protected]

Definition at line 1076 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::darkenFillClip ( PixelType *  first,
PixelType *  last,
int  x,
int  y 
) [inline, protected]

Definition at line 1104 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawBeveledSquare ( int  x,
int  y,
int  w,
int  h,
int  bevel 
) [inline, virtual]

Draws a beveled square like the ones in the Classic GUI themes.

Beveled squares are always drawn with a transparent background. Draw them on top of a standard square to fill it.

Parameters:
x Horizontal (X) coordinate for the center of the square
y Vertical (Y) coordinate for the center of the square
w Width of the square.
h Height of the square
bevel Amount of bevel. Must be positive.

Implements Graphics::VectorRenderer.

Definition at line 65 of file VectorRendererSpec.h.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawBeveledSquareClip ( int  x,
int  y,
int  w,
int  h,
int  bevel,
Common::Rect  clipping 
) [inline, virtual]

Implements Graphics::VectorRenderer.

Definition at line 68 of file VectorRendererSpec.h.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawBevelSquareAlg ( int  x,
int  y,
int  w,
int  h,
int  bevel,
PixelType  top_color,
PixelType  bottom_color,
bool  fill 
) [protected, virtual]

SQUARE ALGORITHM.

Definition at line 2347 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawBevelSquareAlgClip ( int  x,
int  y,
int  w,
int  h,
int  bevel,
PixelType  top_color,
PixelType  bottom_color,
bool  fill 
) [protected, virtual]

Definition at line 2407 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawBevelTabAlg ( int  x,
int  y,
int  w,
int  h,
int  bevel,
PixelType  topColor,
PixelType  bottomColor,
int  baseLeft = 0,
int  baseRight = 0 
) [protected, virtual]

BEVELED TABS FOR CLASSIC THEME.

Definition at line 2174 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawBevelTabAlgClip ( int  x,
int  y,
int  w,
int  h,
int  bevel,
PixelType  topColor,
PixelType  bottomColor,
int  baseLeft = 0,
int  baseRight = 0 
) [protected, virtual]

Definition at line 2217 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawBorderRoundedSquareAlg ( int  x1,
int  y1,
int  r,
int  w,
int  h,
PixelType  color,
VectorRenderer::FillMode  fill_m,
uint8  alpha_t,
uint8  alpha_r,
uint8  alpha_b,
uint8  alpha_l 
) [protected, virtual]

ROUNDED SQUARE ALGORITHM.

Reimplemented in Graphics::VectorRendererAA< PixelType >.

Definition at line 3048 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawBorderRoundedSquareAlgClip ( int  x1,
int  y1,
int  r,
int  w,
int  h,
PixelType  color,
VectorRenderer::FillMode  fill_m,
uint8  alpha_t,
uint8  alpha_r,
uint8  alpha_b,
uint8  alpha_l 
) [protected, virtual]

Definition at line 3113 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawCircle ( int  x,
int  y,
int  r 
) [virtual]

CIRCLES.

Implements Graphics::VectorRenderer.

Definition at line 1314 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawCircleAlg ( int  x,
int  y,
int  r,
PixelType  color,
VectorRenderer::FillMode  fill_m 
) [protected, virtual]

CIRCLE ALGORITHM.

Reimplemented in Graphics::VectorRendererAA< PixelType >.

Definition at line 3402 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawCircleAlgClip ( int  x,
int  y,
int  r,
PixelType  color,
VectorRenderer::FillMode  fill_m 
) [protected, virtual]

Definition at line 3445 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawCircleClip ( int  x,
int  y,
int  r,
Common::Rect  clipping 
) [virtual]

Implements Graphics::VectorRenderer.

Definition at line 1352 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawInteriorRoundedSquareAlg ( int  x1,
int  y1,
int  r,
int  w,
int  h,
PixelType  color,
VectorRenderer::FillMode  fill_m 
) [protected, virtual]

Reimplemented in Graphics::VectorRendererAA< PixelType >.

Definition at line 3181 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawInteriorRoundedSquareAlgClip ( int  x1,
int  y1,
int  r,
int  w,
int  h,
PixelType  color,
VectorRenderer::FillMode  fill_m 
) [protected, virtual]

Definition at line 3253 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawLine ( int  x1,
int  y1,
int  x2,
int  y2 
) [virtual]

LINES.

Implements Graphics::VectorRenderer.

Definition at line 1184 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawLineAlg ( int  x1,
int  y1,
int  x2,
int  y2,
uint  dx,
uint  dy,
PixelType  color 
) [protected, virtual]

PRIMITIVE DRAWING ALGORITHMS.

GENERIC LINE ALGORITHM.

Generic algorithms for drawing all kinds of aliased primitive shapes. These may be overloaded in inheriting classes to implement platform-specific optimizations or improve looks.

See also:
VectorRendererAA
VectorRendererAA::drawLineAlg
VectorRendererAA::drawCircleAlg

Reimplemented in Graphics::VectorRendererAA< PixelType >.

Definition at line 2479 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawLineAlgClip ( int  x1,
int  y1,
int  x2,
int  y2,
uint  dx,
uint  dy,
PixelType  color 
) [protected, virtual]

Definition at line 2526 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawLineClip ( int  x1,
int  y1,
int  x2,
int  y2,
Common::Rect  clipping 
) [virtual]

Implements Graphics::VectorRenderer.

Definition at line 1242 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawRoundedSquare ( int  x,
int  y,
int  r,
int  w,
int  h 
) [virtual]

ROUNDED SQUARES.

Implements Graphics::VectorRenderer.

Definition at line 1515 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawRoundedSquareAlg ( int  x1,
int  y1,
int  r,
int  w,
int  h,
PixelType  color,
VectorRenderer::FillMode  fill_m 
) [protected, virtual]

Reimplemented in Graphics::VectorRendererAA< PixelType >.

Definition at line 3338 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawRoundedSquareAlgClip ( int  x1,
int  y1,
int  r,
int  w,
int  h,
PixelType  color,
VectorRenderer::FillMode  fill_m 
) [protected, virtual]

Definition at line 3369 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawRoundedSquareClip ( int  x,
int  y,
int  r,
int  w,
int  h,
Common::Rect  clipping 
) [virtual]

Implements Graphics::VectorRenderer.

Definition at line 1538 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawRoundedSquareShadow ( int  x,
int  y,
int  r,
int  w,
int  h,
int  offset 
) [protected, virtual]

Reimplemented in Graphics::VectorRendererAA< PixelType >.

Definition at line 3582 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawRoundedSquareShadowClip ( int  x,
int  y,
int  r,
int  w,
int  h,
int  offset 
) [protected, virtual]

Definition at line 3667 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawSquare ( int  x,
int  y,
int  w,
int  h 
) [virtual]

SQUARES.

Implements Graphics::VectorRenderer.

Definition at line 1417 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawSquareAlg ( int  x,
int  y,
int  w,
int  h,
PixelType  color,
VectorRenderer::FillMode  fill_m 
) [protected, virtual]

SQUARE ALGORITHM.

Definition at line 2269 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawSquareAlgClip ( int  x,
int  y,
int  w,
int  h,
PixelType  color,
VectorRenderer::FillMode  fill_m 
) [protected, virtual]

Definition at line 2306 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawSquareClip ( int  x,
int  y,
int  w,
int  h,
Common::Rect  clipping 
) [virtual]

Implements Graphics::VectorRenderer.

Definition at line 1453 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawSquareShadow ( int  x,
int  y,
int  w,
int  h,
int  offset 
) [protected, virtual]

SHADOW DRAWING ALGORITHMS.

Optimized versions of the primitive drawing algorithms with alpha blending for shadow drawing. There functions may be overloaded in inheriting classes to improve performance in the slowest platforms where pixel alpha blending just doesn't cut it.

Parameters:
offset Intensity/size of the shadow.

Definition at line 3493 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawSquareShadowClip ( int  x,
int  y,
int  w,
int  h,
int  offset 
) [protected, virtual]

Definition at line 3534 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawString ( const Graphics::Font font,
const Common::String text,
const Common::Rect area,
Graphics::TextAlign  alignH,
GUI::ThemeEngine::TextAlignVertical  alignV,
int  deltax,
bool  useEllipsis,
const Common::Rect textDrawableArea = Common::Rect(0, 0, 0, 0) 
) [virtual]

Draws a string into the screen.

Wrapper for the Graphics::Font string drawing method.

Implements Graphics::VectorRenderer.

Definition at line 1139 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawTab ( int  x,
int  y,
int  r,
int  w,
int  h 
) [virtual]

Draws a tab-like shape, specially thought for the Tab widget.

If a radius is given, the tab will have rounded corners. Otherwise, the tab will be squared.

Parameters:
x Horizontal (X) coordinate for the tab
y Vertical (Y) coordinate for the tab
w Width of the tab
h Height of the tab
r Radius of the corners of the tab (0 for squared tabs).

Implements Graphics::VectorRenderer.

Definition at line 1575 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawTabAlg ( int  x,
int  y,
int  w,
int  h,
int  r,
PixelType  color,
VectorRenderer::FillMode  fill_m,
int  baseLeft = 0,
int  baseRight = 0 
) [protected, virtual]

TAB ALGORITHM - NON AA.

Reimplemented in Graphics::VectorRendererAA< PixelType >.

Definition at line 1829 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawTabAlgClip ( int  x,
int  y,
int  w,
int  h,
int  r,
PixelType  color,
VectorRenderer::FillMode  fill_m,
int  baseLeft = 0,
int  baseRight = 0 
) [protected, virtual]

Definition at line 1931 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawTabClip ( int  x,
int  y,
int  r,
int  w,
int  h,
Common::Rect  clipping 
) [virtual]

Implements Graphics::VectorRenderer.

Definition at line 1611 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawTabShadow ( int  x,
int  y,
int  w,
int  h,
int  r 
) [protected, virtual]

Definition at line 2046 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawTabShadowClip ( int  x,
int  y,
int  w,
int  h,
int  r 
) [protected, virtual]

Definition at line 2107 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawTriangle ( int  x,
int  y,
int  base,
int  height,
TriangleOrientation  orient 
) [virtual]

Draws a triangle starting at (x,y) with the given base and height.

The triangle will always be isosceles, with the given base and height. The orientation parameter controls the position of the base of the triangle.

Parameters:
x Horizontal (X) coordinate for the top left corner of the triangle
y Vertical (Y) coordinate for the top left corner of the triangle
base Width of the base of the triangle
height Height of the triangle
orient Orientation of the triangle.

Implements Graphics::VectorRenderer.

Definition at line 1671 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawTriangleClip ( int  x,
int  y,
int  base,
int  height,
TriangleOrientation  orient,
Common::Rect  clipping 
) [virtual]

Implements Graphics::VectorRenderer.

Definition at line 1739 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawTriangleFast ( int  x,
int  y,
int  size,
bool  inverted,
PixelType  color,
VectorRenderer::FillMode  fill_m 
) [protected, virtual]

VERTICAL TRIANGLE DRAWING - FAST VERSION FOR SQUARED TRIANGLES.

Definition at line 2984 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawTriangleVertAlg ( int  x,
int  y,
int  w,
int  h,
bool  inverted,
PixelType  color,
VectorRenderer::FillMode  fill_m 
) [protected, virtual]

Definition at line 2598 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::drawTriangleVertAlgClip ( int  x,
int  y,
int  w,
int  h,
bool  inverted,
PixelType  color,
VectorRenderer::FillMode  fill_m 
) [protected, virtual]

Definition at line 2779 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::fillSurface (  )  [virtual]

Fills the active surface with the specified fg/bg color or the active gradient.

Defaults to using the active Foreground color for filling.

Implements Graphics::VectorRenderer.

Definition at line 690 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::fillSurfaceClip ( Common::Rect  clipping  )  [virtual]

Implements Graphics::VectorRenderer.

Definition at line 713 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::gradientFill ( PixelType *  first,
int  width,
int  x,
int  y 
) [protected]

Definition at line 606 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::gradientFillClip ( PixelType *  first,
int  width,
int  x,
int  y,
int  realX,
int  realY 
) [protected]

Definition at line 647 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::precalcGradient ( int  h  )  [protected]

Definition at line 588 of file VectorRendererSpec.cpp.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::putPixel ( int  x,
int  y,
PixelType  color 
) [inline, protected]

Draws a single pixel on the surface with the given coordinates and the given color.

Parameters:
x Horizontal coordinate of the pixel.
y Vertical coordinate of the pixel.
color Color of the pixel

Definition at line 118 of file VectorRendererSpec.h.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::setBevelColor ( uint8  r,
uint8  g,
uint8  b 
) [inline, virtual]

Implements Graphics::VectorRenderer.

Definition at line 85 of file VectorRendererSpec.h.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::setBgColor ( uint8  r,
uint8  g,
uint8  b 
) [inline, virtual]

Set the active background painting color for the renderer.

All the background drawing from then on will be done with that color, unless specified otherwise.

Background drawing means all the shape filling.

Parameters:
r value of the red color byte
g value of the green color byte
b value of the blue color byte

Implements Graphics::VectorRenderer.

Definition at line 84 of file VectorRendererSpec.h.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::setFgColor ( uint8  r,
uint8  g,
uint8  b 
) [inline, virtual]

Set the active foreground painting color for the renderer.

All the foreground drawing from then on will be done with that color, unless specified otherwise.

Foreground drawing means all outlines and basic shapes.

Parameters:
r value of the red color byte
g value of the green color byte
b value of the blue color byte

Implements Graphics::VectorRenderer.

Definition at line 83 of file VectorRendererSpec.h.

template<typename PixelType >
void Graphics::VectorRendererSpec< PixelType >::setGradientColors ( uint8  r1,
uint8  g1,
uint8  b1,
uint8  r2,
uint8  g2,
uint8  b2 
) [virtual]

Set the active gradient color.

All shapes drawn using kFillGradient as their fill mode will use this VERTICAL gradient as their fill color.

Parameters:
r1 value of the red color byte for the start color
g1 value of the green color byte for the start color
b1 value of the blue color byte for the start color
r2 value of the red color byte for the end color
g2 value of the green color byte for the end color
b2 value of the blue color byte for the end color

Implements Graphics::VectorRenderer.

Definition at line 551 of file VectorRendererSpec.cpp.


Member Data Documentation

template<typename PixelType >
const PixelType Graphics::VectorRendererSpec< PixelType >::_alphaMask [protected]

Definition at line 312 of file VectorRendererSpec.h.

template<typename PixelType >
PixelType Graphics::VectorRendererSpec< PixelType >::_bevelColor [protected]

Definition at line 325 of file VectorRendererSpec.h.

template<typename PixelType >
PixelType Graphics::VectorRendererSpec< PixelType >::_bgColor [protected]

Background color currently being used to draw on the renderer.

Definition at line 315 of file VectorRendererSpec.h.

template<typename PixelType >
PixelType Graphics::VectorRendererSpec< PixelType >::_bitmapAlphaColor [protected]

Definition at line 326 of file VectorRendererSpec.h.

template<typename PixelType >
const PixelType Graphics::VectorRendererSpec< PixelType >::_blueMask [protected]

Definition at line 312 of file VectorRendererSpec.h.

template<typename PixelType >
Common::Rect Graphics::VectorRendererSpec< PixelType >::_clippingArea [protected]

Definition at line 108 of file VectorRendererSpec.h.

template<typename PixelType >
PixelType Graphics::VectorRendererSpec< PixelType >::_fgColor [protected]

Foreground color currently being used to draw on the renderer.

Definition at line 314 of file VectorRendererSpec.h.

template<typename PixelType >
const PixelFormat Graphics::VectorRendererSpec< PixelType >::_format [protected]

Definition at line 311 of file VectorRendererSpec.h.

template<typename PixelType >
Common::Array<PixelType> Graphics::VectorRendererSpec< PixelType >::_gradCache [protected]

Definition at line 322 of file VectorRendererSpec.h.

template<typename PixelType >
int Graphics::VectorRendererSpec< PixelType >::_gradientBytes[3] [protected]

Color bytes of the active gradient, used to speed up calculation.

Definition at line 320 of file VectorRendererSpec.h.

template<typename PixelType >
PixelType Graphics::VectorRendererSpec< PixelType >::_gradientEnd [protected]

End color for the fill gradient.

Definition at line 318 of file VectorRendererSpec.h.

template<typename PixelType >
PixelType Graphics::VectorRendererSpec< PixelType >::_gradientStart [protected]

Start color for the fill gradient.

Definition at line 317 of file VectorRendererSpec.h.

template<typename PixelType >
Common::Array<int> Graphics::VectorRendererSpec< PixelType >::_gradIndexes [protected]

Definition at line 323 of file VectorRendererSpec.h.

template<typename PixelType >
const PixelType Graphics::VectorRendererSpec< PixelType >::_greenMask [protected]

Definition at line 312 of file VectorRendererSpec.h.

template<typename PixelType >
const PixelType Graphics::VectorRendererSpec< PixelType >::_redMask [protected]

Definition at line 312 of file VectorRendererSpec.h.


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


Generated on Sat Sep 14 2019 05:04:14 for ResidualVM by doxygen 1.7.1
curved edge   curved edge