Go to the documentation of this file.
29 #ifndef GNASH_RENDER_HANDLER_OVG_H
30 #define GNASH_RENDER_HANDLER_OVG_H
48 # ifdef HAVE_VG_VGEXT_H
49 # include <VG/vgext.h>
52 #include <VG/openvg.h>
82 void init(
float x,
float y);
83 CachedBitmap *createCachedBitmap(std::unique_ptr<image::GnashImage> im);
88 void world_to_pixel(
int&
x,
int&
y,
float world_x,
float world_y)
const;
95 void begin_display(
const gnash::rgba&,
int,
int,
float,
98 void drawLine(
const std::vector<point>& coords,
const rgba&
fill,
101 const SWFRect* bounds,
bool smooth);
102 void draw_poly(
const std::vector<point>& corners,
111 void set_antialiased(
bool enable);
112 void begin_submit_mask();
113 void end_submit_mask();
117 void set_scale(
float xscale,
float yscale);
122 void endInternalRender();
124 unsigned int getBitsPerPixel();
129 void printVGParams();
131 static void printVGPath(VGPath
path);
132 static void printVGMatrix(VGfloat *mat);
133 static void printVGMatrix(
const SWFMatrix &mat);
135 static const char *getErrorString(VGErrorCode error);
139 void add_paths(
const PathVec& path_vec);
140 Path reverse_path(
const Path& cur_path);
141 const Path* find_connecting_path(
const Path& to_connect,
142 std::list<const Path*> path_refs);
148 void analyze_paths(
const PathVec &paths,
bool& have_shape,
157 std::list<PathPtrVec> get_contours(
const PathPtrVec &paths);
159 std::vector<PathVec::const_iterator> find_subshapes(
const PathVec& path_vec);
160 void apply_matrix_to_paths(std::vector<Path>& paths,
const SWFMatrix& mat);
164 const std::vector<FillStyle>& fill_styles,
165 const std::vector<LineStyle>& line_styles);
166 void draw_mask(
const PathVec& path_vec);
176 float _display_width;
177 float _display_height;
179 std::vector<PathVec> _masks;
181 #ifdef OPENVG_VERSION_1_1
182 VGMaskLayer _mask_layer;
190 VGPaint _strokepaint;
200 double _aspect_ratio;
219 #endif // __RENDER_HANDLER_OVG_H__
VGPath path
Definition: testr_gtk.cpp:84
@ CAP_NONE
Definition: LineStyle.h:39
@ R
Definition: GnashKey.h:130
Renderer_ovg()
Definition: OpenVGRenderer.cpp:205
point ap
Start point of the path.
Definition: Geometry.h:179
void init(float x, float y)
Definition: OpenVGRenderer.cpp:248
A SolidFill containing one color.
Definition: FillStyle.h:247
@ height
Definition: klash_part.cpp:329
void closepath(VGPath path)
Definition: OpenVGRenderer.cpp:140
void startpath(VGPath path, const int x, const int y)
Definition: OpenVGRenderer.cpp:124
std::vector< Path > PathVec
Definition: Renderer_cairo.h:35
void set_antialiased(bool enable)
Definition: OpenVGRenderer.cpp:568
void disable_mask()
Definition: OpenVGRenderer.cpp:641
#define GNASH_RENDER_QUALITY
Definition: OpenVGRenderer.cpp:59
std::vector< const Path * > PathRefs
Definition: OpenVGRenderer.h:65
point ap
Definition: Geometry.h:50
@ T
Definition: GnashKey.h:132
T getMaxY() const
Get max Y ordinate.
Definition: Range2d.h:633
std::int32_t get_x_max() const
Get the x coordinate of the right-down corner.
Definition: SWFRect.h:122
std::vector< Path > PathVec
Definition: OpenVGRenderer.h:66
void drawLine(const std::vector< point > &coords, const rgba &fill, const SWFMatrix &mat)
Draw a line-strip directly, using a thin, solid line.
Definition: OpenVGRenderer.cpp:448
void log_debug(StringType msg, Args... args)
Definition: log.h:301
CachedBitmap * createCachedBitmap(std::unique_ptr< image::GnashImage > im)
Given an image, returns a pointer to a CachedBitmap class that can later be passed to FillStyleX_bitm...
Definition: OpenVGRenderer.cpp:302
std::int32_t y
Definition: BitmapData_as.cpp:435
@ i
Definition: GnashKey.h:155
void setFillPaint(const VGPaint paint)
Definition: OpenVGRenderer.h:126
#define LOG_ONCE(x)
Definition: log.h:49
A basic RGBA type.
Definition: RGBA.h:36
~Renderer_ovg()
Definition: OpenVGRenderer.cpp:286
SWFMatrix & invert()
Invert this SWFMatrix and return the result.
Definition: SWFMatrix.cpp:288
#define _(String)
Definition: log.h:44
FillStyle describes the various fill styles for shapes.
Definition: FillStyle.h:282
dtype_t
The list of supported device types.
Definition: GnashDevice.h:48
bool straight() const
Definition: Geometry.h:77
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
void drawGlyph(const SWF::ShapeRecord &rec, const rgba &c, const SWFMatrix &mat)
Draws a glyph (font character).
Definition: OpenVGRenderer.cpp:1216
T getMaxX() const
Get max X ordinate.
Definition: Range2d.h:613
const SWFRect & getBounds() const
Definition: ShapeRecord.h:166
bool is_null() const
returns true if this is a NULL rectangle
Definition: SWFRect.h:75
std::int32_t get_y_max() const
Get the y coordinate of the right-down corner.
Definition: SWFRect.h:136
void end_submit_mask()
Definition: OpenVGRenderer.cpp:584
Base class for different types of bitmaps.
Definition: GnashImage.h:78
#define GNASH_REPORT_FUNCTION
Definition: log.h:452
std::vector< geometry::Range2d< int > > ClipBounds
Definition: OpenVGRenderer.cpp:72
Base class for render handlers.
Definition: Renderer.h:189
@ m
Definition: GnashKey.h:159
@ CAP_SQUARE
Definition: LineStyle.h:40
@ start
Definition: klash_part.cpp:330
@ worldRange
A WORLD range2d is a range including all points on the plane.
Definition: Range2d.h:52
T getMinX() const
Get min X ordinate.
Definition: Range2d.h:603
void begin_display(const gnash::rgba &, int, int, float, float, float, float)
Definition: OpenVGRenderer.cpp:391
static void printVGPath(VGPath path)
Definition: OpenVGRenderer.cpp:1525
bool is_world() const
TODO: deprecate this 'world' concept.
Definition: SWFRect.h:87
std::int32_t c() const
Definition: SWFMatrix.h:87
@ JOIN_BEVEL
Definition: LineStyle.h:45
void log_error(StringType msg, Args... args)
Definition: log.h:283
bool isNull() const
Returns true if this is the NULL Range2d.
Definition: Range2d.h:181
std::string description() const
Return a description of this renderer.
Definition: OpenVGRenderer.h:75
Rectangle class, see swf defined rectangle record.
Definition: SWFRect.h:45
unsigned m_line
Line style index (1-based)
Definition: Geometry.h:176
DSOEXPORT Renderer * create_handler(const char *)
Definition: OpenVGRenderer.cpp:1265
const VGfloat color[4]
Definition: testr_gtk.cpp:82
std::vector< const Path * > PathPtrVec
Definition: OpenVGRenderer.cpp:895
bool isWorld() const
Returns true if this is the WORLD Range2d.
Definition: Range2d.h:200
VGPaint fill
Definition: testr_gtk.cpp:86
void end_display()
Definition: OpenVGRenderer.cpp:439
std::int32_t x
The x coordinate.
Definition: Point2d.h:43
std::int32_t get_x_min() const
Get the x coordinate of the left-up corner.
Definition: SWFRect.h:115
@ CAP_ROUND
Definition: LineStyle.h:38
void set_invalidated_regions(const InvalidatedRanges &ranges)
Sets the update region (called prior to begin_display).
Definition: OpenVGRenderer.cpp:1256
void world_to_pixel(int &x, int &y, float world_x, float world_y) const
Definition: OpenVGRenderer.cpp:324
gnash::point pixel_to_world(int, int) const
Converts pixel coordinates to world coordinates (TWIPS)
Definition: OpenVGRenderer.cpp:371
unsigned m_fill0
Left fill style index (1-based)
Definition: Geometry.h:170
std::int32_t a() const
Definition: SWFMatrix.h:79
void transform(geometry::Point2d &p) const
Transform a given point by our SWFMatrix.
Definition: SWFMatrix.cpp:99
T getMinY() const
Get min Y ordinate.
Definition: Range2d.h:623
std::int32_t d() const
Definition: SWFMatrix.h:91
A subset of a shape, a series of edges sharing a single set of styles.
Definition: Geometry.h:167
unsigned int getBitsPerPixel()
Definition: OpenVGRenderer.cpp:1577
For the outside of outline shapes, or just bare lines.
Definition: LineStyle.h:51
std::int32_t b() const
Definition: SWFMatrix.h:83
@ p
Definition: GnashKey.h:162
@ C
Definition: GnashKey.h:115
Definition: OpenVGRenderer.h:73
@ nullRange
A NULL range is a range enclosing NO points.
Definition: Range2d.h:43
std::int32_t tx() const
Definition: SWFMatrix.h:95
@ _1
Definition: GnashKey.h:95
@ JOIN_ROUND
Definition: LineStyle.h:44
static void printVGMatrix(VGfloat *mat)
Definition: OpenVGRenderer.cpp:1541
@ JOIN_MITER
Definition: LineStyle.h:46
Definition: SWFMatrix.h:54
2D Point class
Definition: Point2d.h:39
unsigned m_fill1
Right fill style index (1-based)
Definition: Geometry.h:173
double get_x_scale() const
return the magnitude scale of our x coord output
Definition: SWFMatrix.cpp:314
VGPaint paint
Definition: testr_gtk.cpp:85
void begin_submit_mask()
Definition: OpenVGRenderer.cpp:574
void drawVideoFrame(gnash::image::GnashImage *, const gnash::Transform &, const gnash::SWFRect *, bool)
Draws a video frame.
Definition: OpenVGRenderer.cpp:1571
void preparepath(VGPath path, const std::vector< Edge > &edges, const float &anchor_x, const float &anchor_y)
Definition: OpenVGRenderer.cpp:157
Definition: OpenVGBitmap.h:40
void set_identity()
Set the SWFMatrix to identity.
Definition: SWFMatrix.cpp:141
void draw_poly(const std::vector< point > &corners, const rgba &fill, const rgba &outline, const SWFMatrix &mat, bool masked)
Draw a simple, solid filled polygon with a thin (~1 pixel) outline.
Definition: OpenVGRenderer.cpp:510
@ f
Definition: GnashKey.h:152
pixel_iterator< T > end(GnashImage &im)
Definition: ImageIterators.h:198
@ c
Definition: GnashKey.h:149
void endInternalRender()
Finish internal rendering.
Definition: OpenVGRenderer.cpp:1565
point cp
Definition: Geometry.h:49
#define DSOEXPORT
Definition: dsodefs.h:55
void for_each(C &container, R(T::*pmf)(const A &), const A &arg)
Definition: OpenVGRenderer.cpp:199
std::int32_t ty() const
Definition: SWFMatrix.h:99
std::int32_t y
The y coordinate.
Definition: Point2d.h:46
double get_y_scale() const
return the magnitude scale of our y coord output
Definition: SWFMatrix.cpp:322
Holds information needed to draw a shape.
Definition: ShapeRecord.h:127
void printVGParams()
Definition: OpenVGRenderer.cpp:1276
void set_scale(double x_scale, double y_scale)
Set x and y scales, rotation is unchanged.
Definition: SWFMatrix.cpp:225
Defines an edge with a control point and an anchor point.
Definition: Geometry.h:45
void transform(const SWFMatrix &mat)
Transform all path coordinates according to the given SWFMatrix.
Definition: Geometry.h:443
@ width
Definition: klash_part.cpp:329
void log_unimpl(StringType msg, Args... args)
Definition: log.h:289
std::vector< Edge > m_edges
Edges forming the path.
Definition: Geometry.h:182
void set_scale(float xscale, float yscale)
Sets the x/y scale for the movie
Definition: OpenVGRenderer.cpp:1245
A CachedBitmap is created by the renderer in a format of its choosing.
Definition: CachedBitmap.h:38
std::int32_t x
Definition: BitmapData_as.cpp:434
#define MAX_SEG
Definition: OpenVGRenderer.cpp:117
Renderer * startInternalRender(gnash::image::GnashImage &)
Setup the renderer to draw to an internal buffer.
Definition: OpenVGRenderer.cpp:1557
static const char * getErrorString(VGErrorCode error)
Definition: OpenVGRenderer.cpp:1583
std::int32_t get_y_min() const
Get the y coordinate of the left-up corner.
Definition: SWFRect.h:129
void drawShape(const gnash::SWF::ShapeRecord &, const gnash::Transform &)
Definition: OpenVGRenderer.cpp:1168
std::vector< const Path * > PathPtrVec
Definition: Renderer_cairo.h:36
std::vector< geometry::Range2d< int > > ClipBounds
Definition: OpenVGRenderer.h:67
void apply_mask()
Definition: OpenVGRenderer.cpp:604
@ A
Definition: GnashKey.h:113