19 #ifndef RENDER_HANDLER_H 20 #define RENDER_HANDLER_H 145 #include <boost/noncopyable.hpp> 170 class GnashVaapiImageProxy;
197 virtual std::string description()
const = 0;
222 createCachedBitmap(std::unique_ptr<image::GnashImage> im) = 0;
265 virtual void drawLine(
const std::vector<point>& coords,
282 virtual void draw_poly(
const std::vector<point>& corners,
319 log_debug(
_(
"Rendering to image not implemented for this " 354 {
return _render_images.begin(); }
358 {
return _render_images.end(); }
375 virtual void begin_submit_mask() = 0;
376 virtual void end_submit_mask() = 0;
377 virtual void disable_mask() = 0;
397 virtual point pixel_to_world(
int x,
int y)
const = 0;
402 point topleft = pixel_to_world(
404 point bottomright = pixel_to_world(
408 bottomright.x, bottomright.y);
441 virtual bool getPixel(
rgba& ,
int ,
int )
const {
443 log_debug(
"getPixel() not implemented for this renderer");
448 void addRenderImage(std::shared_ptr<GnashVaapiImageProxy> image) {
449 _render_images.push_back(image);
462 virtual bool getAveragePixel(
rgba& color_return,
int x,
int y,
463 unsigned int radius)
const 469 if (radius==1)
return getPixel(color_return, x, y);
471 unsigned int r=0,
g=0,
b=0,
a=0;
481 for (
int yp=y; yp<ye; yp++)
482 for (
int xp=x; xp<xe; xp++)
484 if (!getPixel(pixel, xp, yp))
493 int pcount = radius*radius;
494 color_return.
m_r = r / pcount;
495 color_return.
m_g =
g / pcount;
496 color_return.
m_b =
b / pcount;
497 color_return.
m_a =
a / pcount;
522 virtual bool initTestBuffer(
unsigned ,
unsigned ) {
533 virtual unsigned int getBitsPerPixel()
const {
547 float x0 = 0,
float x1 = 0,
float y0 = 0,
float y1 = 0)
551 _r.begin_display(c,
w,
h, x0, x1, y0, y1);
569 _ext(_r.startInternalRender(im))
578 _r.endInternalRender();
604 virtual void begin_display(
const rgba& background_color,
605 int viewport_width,
int viewport_height,
606 float x0,
float x1,
float y0,
float y1) = 0;
608 virtual void end_display() = 0;
621 virtual void endInternalRender() = 0;
Definition: GnashKey.h:147
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:422
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:546
FileType
Definition: GnashEnums.h:25
std::shared_ptr< GnashVaapiImageProxy > RenderImage
Definition: Renderer.h:349
bool isNull() const
Returns true if this is the NULL Range2d.
Definition: Range2d.h:181
std::uint8_t m_b
Definition: RGBA.h:113
Definition: GnashEnums.h:38
T getMinY() const
Get min Y ordinate.
Definition: Range2d.h:623
VGPaint fill
Definition: testr_gtk.cpp:86
~External()
Definition: Renderer.h:554
virtual void set_invalidated_regions(const InvalidatedRanges &)
Sets the update region (called prior to begin_display).
Definition: Renderer.h:340
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:592
Quality
Definition: GnashEnums.h:34
virtual RenderImages::const_iterator getFirstRenderImage() const
Definition: Renderer.h:353
geometry::Range2d< int > world_to_pixel(const geometry::Range2d< int > &wb) const
Definition: Renderer.h:388
2D Point class
Definition: Point2d.h:38
Definition: GnashKey.h:149
geometry::Range2d< int > pixel_to_world(const geometry::Range2d< int > &pixelbounds) const
Definition: Renderer.h:399
T getMaxY() const
Get max Y ordinate.
Definition: Range2d.h:633
std::uint8_t m_g
Definition: RGBA.h:113
Base class for render handlers.
Definition: Renderer.h:188
Renderer * renderer() const
Definition: Renderer.h:573
const VGfloat color[4]
Definition: testr_gtk.cpp:82
Definition: GnashKey.h:164
virtual void set_translation(float, float)
Definition: Renderer.h:209
std::vector< RenderImage > RenderImages
Definition: Renderer.h:350
T getMaxX() const
Get max X ordinate.
Definition: Range2d.h:613
Quality _quality
Kept in parallel with movie_root's setting.
Definition: Renderer.h:589
#define _(String)
Definition: log.h:44
Definition: Renderer.h:539
virtual void set_scale(float, float)
Sets the x/y scale for the movie.
Definition: Renderer.h:204
std::int32_t y
The y coordinate.
Definition: Point2d.h:46
Definition: Renderer.h:562
virtual void renderToImage(std::unique_ptr< IOChannel >, FileType, int) const
Draw the current rendering buffer to an image file.
Definition: Renderer.h:316
~Internal()
Definition: Renderer.h:577
void setQuality(Quality q)
Definition: Renderer.h:211
std::int32_t x
Definition: BitmapData_as.cpp:434
virtual ~Renderer()
Definition: Renderer.h:194
Renderer()
Definition: Renderer.h:192
Definition: GnashKey.h:148
#define DSOEXPORT
Definition: dsodefs.h:55
bool isWorld() const
Returns true if this is the WORLD Range2d.
Definition: Range2d.h:200
std::int32_t x
The x coordinate.
Definition: Point2d.h:43
std::uint8_t m_a
Definition: RGBA.h:113
std::int32_t y
Definition: BitmapData_as.cpp:435
Definition: GnashKey.h:154
Base class for different types of bitmaps.
Definition: GnashImage.h:77
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:566
virtual RenderImages::const_iterator getLastRenderImage() const
Definition: Renderer.h:357
Definition: GnashKey.h:153
std::uint8_t m_r
Definition: RGBA.h:113
A CachedBitmap is created by the renderer in a format of its choosing.
Definition: CachedBitmap.h:37
void log_debug(StringType msg, Args... args)
Definition: log.h:301
Holds information needed to draw a shape.
Definition: ShapeRecord.h:126
T getMinX() const
Get min X ordinate.
Definition: Range2d.h:603
Definition: GnashKey.h:331
A basic RGBA type.
Definition: RGBA.h:35