Go to the documentation of this file.
24 #ifndef GNASH_GNASHIMAGE_H
25 #define GNASH_GNASHIMAGE_H
27 #include <boost/noncopyable.hpp>
106 return stride() * _height;
113 return _width * channels();
144 void update(const_iterator
data);
165 return begin() + size();
170 return begin() + size();
254 void setPixel(
size_t x,
size_t y, value_type
r, value_type
g, value_type
b,
268 Input(std::shared_ptr<IOChannel> in)
310 std::shared_ptr<gnash::IOChannel> in);
361 log_error(
_(
"This image format does not support writing RGBA images"));
374 std::shared_ptr<gnash::IOChannel> out,
const GnashImage& image,
394 assert(row < im.
height());
405 assert(row < im.
height());
410 const size_t bufferLength);
std::uint8_t value_type
Definition: GnashImage.h:81
pixel_iterator< T > begin(GnashImage &im)
Definition: ImageIterators.h:191
@ height
Definition: klash_part.cpp:329
std::unique_ptr< value_type[]> container_type
Definition: GnashImage.h:82
virtual void writeImageRGB(const unsigned char *rgbData)=0
Write RGB image data using the parameters supplied at construction.
size_t width() const
Get the image's width.
Definition: GnashImage.h:126
24-bit RGB bitmap
Definition: GnashImage.h:217
std::shared_ptr< IOChannel > _outStream
Definition: GnashImage.h:383
const size_t _height
Height of image, in pixels.
Definition: GnashImage.h:206
virtual size_t stride() const
Get the pitch of the image buffer.
Definition: GnashImage.h:112
std::unique_ptr< Input > createGifInput(std::shared_ptr< IOChannel > in)
Create a GifInput and transfer ownership to the caller.
Definition: GnashImageGif.cpp:311
const_iterator end() const
An iterator to the end of the data.
Definition: GnashImage.h:169
std::int32_t y
Definition: BitmapData_as.cpp:435
@ i
Definition: GnashKey.h:155
Definition: GnashImage.h:332
value_type * iterator
Definition: GnashImage.h:83
ImageRGBA(iterator data, size_t width, size_t height)
Definition: GnashImage.h:243
#define _(String)
Definition: log.h:44
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
@ g
Definition: GnashKey.h:153
Base class for different types of bitmaps.
Definition: GnashImage.h:78
FileType
Definition: GnashEnums.h:25
@ GNASH_FILETYPE_JPEG
Definition: GnashEnums.h:26
size_t channels() const
Get the number of channels.
Definition: GnashImage.h:119
const ImageType _type
The type of the image: RGBA or RGB.
Definition: GnashImage.h:197
virtual void writeImageRGBA(const unsigned char *)
Write RGBA image data using the parameters supplied at construction.
Definition: GnashImage.h:359
void mergeAlpha(ImageRGBA &im, GnashImage::const_iterator alphaData, const size_t bufferLength)
Definition: GnashImage.cpp:146
void log_error(StringType msg, Args... args)
Definition: log.h:283
ImageType type() const
Return the ImageType of the image.
Definition: GnashImage.h:91
iterator end()
An iterator to the end of the data.
Definition: GnashImage.h:164
@ t
Definition: GnashKey.h:166
@ r
Definition: GnashKey.h:164
@ a
Definition: GnashKey.h:147
const value_type * const_iterator
Definition: GnashImage.h:84
virtual const_iterator begin() const
Access the raw data.
Definition: GnashImage.h:159
std::unique_ptr< Input > createPngInput(std::shared_ptr< IOChannel > in)
Create a PngInput and transfer ownership to the caller.
Definition: GnashImagePng.cpp:403
type
Definition: GnashKey.h:330
ImageLocation location() const
Return the ImageLocation of the image.
Definition: GnashImage.h:98
@ p
Definition: GnashKey.h:162
GnashImage::iterator scanline(GnashImage &im, size_t row)
Get a pointer to a given row of any image.
Definition: GnashImage.h:392
ImageLocation
The locations of images handled in Gnash.
Definition: GnashImage.h:55
@ GNASH_IMAGE_INVALID
Definition: GnashImage.h:48
ImageRGB(size_t width, size_t height)
Create an empty RGB image with uninitialized data.
Definition: GnashImage.cpp:109
const ImageLocation _location
Image data location (CPU or GPU)
Definition: GnashImage.h:200
@ GNASH_IMAGE_CPU
Definition: GnashImage.h:56
@ GNASH_FILETYPE_PNG
Definition: GnashEnums.h:27
virtual ~ImageRGB()
Definition: GnashImage.cpp:115
size_t size() const
Get the size of the image buffer.
Definition: GnashImage.h:105
static std::unique_ptr< Output > create(std::shared_ptr< IOChannel > out, size_t width, size_t height, int quality)
Create a JpegOutput, transferring ownership to the caller.
Definition: GnashImageJpeg.cpp:624
const size_t _width
Definition: GnashImage.h:379
@ TYPE_RGB
Definition: GnashImage.h:49
Output(std::shared_ptr< IOChannel > out, size_t width, size_t height)
Construct an Output for writing to an IOChannel.
Definition: GnashImage.h:342
@ GNASH_FILETYPE_GIF
Definition: GnashEnums.h:28
virtual iterator begin()
Access the raw data.
Definition: GnashImage.h:154
virtual ~GnashImage()
Definition: GnashImage.h:86
void setPixel(size_t x, size_t y, value_type r, value_type g, value_type b, value_type a)
Set pixel value.
Definition: GnashImage.cpp:130
const size_t _height
Definition: GnashImage.h:381
#define DSOEXPORT
Definition: dsodefs.h:55
container_type _data
Data if held in this class.
Definition: GnashImage.h:209
ImageType
The types of images handled in Gnash.
Definition: GnashImage.h:47
virtual ~Output()
Definition: GnashImage.h:349
const size_t _width
Width of image, in pixels.
Definition: GnashImage.h:203
@ GNASH_IMAGE_GPU
Definition: GnashImage.h:57
~ImageRGBA()
Definition: GnashImage.cpp:125
@ width
Definition: klash_part.cpp:329
std::int32_t x
Definition: BitmapData_as.cpp:434
ImageRGBA(size_t width, size_t height)
Create an empty RGB image with uninitialized data.
Definition: GnashImage.cpp:119
@ b
Definition: GnashKey.h:148
SimpleBuffer data
Definition: LocalConnection_as.cpp:151
static DSOEXPORT void writeImageData(FileType type, std::shared_ptr< gnash::IOChannel > out, const GnashImage &image, int quality)
Write the given image to the given IOChannel in a specified format.
Definition: GnashImage.cpp:175
@ e
Definition: GnashKey.h:151
void update(const_iterator data)
Copy image data from a buffer.
Definition: GnashImage.cpp:94
@ TYPE_RGBA
Definition: GnashImage.h:50
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.
Definition: GnashImage.cpp:63
std::unique_ptr< Output > createPngOutput(std::shared_ptr< IOChannel > o, size_t width, size_t height, int quality)
Definition: GnashImagePng.cpp:411
size_t height() const
Get the image's width.
Definition: GnashImage.h:133
32-bit RGBA bitmap
Definition: GnashImage.h:236
ImageRGB(iterator data, size_t width, size_t height)
Create an ImageRGB taking ownership of the data.
Definition: GnashImage.h:224
size_t numChannels(ImageType t)
Definition: GnashImage.h:61