Go to the documentation of this file.
20 #ifndef GNASH_SWF_SHAPERECORD_H
21 #define GNASH_SWF_SHAPERECORD_H
32 class movie_definition;
46 typedef std::vector<Path>
Paths;
83 _paths.push_back(
path);
87 _lineStyles.push_back(ls);
163 _subshapes.push_back(subshape);
185 for (
const Subshape& subshape : _subshapes) {
196 unsigned readStyleChange(
SWFStream& in,
size_t num_fill_bits,
size_t numStyles);
199 enum ShapeRecordFlags {
202 SHAPE_FILLSTYLE0_CHANGE = 0x02,
203 SHAPE_FILLSTYLE1_CHANGE = 0x04,
204 SHAPE_LINESTYLE_CHANGE = 0x08,
205 SHAPE_HAS_NEW_STYLES = 0x10
212 std::ostream&
operator<<(std::ostream&
o,
const ShapeRecord& sh);
bool pointTest(std::int32_t x, std::int32_t y, const SWFMatrix &wm) const
Definition: ShapeRecord.h:183
VGPath path
Definition: testr_gtk.cpp:84
void clear()
Definition: ShapeRecord.h:90
LineStyles & lineStyles()
Definition: ShapeRecord.h:60
point ap
Start point of the path.
Definition: Geometry.h:179
size_t size() const
Return the number of edges in this path.
Definition: Geometry.h:517
void ensureBits(unsigned long needed)
Ensure the requested number of bits are available for a bitwise read in currently opened tag.
Definition: SWFStream.h:382
unsigned read_uint(unsigned short bitcount)
Reads a bit-packed unsigned integer from the stream and returns it. The given bitcount determines the...
Definition: SWFStream.cpp:102
int read_sint(unsigned short bitcount)
Reads a bit-packed little-endian signed integer from the stream. The given bitcount determines the nu...
Definition: SWFStream.cpp:191
void log_swferror(StringType msg, Args... args)
Definition: log.h:325
SWFRect computeBounds(int swfVersion) const
Find the bounds of this subhape, and return them in a rectangle.
Definition: ShapeRecord.cpp:104
void read(SWFStream &in, SWF::TagType tag, movie_definition &m, const RunResources &r)
Parse path data from a SWFStream.
Definition: ShapeRecord.cpp:225
TagType
SWF tag types. Symbolic names copied from Ming.
Definition: SWF.h:31
unsigned getLineStyle() const
Definition: Geometry.h:511
point ap
Definition: Geometry.h:50
std::ostream & operator<<(std::ostream &o, const ShapeRecord &sh)
Definition: ShapeRecord.cpp:600
unsigned getLeftFill() const
Definition: Geometry.h:473
const FillStyles & fillStyles() const
Definition: ShapeRecord.h:48
@ DEFINESHAPE
Definition: SWF.h:34
std::vector< Subshape > Subshapes
Definition: ShapeRecord.h:132
void log_debug(StringType msg, Args... args)
Definition: log.h:301
std::int32_t y
Definition: BitmapData_as.cpp:435
@ i
Definition: GnashKey.h:155
@ DEFINEFONT2
Definition: SWF.h:78
#define LOG_ONCE(x)
Definition: log.h:49
void addFillStyle(const FillStyle &fs)
Definition: ShapeRecord.cpp:96
std::pair< FillStyle, boost::optional< FillStyle > > OptionalFillPair
Either a single or a morph-pair FillStyle.
Definition: TypesParser.h:52
bool empty() const
Return true if this path contains no edges.
Definition: Geometry.h:454
#define _(String)
Definition: log.h:44
const Subshapes & subshapes() const
Definition: ShapeRecord.h:158
DSOEXPORT void expand_to_rect(const SWFRect &r)
Makes union of the given and the current SWFRect.
Definition: SWFRect.cpp:56
FillStyle describes the various fill styles for shapes.
Definition: FillStyle.h:282
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
const SWFRect & getBounds() const
Definition: ShapeRecord.h:166
const Paths & paths() const
Definition: ShapeRecord.h:64
@ m
Definition: GnashKey.h:159
Paths & paths()
Definition: ShapeRecord.h:68
void setRightFill(unsigned f)
Set the fill to use on the left side.
Definition: Geometry.h:487
@ n
Definition: GnashKey.h:160
ShapeRecord()
Construct a ShapeRecord.
Definition: ShapeRecord.cpp:80
Subshape::Paths Paths
Definition: ShapeRecord.h:131
Definition: ShapeRecord.h:41
#define UNUSED(x)
Definition: utility.h:113
Client program's interface to the definition of a movie or sprite.
Definition: movie_definition.h:96
std::vector< LineStyle > LineStyles
Definition: ShapeRecord.h:45
void setLeftFill(unsigned f)
Set the fill to use on the left side.
Definition: Geometry.h:468
const LineStyles & lineStyles() const
Definition: ShapeRecord.h:56
@ k
Definition: GnashKey.h:157
std::vector< Path > Paths
Definition: ShapeRecord.h:46
#define IF_VERBOSE_MALFORMED_SWF(x)
Definition: log.h:404
Subshape::LineStyles LineStyles
Definition: ShapeRecord.h:130
Rectangle class, see swf defined rectangle record.
Definition: SWFRect.h:45
@ r
Definition: GnashKey.h:164
Subshape::FillStyles FillStyles
Definition: ShapeRecord.h:129
void for_each(C &container, R(T::*pmf)(const A &), const A &arg)
Definition: Renderer_ogl.cpp:690
unsigned getRightFill() const
Definition: Geometry.h:492
@ a
Definition: GnashKey.h:147
std::int32_t x
The x coordinate.
Definition: Point2d.h:43
void drawLineTo(std::int32_t dx, std::int32_t dy)
Draw a straight line.
Definition: Geometry.h:325
std::vector< FillStyle > FillStyles
Definition: ShapeRecord.h:44
@ DEFINESHAPE2
Definition: SWF.h:54
A subset of a shape, a series of edges sharing a single set of styles.
Definition: Geometry.h:167
For the outside of outline shapes, or just bare lines.
Definition: LineStyle.h:51
@ DEFINESHAPE4_
Definition: SWF.h:97
void addSubshape(const Subshape &subshape)
Definition: ShapeRecord.h:162
@ p
Definition: GnashKey.h:162
void setLerp(FillStyle &f, const FillStyle &a, const FillStyle &b, double t)
Set the FillStyle to a lerp of a and b.
Definition: FillStyle.cpp:221
FillStyles & fillStyles()
Definition: ShapeRecord.h:52
Class to group together per-run and external resources for Gnash.
Definition: RunResources.h:54
Definition: SWFMatrix.h:54
void set_lerp(const SWFRect &a, const SWFRect &b, float t)
Definition: SWFRect.cpp:107
@ DEFINEFONT3
Definition: SWF.h:105
@ j
Definition: GnashKey.h:156
Path & currentPath()
For DynamicShape.
Definition: ShapeRecord.h:76
bool pointTest(const std::vector< Path > &paths, const std::vector< LineStyle > &lineStyles, std::int32_t x, std::int32_t y, const SWFMatrix &wm)
Definition: Geometry.cpp:125
#define IF_VERBOSE_PARSE(x)
Definition: log.h:378
OptionalFillPair readFills(SWFStream &in, SWF::TagType t, movie_definition &md, bool readMorph)
Read FillStyles from a stream.
Definition: TypesParser.cpp:161
void log_parse(StringType msg, Args... args)
Definition: log.h:313
@ DEFINESHAPE4
Definition: SWF.h:110
void addPath(const Path &path)
Definition: ShapeRecord.h:82
pixel_iterator< T > end(GnashImage &im)
Definition: ImageIterators.h:198
std::uint16_t read_u16()
Read a aligned unsigned 16-bit value from the stream.
Definition: SWFStream.cpp:332
@ DEFINESHAPE3
Definition: SWF.h:62
void setLineStyle(unsigned i)
Set the line style to use for this path.
Definition: Geometry.h:506
point cp
Definition: Geometry.h:49
std::uint8_t read_u8()
Read a aligned unsigned 8-bit value from the stream.
Definition: SWFStream.cpp:319
bool read_bit()
Reads a single bit off the stream and returns it.
Definition: SWFStream.cpp:88
std::int32_t y
The y coordinate.
Definition: Point2d.h:46
Holds information needed to draw a shape.
Definition: ShapeRecord.h:127
SWF stream wrapper class.
Definition: SWFStream.h:59
SWFRect readRect(SWFStream &in)
Read a bit-packed rectangle from an SWF stream.
Definition: TypesParser.cpp:130
Defines an edge with a control point and an anchor point.
Definition: Geometry.h:45
void ensureBytes(unsigned long needed)
Ensure the requested number of bytes are available for an aligned read in the currently opened tag.
Definition: SWFStream.cpp:50
@ o
Definition: GnashKey.h:161
@ SWF
Definition: GnashKey.h:331
void log_unimpl(StringType msg, Args... args)
Definition: log.h:289
std::vector< Edge > m_edges
Edges forming the path.
Definition: Geometry.h:182
std::string toString() const
Return a string representation for this rectangle.
Definition: SWFRect.cpp:128
void clear()
Remove all edges and reset style infomation.
Definition: Geometry.h:354
void drawCurveTo(std::int32_t cdx, std::int32_t cdy, std::int32_t adx, std::int32_t ady)
Draw a curve.
Definition: Geometry.h:348
std::int32_t x
Definition: BitmapData_as.cpp:434
void addLineStyle(const LineStyle &ls)
Definition: ShapeRecord.h:86
@ b
Definition: GnashKey.h:148
void setLerp(const ShapeRecord &a, const ShapeRecord &b, const double ratio)
Set to the lerp of two ShapeRecords.
Definition: ShapeRecord.cpp:132
@ e
Definition: GnashKey.h:151
~ShapeRecord()
Definition: ShapeRecord.cpp:84
void setBounds(const SWFRect &bounds)
Definition: ShapeRecord.h:179
void set_null()
set the rectangle to the NULL value
Definition: SWFRect.h:81
@ DEFINEFONT
Definition: SWF.h:42
void clear()
Reset all shape data.
Definition: ShapeRecord.cpp:89