png++ 0.2.9
|
Pixel buffer, that stores pixels as continuous memory chunk. solid_pixel_buffer is useful when user whats to open png, do some changes and fetch to buffer to draw (as texture for example). More...
#include <solid_pixel_buffer.hpp>
Classes | |
struct | row_traits |
Public Types | |
typedef pixel_traits< pixel > | pixel_traits_t |
typedef row_traits::row_access | row_access |
A row of pixel data. | |
typedef row_traits::row_const_access | row_const_access |
typedef row_access | row_type |
Public Member Functions | |
solid_pixel_buffer () | |
Constructs an empty 0x0 pixel buffer object. | |
solid_pixel_buffer (uint_32 width, uint_32 height) | |
Constructs an empty pixel buffer object. | |
uint_32 | get_width () const |
uint_32 | get_height () const |
void | resize (uint_32 width, uint_32 height) |
Resizes the pixel buffer. | |
row_access | get_row (size_t index) |
Returns a reference to the row of image data at specified index. | |
row_const_access | get_row (size_t index) const |
Returns a const reference to the row of image data at specified index. | |
row_access | operator[] (size_t index) |
The non-checking version of get_row() method. | |
row_const_access | operator[] (size_t index) const |
The non-checking version of get_row() method. | |
void | put_row (size_t index, row_const_access r) |
Replaces the row at specified index. | |
pixel | get_pixel (size_t x, size_t y) const |
Returns a pixel at (x,y) position. | |
void | set_pixel (size_t x, size_t y, pixel p) |
Replaces a pixel at (x,y) position. | |
const std::vector< byte > & | get_bytes () const |
Provides easy constant read access to underlying byte-buffer. | |
std::vector< byte > | fetch_bytes () |
Moves the buffer to client code (c++11 only) . | |
Protected Attributes | |
uint_32 | m_width |
uint_32 | m_height |
size_t | m_stride |
std::vector< byte > | m_bytes |
Static Protected Attributes | |
static const size_t | bytes_per_pixel |
Pixel buffer, that stores pixels as continuous memory chunk. solid_pixel_buffer is useful when user whats to open png, do some changes and fetch to buffer to draw (as texture for example).
typedef pixel_traits< pixel > png::solid_pixel_buffer< pixel >::pixel_traits_t |
typedef row_traits::row_access png::solid_pixel_buffer< pixel >::row_access |
A row of pixel data.
typedef row_traits::row_const_access png::solid_pixel_buffer< pixel >::row_const_access |
typedef row_access png::solid_pixel_buffer< pixel >::row_type |
|
inline |
|
inline |
|
inline |
References m_width.
|
inline |
References m_height.
|
inline |
Resizes the pixel buffer.
If new width or height is greater than the original, expanded pixels are filled with value of pixel().
References bytes_per_pixel, m_bytes, m_height, m_stride, and m_width.
Referenced by solid_pixel_buffer().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns a pixel at (x,y) position.
References bytes_per_pixel, m_bytes, and m_width.
|
inline |
Replaces a pixel at (x,y) position.
References bytes_per_pixel, m_bytes, and m_width.
|
inline |
Provides easy constant read access to underlying byte-buffer.
References m_bytes.
|
inline |
|
staticprotected |
Referenced by get_pixel(), resize(), and set_pixel().
|
protected |
Referenced by fetch_bytes(), get_pixel(), get_width(), put_row(), resize(), set_pixel(), solid_pixel_buffer(), and solid_pixel_buffer().
|
protected |
Referenced by fetch_bytes(), get_height(), resize(), solid_pixel_buffer(), and solid_pixel_buffer().
|
protected |
Referenced by fetch_bytes(), get_row(), get_row(), operator[](), operator[](), resize(), solid_pixel_buffer(), and solid_pixel_buffer().
|
protected |
Referenced by fetch_bytes(), get_bytes(), get_pixel(), get_row(), get_row(), operator[](), operator[](), resize(), and set_pixel().