ScummVM API documentation
Graphics::VectorRendererAA< PixelType > Class Template Reference

#include <VectorRendererSpec.h>

Inheritance diagram for Graphics::VectorRendererAA< PixelType >:
Graphics::VectorRendererSpec< PixelType > Graphics::VectorRenderer

Public Member Functions

 VectorRendererAA (PixelFormat format)
 
- Public Member Functions inherited from Graphics::VectorRendererSpec< PixelType >
 VectorRendererSpec (PixelFormat format)
 
void drawLine (int x1, int y1, int x2, int y2) override
 
void drawCircle (int x, int y, int r) override
 
void drawSquare (int x, int y, int w, int h) override
 
void drawRoundedSquare (int x, int y, int r, int w, int h) override
 
void drawTriangle (int x, int y, int base, int height, TriangleOrientation orient) override
 
void drawTab (int x, int y, int r, int w, int h, int s) override
 
void drawBeveledSquare (int x, int y, int w, int h) override
 
void drawString (const Graphics::Font *font, const Common::U32String &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)) override
 
void setFgColor (uint8 r, uint8 g, uint8 b) override
 
void setBgColor (uint8 r, uint8 g, uint8 b) override
 
void setBevelColor (uint8 r, uint8 g, uint8 b) override
 
void setGradientColors (uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2) override
 
void setClippingRect (const Common::Rect &clippingArea) override
 
void copyFrame (OSystem *sys, const Common::Rect &r) override
 
void copyWholeFrame (OSystem *sys) override
 
void fillSurface () override
 
void blitSurface (const Graphics::ManagedSurface *source, const Common::Rect &r) override
 
void blitManagedSurface (const Graphics::ManagedSurface *source, const Common::Point &p, Graphics::AlphaType alphaType) override
 
void applyScreenShading (GUI::ThemeEngine::ShadingStyle shadingStyle) override
 
- Public Member Functions inherited from Graphics::VectorRenderer
virtual void drawCross (int x, int y, int w, int h)
 
virtual void setSurface (ManagedSurface *surface)
 
virtual ManagedSurfacegetActiveSurface ()
 
virtual void clearSurface ()
 
virtual void setFillMode (FillMode mode)
 
virtual void setShadowFillMode (ShadowFillMode mode)
 
virtual void setStrokeWidth (int width)
 
virtual void setShadowOffset (int offset)
 
virtual void setBevel (int amount)
 
virtual void setGradientFactor (int factor)
 
virtual void setShadowIntensity (uint32 shadowIntensity)
 
void stepGetPositions (const DrawStep &step, const Common::Rect &area, uint16 &in_x, uint16 &in_y, uint16 &in_w, uint16 &in_h)
 
int stepGetRadius (const DrawStep &step, const Common::Rect &area)
 
Common::Rect applyStepClippingRect (const Common::Rect &area, const Common::Rect &clip, const DrawStep &step)
 
void drawCallback_CIRCLE (const Common::Rect &area, const DrawStep &step)
 
void drawCallback_SQUARE (const Common::Rect &area, const DrawStep &step)
 
void drawCallback_LINE (const Common::Rect &area, const DrawStep &step)
 
void drawCallback_ROUNDSQ (const Common::Rect &area, const DrawStep &step)
 
void drawCallback_FILLSURFACE (const Common::Rect &area, const DrawStep &step)
 
void drawCallback_TRIANGLE (const Common::Rect &area, const DrawStep &step)
 
void drawCallback_BEVELSQ (const Common::Rect &area, const DrawStep &step)
 
void drawCallback_TAB (const Common::Rect &area, const DrawStep &step)
 
void drawCallback_BITMAP (const Common::Rect &area, const DrawStep &step)
 
void drawCallback_CROSS (const Common::Rect &area, const DrawStep &step)
 
void drawCallback_VOID (const Common::Rect &area, const DrawStep &step)
 
virtual void drawStep (const Common::Rect &area, const Common::Rect &clip, const DrawStep &step, uint32 extra=0)
 
virtual void disableShadows ()
 
virtual void enableShadows ()
 

Protected Member Functions

virtual void drawLineAlg (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, VectorRenderer::FillMode fill_m)
 
virtual void drawRoundedSquareAlg (int x1, int y1, int r, int w, int h, PixelType color, VectorRenderer::FillMode fill_m)
 
virtual void drawBorderRoundedSquareAlg (int x1, int y1, int r, int w, int h, PixelType color, VectorRenderer::FillMode fill_m, uint8 alpha_t, uint8 alpha_l, uint8 alpha_r, uint8 alpha_b)
 
virtual void drawInteriorRoundedSquareAlg (int x1, int y1, int r, int w, int h, PixelType color, VectorRenderer::FillMode fill_m)
 
virtual void drawRoundedSquareShadow (int x, int y, int r, int w, int h, int offset, uint32 shadowIntensity)
 
virtual void drawTabAlg (int x, int y, int w, int h, int r, PixelType color, VectorRenderer::FillMode fill_m, int baseLeft, int baseRight, bool vFlip)
 
- Protected Member Functions inherited from Graphics::VectorRendererSpec< PixelType >
void putPixel (int x, int y, PixelType color)
 
void blendPixel (int x, int y, PixelType color, uint8 alpha)
 
void blendPixelPtr (PixelType *ptr, PixelType color, uint8 alpha)
 
void blendPixelPtrClip (PixelType *ptr, PixelType color, uint8 alpha, int x, int y)
 
void blendPixelDestAlphaPtr (PixelType *ptr, PixelType color, uint8 alpha)
 
virtual void drawLineAlgClip (int x1, int y1, int x2, int y2, uint dx, uint dy, PixelType color)
 
virtual void drawCircleAlgClip (int x, int y, int r, 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 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 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)
 
virtual void drawSquareAlgClip (int x, int y, int w, int h, PixelType color, FillMode fill_m)
 
virtual void drawTriangleHorzAlg (int x, int y, int w, int h, bool inverted, PixelType color, FillMode fill_m)
 
virtual void drawTriangleHorzAlgClip (int x, int y, int w, int h, bool inverted, PixelType color, FillMode fill_m)
 
virtual void drawTriangleFastH (int x, int y, int size, bool inverted, 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 drawTriangleFastV (int x, int y, int size, bool inverted, PixelType color, FillMode fill_m)
 
virtual void drawBevelSquareAlg (int x, int y, int w, int h, int bevel, PixelType top_color, PixelType bottom_color)
 
virtual void drawBevelSquareAlgClip (int x, int y, int w, int h, int bevel, PixelType top_color, PixelType bottom_color)
 
virtual void drawTabAlgClip (int x, int y, int w, int h, int r, PixelType color, VectorRenderer::FillMode fill_m, int baseLeft, int baseRight, bool vFlip)
 
virtual void drawTabShadow (int x, int y, int w, int h, int r, int offset, uint32 shadowIntensity, bool vFlip)
 
virtual void drawTabShadowClip (int x, int y, int w, int h, int r, int offset, uint32 shadowIntensity, bool vFlip)
 
virtual void drawBevelTabAlg (int x, int y, int w, int h, int bevel, PixelType topColor, PixelType bottomColor, int baseLeft, int baseRight, bool vFlip)
 
virtual void drawBevelTabAlgClip (int x, int y, int w, int h, int bevel, PixelType topColor, PixelType bottomColor, int baseLeft, int baseRight, bool vFlip)
 
virtual void drawSquareShadow (int x, int y, int w, int h, int offset)
 
virtual void drawSquareShadowClip (int x, int y, int w, int h, int offset)
 
virtual void drawRoundedSquareShadowClip (int x, int y, int r, int w, int h, int offset, uint32 shadowIntensity)
 
PixelType calcGradient (uint32 pos, uint32 max)
 
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)
 
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)
 

Additional Inherited Members

- Public Types inherited from Graphics::VectorRenderer
enum  FillMode { kFillDisabled = 0, kFillForeground = 1, kFillBackground = 2, kFillGradient = 3 }
 
enum  TriangleOrientation {
  kTriangleAuto = 0, kTriangleUp, kTriangleDown, kTriangleLeft,
  kTriangleRight
}
 
enum  ShadowFillMode { kShadowLinear = 0, kShadowExponential = 1 }
 
- Protected Attributes inherited from Graphics::VectorRendererSpec< PixelType >
Common::Rect _clippingArea
 
const PixelFormat _format
 
const PixelType _redMask
 
const PixelType _greenMask
 
const PixelType _blueMask
 
const PixelType _alphaMask
 
PixelType _fgColor
 
PixelType _bgColor
 
PixelType _gradientStart
 
PixelType _gradientEnd
 
int _gradientBytes [3]
 
Common::Array< PixelType > _gradCache
 
Common::Array< int > _gradIndexes
 
PixelType _bevelColor
 
- Protected Attributes inherited from Graphics::VectorRenderer
ManagedSurface_activeSurface
 
FillMode _fillMode
 
ShadowFillMode _shadowFillMode
 
int _shadowOffset
 
int _bevel
 
bool _disableShadows
 
int _strokeWidth
 
uint32 _dynamicData
 
int _gradientFactor
 
uint32 _shadowIntensity
 

Detailed Description

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

VectorRendererAA: Anti-Aliased Vector Renderer Class

This templated class inherits all the functionality of the VectorRendererSpec class but uses better looking yet slightly slower AA algorithms for drawing most primitives. May be used in faster platforms.

TODO: Expand documentation.

See also
VectorRenderer
VectorRendererSpec

Member Function Documentation

◆ drawLineAlg()

template<typename PixelType >
virtual void Graphics::VectorRendererAA< PixelType >::drawLineAlg ( int  x1,
int  y1,
int  x2,
int  y2,
uint  dx,
uint  dy,
PixelType  color 
)
protectedvirtual

"Wu's Line Antialiasing Algorithm" as published by Xiaolin Wu, July 1991 Based on the implementation found in Michael Abrash's Graphics Programming Black Book.

Generic line drawing algorithm for the Antialiased renderer. Optimized with no floating point operations, assumes no special cases.

See also
VectorRenderer::drawLineAlg()

Reimplemented from Graphics::VectorRendererSpec< PixelType >.

◆ drawCircleAlg()

template<typename PixelType >
virtual void Graphics::VectorRendererAA< PixelType >::drawCircleAlg ( int  x,
int  y,
int  r,
PixelType  color,
VectorRenderer::FillMode  fill_m 
)
protectedvirtual

"Wu's Circle Antialiasing Algorithm" as published by Xiaolin Wu, July 1991 Based on the theoretical concept of the algorithm.

Implementation of Wu's algorithm for circles using fixed point arithmetics. Could be quite fast.

See also
VectorRenderer::drawCircleAlg()

Reimplemented from Graphics::VectorRendererSpec< PixelType >.

◆ drawRoundedSquareAlg()

template<typename PixelType >
virtual void Graphics::VectorRendererAA< PixelType >::drawRoundedSquareAlg ( int  x1,
int  y1,
int  r,
int  w,
int  h,
PixelType  color,
VectorRenderer::FillMode  fill_m 
)
protectedvirtual

"Wu's Circle Antialiasing Algorithm" as published by Xiaolin Wu, July 1991, modified with corner displacement to allow drawing of squares with rounded corners.

See also
VectorRenderer::drawRoundedAlg()

Reimplemented from Graphics::VectorRendererSpec< PixelType >.


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