19 #ifndef RENDER_HANDLER_H
20 #define RENDER_HANDLER_H
145 #include <boost/noncopyable.hpp>
149 #include "boost/shared_array.hpp"
150 #include "boost/scoped_ptr.hpp"
172 class GnashVaapiImageProxy;
199 virtual std::string description()
const = 0;
224 createCachedBitmap(std::auto_ptr<image::GnashImage> im) = 0;
267 virtual void drawLine(
const std::vector<point>& coords,
284 virtual void draw_poly(
const std::vector<point>& corners,
321 log_debug(
_(
"Rendering to image not implemented for this "
356 {
return _render_images.begin(); }
360 {
return _render_images.end(); }
377 virtual void begin_submit_mask() = 0;
378 virtual void end_submit_mask() = 0;
379 virtual void disable_mask() = 0;
399 virtual point pixel_to_world(
int x,
int y)
const = 0;
404 point topleft = pixel_to_world(
406 point bottomright = pixel_to_world(
410 bottomright.x, bottomright.y);
443 virtual bool getPixel(
rgba& ,
int ,
int )
const {
445 log_debug(
"getPixel() not implemented for this renderer");
450 void addRenderImage(boost::shared_ptr<GnashVaapiImageProxy> image) {
451 _render_images.push_back(image);
464 virtual bool getAveragePixel(rgba& color_return,
int x,
int y,
465 unsigned int radius)
const
471 if (radius==1)
return getPixel(color_return, x, y);
473 unsigned int r=0,
g=0,
b=0,
a=0;
483 for (
int yp=y; yp<ye; yp++)
484 for (
int xp=x; xp<xe; xp++)
486 if (!getPixel(pixel, xp, yp))
495 int pcount = radius*radius;
496 color_return.m_r = r / pcount;
497 color_return.m_g =
g / pcount;
498 color_return.m_b =
b / pcount;
499 color_return.m_a =
a / pcount;
524 virtual bool initTestBuffer(
unsigned ,
unsigned ) {
535 virtual unsigned int getBitsPerPixel()
const {
549 float x0 = 0,
float x1 = 0,
float y0 = 0,
float y1 = 0)
553 _r.begin_display(c,
w,
h, x0, x1, y0, y1);
571 _ext(_r.startInternalRender(im))
580 _r.endInternalRender();
606 virtual void begin_display(
const rgba& background_color,
607 int viewport_width,
int viewport_height,
608 float x0,
float x1,
float y0,
float y1) = 0;
610 virtual void end_display() = 0;
623 virtual void endInternalRender() = 0;
Definition: GnashKey.h:147
virtual RenderImages::const_iterator getLastRenderImage() const
Definition: Renderer.h:359
External(Renderer &r, const rgba &c, int w=0, int h=0, float x0=0, float x1=0, float y0=0, float y1=0)
Prepare the renderer for external rendering.
Definition: Renderer.h:548
FileType
Definition: GnashEnums.h:25
boost::int32_t x
The x coordinate.
Definition: Point2d.h:43
boost::shared_ptr< GnashVaapiImageProxy > RenderImage
Definition: Renderer.h:351
Definition: GnashEnums.h:38
VGPaint fill
Definition: testr_gtk.cpp:86
virtual RenderImages::const_iterator getFirstRenderImage() const
Definition: Renderer.h:355
~External()
Definition: Renderer.h:556
virtual void set_invalidated_regions(const InvalidatedRanges &)
Sets the update region (called prior to begin_display).
Definition: Renderer.h:342
Definition: SWFMatrix.h:53
Definition: GnashKey.h:163
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
RenderImages _render_images
Definition: Renderer.h:594
Quality
Definition: GnashEnums.h:34
T getMinY() const
Get min Y ordinate.
Definition: Range2d.h:608
2D Point class
Definition: Point2d.h:38
Definition: GnashKey.h:149
Base class for render handlers.
Definition: Renderer.h:190
const VGfloat color[4]
Definition: testr_gtk.cpp:82
Definition: GnashKey.h:164
virtual void set_translation(float, float)
Definition: Renderer.h:211
T getMaxX() const
Get max X ordinate.
Definition: Range2d.h:598
std::vector< RenderImage > RenderImages
Definition: Renderer.h:352
Quality _quality
Kept in parallel with movie_root's setting.
Definition: Renderer.h:591
geometry::Range2d< int > world_to_pixel(const geometry::Range2d< int > &wb) const
Definition: Renderer.h:390
virtual bool bounds_in_clipping_area(const geometry::Range2d< int > &) const
Checks if the given bounds are (partially) in the current drawing clipping area.
Definition: Renderer.h:424
#define _(String)
Definition: log.h:44
Definition: Renderer.h:541
virtual void set_scale(float, float)
Sets the x/y scale for the movie.
Definition: Renderer.h:206
Definition: Renderer.h:564
~Internal()
Definition: Renderer.h:579
void setQuality(Quality q)
Definition: Renderer.h:213
boost::int32_t x
Definition: BitmapData_as.cpp:434
virtual ~Renderer()
Definition: Renderer.h:196
Renderer()
Definition: Renderer.h:194
Definition: GnashKey.h:148
#define DSOEXPORT
Definition: dsodefs.h:55
geometry::Range2d< int > pixel_to_world(const geometry::Range2d< int > &pixelbounds) const
Definition: Renderer.h:401
boost::int32_t y
Definition: BitmapData_as.cpp:435
Definition: GnashKey.h:154
Base class for different types of bitmaps.
Definition: GnashImage.h:79
T getMinX() const
Get min X ordinate.
Definition: Range2d.h:588
Rectangle class, see swf defined rectangle record.
Definition: SWFRect.h:44
Internal(Renderer &r, image::GnashImage &im)
Prepare the renderer for internal rendering.
Definition: Renderer.h:568
Definition: GnashKey.h:153
tuple w
Definition: test.py:8
Renderer * renderer() const
Definition: Renderer.h:575
const Quality _quality
Quality of renderering.
Definition: Renderer_agg.cpp:660
A CachedBitmap is created by the renderer in a format of its choosing.
Definition: CachedBitmap.h:37
boost::int32_t y
The y coordinate.
Definition: Point2d.h:46
bool isWorld() const
Returns true if this is the WORLD Range2d.
Definition: Range2d.h:190
bool isNull() const
Returns true if this is the NULL Range2d.
Definition: Range2d.h:173
Holds information needed to draw a shape.
Definition: ShapeRecord.h:126
virtual void renderToImage(boost::shared_ptr< IOChannel >, FileType, int) const
Draw the current rendering buffer to an image file.
Definition: Renderer.h:318
Definition: GnashKey.h:331
T getMaxY() const
Get max Y ordinate.
Definition: Range2d.h:618
A basic RGBA type.
Definition: RGBA.h:35