Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef GNASH_OPENVG_BITMAP_H
00020 #define GNASH_OPENVG_BITMAP_H
00021
00022 #include "Geometry.h"
00023 #include "CachedBitmap.h"
00024 #include "GnashImage.h"
00025 #include "Renderer.h"
00026 #include "FillStyle.h"
00027 #include "openvg/OpenVGRenderer.h"
00028
00029 namespace gnash {
00030
00031 class SWFCxForm;
00032
00033 namespace renderer {
00034
00035 namespace openvg {
00036
00039 class OpenVGBitmap : public CachedBitmap
00040 {
00041 public:
00043 enum bitmap_wrap_mode { WRAP_REPEAT, WRAP_FILL, WRAP_PAD, WRAP_REFLECT };
00044
00045 OpenVGBitmap(VGPaint paint);
00046 OpenVGBitmap(CachedBitmap *bitmap, VGPaint vgpaint);
00047 OpenVGBitmap(image::GnashImage *im, VGPaint vgpaint);
00048 ~OpenVGBitmap();
00049
00050 void dispose() { _image.reset(); }
00051 bool disposed() const { return !_image.get(); }
00052
00053 image::GnashImage& image() {
00054 assert(!disposed());
00055 return *_image;
00056 };
00057 VGPaint &vgimage() { return _vgimage; };
00058
00059
00060 VGPaint getFillPaint() const { return _vgpaint; }
00061 int getWidth() { return _image->width(); }
00062 int getHeight() { return _image->height(); }
00063 boost::uint8_t *getData() const { return _image->begin(); }
00064
00065 OpenVGBitmap *createRadialBitmap(float x0, float y0, float x1, float y1,
00066 float radial, const SWFCxForm& cx,
00067 const GradientFill::GradientRecords &records,
00068 VGPaint paint);
00069 OpenVGBitmap *createLinearBitmap(float x0, float y0, float x1, float y1,
00070 const SWFCxForm& cx,
00071 const GradientFill::GradientRecords &records,
00072 const VGPaint paint);
00073
00074 OpenVGBitmap *applyPatternBitmap(const gnash::SWFMatrix& matrix,
00075 bitmap_wrap_mode mode,
00076 CachedBitmap *bitmap, VGPaint paint);
00077
00078 private:
00079 boost::scoped_ptr<image::GnashImage> _image;
00080 VGImageFormat _pixel_format;
00081 VGImage _vgimage;
00082 VGPaint _vgpaint;
00083 double _aspect_ratio;
00084 };
00085
00086 }
00087 }
00088 }
00089
00090 #endif // __RENDER_OPENVG_BITMAP_H__
00091
00092
00093
00094
00095