Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

shape.cc File Reference

#include "swf.h"
#include "math.h"

Include dependency graph for shape.cc:

Go to the source code of this file.

Defines

#define PRINT   0
#define ABS(v)   ((v) < 0 ? -(v) : (v))
#define BFRAC_BITS   0
#define BFRAC   (1 << BFRAC_BITS)
#define UL   ls->x1 + nx -ny, ls->y1 + ny +nx
#define UR   ls->x2 + nx +ny, ls->y2 + ny -nx
#define LL   ls->x1 - nx -ny, ls->y1 - ny +nx
#define LR   ls->x2 - nx +ny, ls->y2 - ny -nx

Functions

static void prepareStyles (GraphicDevice *gd, Matrix *matrix, Cxform *cxform, FillStyleDef *f, long n)
static void clearStyles (GraphicDevice *gd, FillStyleDef *f, long n)
static void drawShape (GraphicDevice *gd, Matrix *matrix1, Cxform *cxform, Shape *shape, ShapeAction shapeAction, void *id, ScanLineFunc scan_line_func)
static void newPath (ShapeParser *shape, long x, long y)
static void addSegment1 (ShapeParser *shape, long x, long y, FillStyleDef *f0, FillStyleDef *f1, LineStyleDef *l)
static void addLine (ShapeParser *shape, long x, long y, FillStyleDef *f0, FillStyleDef *f1, LineStyleDef *l)
static void bezierBuildPoints (ShapeParser *s, int subdivisions, long a1X, long a1Y, long cX, long cY, long a2X, long a2Y)
static void flushPaths (ShapeParser *s)
static void addBezier (ShapeParser *shape, long ctrlX1, long ctrlY1, long newX1, long newY1, FillStyleDef *f0, FillStyleDef *f1, LineStyleDef *l)
static void InitBitParser (struct BitParser *b, U8 *buf)
static void InitBits (struct BitParser *b)
static U8 GetByte (struct BitParser *b)
static U16 GetWord (struct BitParser *b)
static U32 GetDWord (struct BitParser *b)
static U32 GetBit (struct BitParser *b)
static U32 GetBits (struct BitParser *b, int n)
static S32 GetSBits (struct BitParser *b, S32 n)
static void GetMatrix (BitParser *b, Matrix *mat)
static FillStyleDefParseFillStyle (ShapeParser *shape, long *n, long getAlpha)
static LineStyleDefParseLineStyle (ShapeParser *shape, long *n, long getAlpha)
static int ParseShapeRecord (ShapeParser *shape, ShapeRecord *sr, long getAlpha)


Define Documentation

#define ABS v   )     ((v) < 0 ? -(v) : (v))
 

Definition at line 33 of file shape.cc.

Referenced by flushPaths().

#define BFRAC   (1 << BFRAC_BITS)
 

Definition at line 201 of file shape.cc.

Referenced by bezierBuildPoints().

#define BFRAC_BITS   0
 

Definition at line 200 of file shape.cc.

Referenced by addBezier(), and bezierBuildPoints().

#define LL   ls->x1 - nx -ny, ls->y1 - ny +nx
 

Referenced by flushPaths().

#define LR   ls->x2 - nx +ny, ls->y2 - ny -nx
 

Referenced by flushPaths().

#define PRINT   0
 

Definition at line 31 of file shape.cc.

#define UL   ls->x1 + nx -ny, ls->y1 + ny +nx
 

Referenced by ExpandTextArea(), flushPaths(), GlueFreeBlocks(), RCheckers::go1(), ECheckers::go1(), BLK_NODE::insert(), RCheckers::kingCapture1(), ECheckers::kingCapture1(), RCheckers::kingCapture2(), ECheckers::kingCapture2(), RCheckers::manCapture1(), ECheckers::manCapture1(), RCheckers::manCapture2(), ECheckers::manCapture2(), SpecialFreeUnit(), and Checkers::turn().

#define UR   ls->x2 + nx +ny, ls->y2 + ny -nx
 

Referenced by flushPaths(), RCheckers::go1(), ECheckers::go1(), RCheckers::kingCapture1(), ECheckers::kingCapture1(), RCheckers::kingCapture2(), ECheckers::kingCapture2(), RCheckers::manCapture1(), ECheckers::manCapture1(), RCheckers::manCapture2(), ECheckers::manCapture2(), and Checkers::turn().


Function Documentation

static void addBezier ShapeParser shape,
long  ctrlX1,
long  ctrlY1,
long  newX1,
long  newY1,
FillStyleDef f0,
FillStyleDef f1,
LineStyleDef l
[static]
 

Definition at line 361 of file shape.cc.

References bezierBuildPoints(), BFRAC_BITS, Path::lastX, Path::lastY, Path::nb_edges, and p.

Referenced by drawShape().

static void addLine ShapeParser shape,
long  x,
long  y,
FillStyleDef f0,
FillStyleDef f1,
LineStyleDef l
[static]
 

Definition at line 179 of file shape.cc.

References addSegment1(), Path::nb_edges, and p.

Referenced by drawShape().

static void addSegment1 ShapeParser shape,
long  x,
long  y,
FillStyleDef f0,
FillStyleDef f1,
LineStyleDef l
[static]
 

Definition at line 134 of file shape.cc.

References LineSegment::first, LineSegment::l, Path::lastX, Path::lastY, Path::nb_segments, LineSegment::next, NULL, p, LineSegment::x1, LineSegment::x2, LineSegment::y1, and LineSegment::y2.

Referenced by addLine(), and bezierBuildPoints().

static void bezierBuildPoints ShapeParser s,
int  subdivisions,
long  a1X,
long  a1Y,
long  cX,
long  cY,
long  a2X,
long  a2Y
[static]
 

Definition at line 204 of file shape.cc.

References addSegment1(), BFRAC, BFRAC_BITS, ShapeParser::f0, ShapeParser::f1, FRAC, ShapeParser::l, and X.

Referenced by addBezier().

static void clearStyles GraphicDevice gd,
FillStyleDef f,
long  n
[static]
 

Definition at line 1177 of file shape.cc.

References FillStyleDef::alpha_table, FillStyleDef::bitmap, FillStyleDef::cmap, Bitmap::colormap, f, f_clippedBitmap, f_LinearGradient, f_None, f_RadialGradient, f_Solid, f_TiledBitmap, FillStyleDef::gradient, Gradient::ramp, and FillStyleDef::type.

Referenced by drawShape().

static void drawShape GraphicDevice gd,
Matrix matrix1,
Cxform cxform,
Shape shape,
ShapeAction  shapeAction,
void *  id,
ScanLineFunc  scan_line_func
[static]
 

Definition at line 796 of file shape.cc.

References Matrix::a, addBezier(), addLine(), GraphicDevice::adjust, ShapeRecord::anchorX, ShapeRecord::anchorY, ShapeParser::bit_parser, clearStyles(), ShapeRecord::ctrlX, ShapeRecord::ctrlY, ShapeParser::curPath, ShapeParser::cxform, Matrix::d, Shape::defaultFillStyle, Shape::dict, ShapeParser::dict, ShapeRecord::dX, ShapeRecord::dY, Shape::file_ptr, ShapeRecord::fillStyle0, ShapeRecord::fillStyle1, ShapeParser::first_line, ShapeRecord::flags, flagsFill0, flagsFill1, flagsLine, flagsMoveTo, flagsNewStyles, flushPaths(), ShapeParser::gd, Shape::getAlpha, GetBits(), Shape::getStyles, InitBitParser(), InitBits(), ShapeParser::last_line, ShapeRecord::lineStyle, ShapeParser::m_nFillBits, ShapeParser::m_nLineBits, ShapeParser::matrix, Path::nb_edges, ShapeRecord::nbNewFillStyles, StyleList::nbNewFillStyles, ShapeRecord::nbNewLineStyles, StyleList::nbNewLineStyles, ShapeRecord::newFillStyles, StyleList::newFillStyles, ShapeRecord::newLineStyles, StyleList::newLineStyles, newPath(), StyleList::next, NULL, ParseFillStyle(), ParseLineStyle(), ParseShapeRecord(), prepareStyles(), printf, ShapeParser::reverse, GraphicDevice::scan_line_func, GraphicDevice::scan_line_func_id, ShapeParser::shape, shapeCurve, ShapeDraw, ShapeGetRegion, shapeLine, shapeNonEdge, ShapeParser::style_list, ShapeRecord::type, ShapeRecord::x, and ShapeRecord::y.

Referenced by Shape::execute(), and Shape::getRegion().

static void flushPaths ShapeParser s  )  [static]
 

Definition at line 268 of file shape.cc.

References Matrix::a, ABS, GraphicDevice::addSegment(), FillStyleDef::color, GraphicDevice::drawLine(), GraphicDevice::drawPolygon(), LineStyleDef::fillstyle, ShapeParser::first_line, FRAC, ShapeParser::gd, LineSegment::l, l, ShapeParser::last_line, LL, LR, ShapeParser::matrix, LineSegment::next, NULL, printf, GraphicDevice::scan_line_func, GraphicDevice::setForegroundColor(), sqrt(), UL, UR, LineStyleDef::width, LineSegment::x1, LineSegment::x2, LineSegment::y1, and LineSegment::y2.

Referenced by drawShape().

static U32 GetBit struct BitParser b  )  [inline, static]
 

Definition at line 439 of file shape.cc.

References BitParser::m_bitBuf, BitParser::m_bitPos, BitParser::ptr, and v.

Referenced by GetMatrix(), and ParseShapeRecord().

static U32 GetBits struct BitParser b,
int  n
[inline, static]
 

Definition at line 461 of file shape.cc.

References BitParser::m_bitBuf, BitParser::m_bitPos, BitParser::ptr, and v.

Referenced by drawShape(), GetMatrix(), GetSBits(), and ParseShapeRecord().

static U8 GetByte struct BitParser b  )  [inline, static]
 

Definition at line 412 of file shape.cc.

References BitParser::ptr, and v.

Referenced by ParseFillStyle(), and ParseLineStyle().

static U32 GetDWord struct BitParser b  )  [inline, static]
 

Definition at line 429 of file shape.cc.

References BitParser::ptr, and v.

static void GetMatrix BitParser b,
Matrix mat
[static]
 

Definition at line 504 of file shape.cc.

References Matrix::a, Matrix::b, Matrix::c, Matrix::d, GetBit(), GetBits(), GetSBits(), InitBits(), Matrix::tx, and Matrix::ty.

Referenced by ParseFillStyle().

static S32 GetSBits struct BitParser b,
S32  n
[inline, static]
 

Definition at line 485 of file shape.cc.

References GetBits(), and v.

Referenced by GetMatrix(), and ParseShapeRecord().

static U16 GetWord struct BitParser b  )  [inline, static]
 

Definition at line 419 of file shape.cc.

References BitParser::ptr, and v.

Referenced by ParseFillStyle(), and ParseLineStyle().

static void InitBitParser struct BitParser b,
U8 buf
[static]
 

Definition at line 398 of file shape.cc.

References BitParser::ptr.

Referenced by drawShape().

static void InitBits struct BitParser b  )  [static]
 

Definition at line 403 of file shape.cc.

References BitParser::m_bitBuf, and BitParser::m_bitPos.

Referenced by drawShape(), GetMatrix(), and ParseShapeRecord().

static void newPath ShapeParser shape,
long  x,
long  y
[static]
 

Definition at line 115 of file shape.cc.

References ShapeParser::curPath, Matrix::getX(), Matrix::getY(), Path::lastX, Path::lastY, ShapeParser::matrix, Path::nb_edges, Path::nb_segments, and p.

Referenced by QDir::cleanDirPath(), and drawShape().

static FillStyleDef* ParseFillStyle ShapeParser shape,
long *  n,
long  getAlpha
[static]
 

Definition at line 538 of file shape.cc.

References Color::alpha, ALPHA_OPAQUE, ShapeParser::bit_parser, FillStyleDef::bitmap, Color::blue, FillStyleDef::color, Gradient::color, ShapeParser::dict, GetByte(), Dict::getCharacter(), GetMatrix(), GetWord(), FillStyleDef::gradient, Color::green, i, Gradient::nbGradients, NULL, Gradient::ratio, Color::red, and FillStyleDef::type.

Referenced by drawShape(), and ParseShapeRecord().

static LineStyleDef* ParseLineStyle ShapeParser shape,
long *  n,
long  getAlpha
[static]
 

Definition at line 617 of file shape.cc.

References GraphicDevice::allocColor(), Color::alpha, ALPHA_OPAQUE, ShapeParser::bit_parser, Color::blue, FillStyleDef::color, LineStyleDef::color, ShapeParser::cxform, f, f_Solid, LineStyleDef::fillstyle, ShapeParser::gd, GetByte(), Cxform::getColor(), GetWord(), Color::green, i, NULL, Color::pixel, Color::red, FillStyleDef::type, and LineStyleDef::width.

Referenced by drawShape(), and ParseShapeRecord().

static int ParseShapeRecord ShapeParser shape,
ShapeRecord sr,
long  getAlpha
[static]
 

Definition at line 665 of file shape.cc.

References ShapeRecord::anchorX, ShapeRecord::anchorY, ShapeParser::bit_parser, ShapeRecord::ctrlX, ShapeRecord::ctrlY, ShapeRecord::dX, ShapeRecord::dY, ShapeRecord::fillStyle0, ShapeRecord::fillStyle1, ShapeRecord::flags, flags, flagsEndShape, flagsFill0, flagsFill1, flagsLine, flagsMoveTo, flagsNewStyles, GetBit(), GetBits(), GetSBits(), InitBits(), ShapeRecord::lineStyle, ShapeParser::m_nFillBits, ShapeParser::m_nLineBits, ShapeRecord::nbNewFillStyles, ShapeRecord::nbNewLineStyles, ShapeRecord::newFillStyles, ShapeRecord::newLineStyles, NULL, ParseFillStyle(), ParseLineStyle(), shapeCurve, shapeLine, shapeNonEdge, ShapeRecord::type, ShapeRecord::x, and ShapeRecord::y.

Referenced by drawShape().

static void prepareStyles GraphicDevice gd,
Matrix matrix,
Cxform cxform,
FillStyleDef f,
long  n
[static]
 

Definition at line 1014 of file shape.cc.

References Matrix::a, GraphicDevice::allocColor(), Color::alpha, alpha, Bitmap::alpha_buf, ALPHA_OPAQUE, FillStyleDef::alpha_table, Matrix::b, FillStyleDef::bitmap, FillStyleDef::bitmap_matrix, Color::blue, Matrix::c, FillStyleDef::cmap, Gradient::color, FillStyleDef::color, Bitmap::colormap, Matrix::d, end, f, f_clippedBitmap, f_LinearGradient, f_None, f_RadialGradient, f_Solid, f_TiledBitmap, FRAC, Cxform::getAlpha(), Cxform::getColor(), GraphicDevice::getColormap(), FillStyleDef::gradient, Color::green, Gradient::has_alpha, i, Gradient::imat, Matrix::invert(), FillStyleDef::matrix, max, min, Bitmap::nbColors, Gradient::nbGradients, NULL, Color::pixel, Gradient::ramp, Gradient::ratio, Color::red, start, Matrix::tx, Matrix::ty, and FillStyleDef::type.

Referenced by drawShape().


Generated on Sat Nov 5 16:24:09 2005 for OPIE by  doxygen 1.4.2