Gnash
0.8.11dev
|
Base class for different types of bitmaps. More...
#include <GnashImage.h>
Public Types | |
typedef std::uint8_t | value_type |
typedef std::unique_ptr< value_type[]> | container_type |
typedef value_type * | iterator |
typedef const value_type * | const_iterator |
Public Member Functions | |
virtual | ~GnashImage () |
ImageType | type () const |
Return the ImageType of the image. More... | |
ImageLocation | location () const |
Return the ImageLocation of the image. More... | |
size_t | size () const |
Get the size of the image buffer. More... | |
virtual size_t | stride () const |
Get the pitch of the image buffer. More... | |
size_t | channels () const |
Get the number of channels. More... | |
size_t | width () const |
Get the image's width. More... | |
size_t | height () const |
Get the image's width. More... | |
void | update (const_iterator data) |
Copy image data from a buffer. More... | |
void | update (const GnashImage &from) |
Copy image data from another image data. More... | |
virtual iterator | begin () |
Access the raw data. More... | |
virtual const_iterator | begin () const |
Access the raw data. More... | |
iterator | end () |
An iterator to the end of the data. More... | |
const_iterator | end () const |
An iterator to the end of the data. More... | |
Protected Member Functions | |
GnashImage (iterator data, size_t width, size_t height, ImageType type, ImageLocation location=GNASH_IMAGE_CPU) | |
Construct a GnashImage from a data buffer, taking ownership of the data. More... | |
GnashImage (size_t width, size_t height, ImageType type, ImageLocation location=GNASH_IMAGE_CPU) | |
Construct an empty GnashImage. More... | |
Protected Attributes | |
const ImageType | _type |
The type of the image: RGBA or RGB. More... | |
const ImageLocation | _location |
Image data location (CPU or GPU) More... | |
const size_t | _width |
Width of image, in pixels. More... | |
const size_t | _height |
Height of image, in pixels. More... | |
container_type | _data |
Data if held in this class. More... | |
Base class for different types of bitmaps.
typedef const value_type* gnash::image::GnashImage::const_iterator |
typedef std::unique_ptr<value_type[]> gnash::image::GnashImage::container_type |
typedef std::uint8_t gnash::image::GnashImage::value_type |
|
inlinevirtual |
|
protected |
Construct a GnashImage from a data buffer, taking ownership of the data.
data | The raw image data. This class takes ownership. |
width | The width of the image in pixels. |
height | The height of the image in pixels. |
pitch | The pitch (rowstride) of the image in bytes. |
type | The ImageType of the image. |
|
protected |
Construct an empty GnashImage.
Create an image allocating a buffer of height*pitch bytes.
Note: there is an arbitrary limit of std::int32_t::max bytes for the total size of the bitmap constructed with this constructor.
width | The width of the image in pixels. |
height | The height of the image in pixels. |
type | The ImageType of the image. |
References _data, _height, _width, channels(), and size().
|
inlinevirtual |
Access the raw data.
Reimplemented in gnash::GnashVaapiImage, and gnash::media::gst::gnashGstBuffer.
Referenced by gnash::renderer::openvg::OpenVGBitmap::applyPatternBitmap(), gnash::image::begin(), gnash::image::mergeAlpha(), gnash::renderer::openvg::OpenVGBitmap::OpenVGBitmap(), gnash::registerBitmapDataNative(), gnash::image::scanline(), gnash::GnashVaapiImage::update(), update(), and gnash::image::Output::writeImageData().
|
inlinevirtual |
Access the raw data.
Reimplemented in gnash::GnashVaapiImage, and gnash::media::gst::gnashGstBuffer.
|
inline |
Get the number of channels.
References gnash::image::numChannels().
Referenced by GnashImage(), and gnash::media::gst::gnashGstBuffer::stride().
|
inline |
An iterator to the end of the data.
References gnash::image::begin().
Referenced by gnash::image::end().
|
inline |
An iterator to the end of the data.
References gnash::image::begin(), gnash::image::GNASH_IMAGE_CPU, height, and width.
|
inline |
Get the image's width.
Referenced by gnash::renderer::openvg::OpenVGBitmap::applyPatternBitmap(), gnash::Renderer_cairo::drawVideoFrame(), gnash::renderer::openvg::OpenVGBitmap::OpenVGBitmap(), gnash::image::Input::readImageData(), gnash::image::Input::readSWFJpeg3(), gnash::registerBitmapDataNative(), gnash::image::scanline(), test_renderer(), and gnash::image::Output::writeImageData().
|
inline |
Return the ImageLocation of the image.
This saves guessing when dynamic_cast is used.
Referenced by gnash::GnashVaapiImage::update().
|
inline |
Get the size of the image buffer.
Referenced by GnashImage(), gnash::image::mergeAlpha(), gnash::GnashVaapiImage::update(), and update().
|
inlinevirtual |
Get the pitch of the image buffer.
Reimplemented in gnash::media::gst::gnashGstBuffer.
Referenced by gnash::renderer::openvg::OpenVGBitmap::applyPatternBitmap(), gnash::renderer::openvg::OpenVGBitmap::OpenVGBitmap(), gnash::image::scanline(), and gnash::GnashVaapiImage::update().
|
inline |
Return the ImageType of the image.
This saves guessing when dynamic_cast is used.
Referenced by gnash::renderer::openvg::OpenVGBitmap::applyPatternBitmap(), gnash::image::begin(), gnash::Renderer_cairo::drawVideoFrame(), gnash::image::end(), gnash::renderer::openvg::OpenVGBitmap::OpenVGBitmap(), gnash::registerBitmapDataNative(), gnash::GnashVaapiImage::update(), and gnash::image::Output::writeImageData().
void gnash::image::GnashImage::update | ( | const_iterator | data | ) |
Copy image data from a buffer.
Note that this buffer MUST have the same rowstride and type, or unexpected things will happen. In general, it is only safe to copy from another GnashImage or unexpected things will happen.
data | buffer to copy data from. |
void gnash::image::GnashImage::update | ( | const GnashImage & | from | ) |
|
inline |
Get the image's width.
Referenced by gnash::renderer::openvg::OpenVGBitmap::applyPatternBitmap(), gnash::Renderer_cairo::drawVideoFrame(), gnash::renderer::openvg::OpenVGBitmap::OpenVGBitmap(), gnash::image::Input::readSWFJpeg3(), gnash::registerBitmapDataNative(), gnash::media::gst::gnashGstBuffer::stride(), test_renderer(), update(), and gnash::image::Output::writeImageData().
|
protected |
Data if held in this class.
Referenced by GnashImage(), gnash::GnashVaapiImage::update(), and update().
|
protected |
Height of image, in pixels.
Referenced by GnashImage(), and gnash::image::ImageRGBA::setPixel().
|
protected |
Image data location (CPU or GPU)
Referenced by update().
|
protected |
The type of the image: RGBA or RGB.
Referenced by update().
|
protected |
Width of image, in pixels.
Referenced by GnashImage(), and gnash::image::ImageRGBA::setPixel().