libpng++  v0.2.5-1
C++ library for PNG images
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
png::pixel_buffer< pixel > Class Template Reference

The pixel_buffer specialization for unpacked pixels. More...

#include <pixel_buffer.hpp>

Inheritance diagram for png::pixel_buffer< pixel >:
Collaboration diagram for png::pixel_buffer< pixel >:

Public Types

typedef row_traits
< std::vector< pixel > > 
row_traits
 
typedef std::vector< pixel > row_type
 A row of pixel data. More...
 

Public Member Functions

 pixel_buffer ()
 
 pixel_buffer (size_t width, size_t height)
 
size_t get_height () const
 
pixel get_pixel (size_t x, size_t y) const
 Returns a pixel at (x,y) position. More...
 
row_typeget_row (size_t index)
 Returns a reference to the row of image data at specified index. More...
 
row_type const & get_row (size_t index) const
 Returns a const reference to the row of image data at specified index. More...
 
size_t get_width () const
 
row_typeoperator[] (size_t index)
 The non-checking version of get_row() method. More...
 
row_type const & operator[] (size_t index) const
 The non-checking version of get_row() method. More...
 
void put_row (size_t index, row_type const &r)
 Replaces the row at specified index. More...
 
void resize (size_t width, size_t height)
 Resizes the pixel buffer. More...
 
void set_pixel (size_t x, size_t y, pixel p)
 Replaces a pixel at (x,y) position. More...
 

Protected Types

typedef std::vector< row_typerow_vec
 

Protected Attributes

size_t m_height
 
row_vec m_rows
 
size_t m_width
 

Detailed Description

template<typename pixel>
class png::pixel_buffer< pixel >

The pixel_buffer specialization for unpacked pixels.

Member Typedef Documentation

typedef row_traits< std::vector< pixel > > png::basic_pixel_buffer< pixel, std::vector< pixel > , row_traits< std::vector< pixel > > >::row_traits
inherited
typedef std::vector< pixel > png::basic_pixel_buffer< pixel, std::vector< pixel > , row_traits< std::vector< pixel > > >::row_type
inherited

A row of pixel data.

typedef std::vector< row_type > png::basic_pixel_buffer< pixel, std::vector< pixel > , row_traits< std::vector< pixel > > >::row_vec
protectedinherited

Constructor & Destructor Documentation

template<typename pixel >
png::pixel_buffer< pixel >::pixel_buffer ( )
inline
template<typename pixel >
png::pixel_buffer< pixel >::pixel_buffer ( size_t  width,
size_t  height 
)
inline

Member Function Documentation

size_t png::basic_pixel_buffer< pixel, std::vector< pixel > , row_traits< std::vector< pixel > > >::get_height ( ) const
inlineinherited
pixel png::basic_pixel_buffer< pixel, std::vector< pixel > , row_traits< std::vector< pixel > > >::get_pixel ( size_t  x,
size_t  y 
) const
inlineinherited

Returns a pixel at (x,y) position.

row_type& png::basic_pixel_buffer< pixel, std::vector< pixel > , row_traits< std::vector< pixel > > >::get_row ( size_t  index)
inlineinherited

Returns a reference to the row of image data at specified index.

Checks the index before returning a row: an instance of std::out_of_range is thrown if index is greater than height.

row_type const& png::basic_pixel_buffer< pixel, std::vector< pixel > , row_traits< std::vector< pixel > > >::get_row ( size_t  index) const
inlineinherited

Returns a const reference to the row of image data at specified index.

The checking version.

size_t png::basic_pixel_buffer< pixel, std::vector< pixel > , row_traits< std::vector< pixel > > >::get_width ( ) const
inlineinherited
row_type& png::basic_pixel_buffer< pixel, std::vector< pixel > , row_traits< std::vector< pixel > > >::operator[] ( size_t  index)
inlineinherited

The non-checking version of get_row() method.

row_type const& png::basic_pixel_buffer< pixel, std::vector< pixel > , row_traits< std::vector< pixel > > >::operator[] ( size_t  index) const
inlineinherited

The non-checking version of get_row() method.

void png::basic_pixel_buffer< pixel, std::vector< pixel > , row_traits< std::vector< pixel > > >::put_row ( size_t  index,
row_type const &  r 
)
inlineinherited

Replaces the row at specified index.

void png::basic_pixel_buffer< pixel, std::vector< pixel > , row_traits< std::vector< pixel > > >::resize ( size_t  width,
size_t  height 
)
inlineinherited

Resizes the pixel buffer.

If new width or height is greater than the original, expanded pixels are filled with value of pixel().

void png::basic_pixel_buffer< pixel, std::vector< pixel > , row_traits< std::vector< pixel > > >::set_pixel ( size_t  x,
size_t  y,
pixel  p 
)
inlineinherited

Replaces a pixel at (x,y) position.

Member Data Documentation

size_t png::basic_pixel_buffer< pixel, std::vector< pixel > , row_traits< std::vector< pixel > > >::m_height
protectedinherited
row_vec png::basic_pixel_buffer< pixel, std::vector< pixel > , row_traits< std::vector< pixel > > >::m_rows
protectedinherited
size_t png::basic_pixel_buffer< pixel, std::vector< pixel > , row_traits< std::vector< pixel > > >::m_width
protectedinherited

The documentation for this class was generated from the following file: