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;