Go to the documentation of this file.
   31 #ifndef PNGPP_SOLID_PIXEL_BUFFER_HPP_INCLUDED 
   32 #define PNGPP_SOLID_PIXEL_BUFFER_HPP_INCLUDED 
   53     template< 
typename pixel >
 
   65                 return reinterpret_cast<byte*
>(row);
 
  178             return *
reinterpret_cast< const pixel* 
>(&
m_bytes.at(index));
 
  187             *
reinterpret_cast< pixel* 
>(&
m_bytes.at(index)) = p;
 
  198 #ifdef PNGPP_HAS_STD_MOVE 
  215                 pixel_traits_t::bit_depth / CHAR_BIT;
 
  223 #ifdef PNGPP_HAS_STATIC_ASSERT 
  224         static_assert(pixel_traits_t::bit_depth % CHAR_BIT == 0,
 
  225             "Bit_depth should consist of integer number of bytes");
 
  227         static_assert(
sizeof(pixel) * CHAR_BIT ==
 
  228             pixel_traits_t::channels * pixel_traits_t::bit_depth,
 
  229             "pixel type should contain channels data only");
 
  243 #endif // PNGPP_solid_pixel_buffer_HPP_INCLUDED 
  
row_traits::row_access row_access
A row of pixel data.
Definition: solid_pixel_buffer.hpp:73
std::vector< byte > fetch_bytes()
Moves the buffer to client code (c++11 only) .
Definition: solid_pixel_buffer.hpp:202
row_access get_row(size_t index)
Returns a reference to the row of image data at specified index.
Definition: solid_pixel_buffer.hpp:130
static const size_t bytes_per_pixel
Definition: solid_pixel_buffer.hpp:214
uint_32 get_width() const
Definition: solid_pixel_buffer.hpp:98
row_access row_type
Definition: solid_pixel_buffer.hpp:75
Definition: solid_pixel_buffer.hpp:59
pixel_traits< pixel > pixel_traits_t
Definition: solid_pixel_buffer.hpp:57
void resize(uint_32 width, uint_32 height)
Resizes the pixel buffer.
Definition: solid_pixel_buffer.hpp:114
row_traits::row_const_access row_const_access
Definition: solid_pixel_buffer.hpp:74
static byte * get_data(row_access row)
Definition: solid_pixel_buffer.hpp:63
png_uint_32 uint_32
Definition: types.hpp:41
std::vector< byte > m_bytes
Definition: solid_pixel_buffer.hpp:221
row_access operator[](size_t index)
The non-checking version of get_row() method.
Definition: solid_pixel_buffer.hpp:149
The packed pixel class template.
Definition: packed_pixel.hpp:56
pixel get_pixel(size_t x, size_t y) const
Returns a pixel at (x,y) position.
Definition: solid_pixel_buffer.hpp:175
void put_row(size_t index, row_const_access r)
Replaces the row at specified index.
Definition: solid_pixel_buffer.hpp:165
Pixel buffer, that stores pixels as continuous memory chunk. solid_pixel_buffer is useful when user w...
Definition: solid_pixel_buffer.hpp:55
pixel * row_access
Definition: solid_pixel_buffer.hpp:60
solid_pixel_buffer(uint_32 width, uint_32 height)
Constructs an empty pixel buffer object.
Definition: solid_pixel_buffer.hpp:90
uint_32 m_width
Definition: solid_pixel_buffer.hpp:218
Pixel traits class template.
Definition: pixel_traits.hpp:48
row_const_access get_row(size_t index) const
Returns a const reference to the row of image data at specified index.
Definition: solid_pixel_buffer.hpp:141
size_t m_stride
Definition: solid_pixel_buffer.hpp:220
uint_32 get_height() const
Definition: solid_pixel_buffer.hpp:103
const std::vector< byte > & get_bytes() const
Provides easy constant read access to underlying byte-buffer.
Definition: solid_pixel_buffer.hpp:193
solid_pixel_buffer()
Constructs an empty 0x0 pixel buffer object.
Definition: solid_pixel_buffer.hpp:80
uint_32 m_height
Definition: solid_pixel_buffer.hpp:219
void set_pixel(size_t x, size_t y, pixel p)
Replaces a pixel at (x,y) position.
Definition: solid_pixel_buffer.hpp:184
const pixel * row_const_access
Definition: solid_pixel_buffer.hpp:61
row_const_access operator[](size_t index) const
The non-checking version of get_row() method.
Definition: solid_pixel_buffer.hpp:157