png++ 0.2.10

Public Types | Public Member Functions | Protected Types | Protected Attributes | List of all members
png::basic_pixel_buffer< pixel, row, traits > Class Template Reference

The basic class template to represent image pixel data. More...

`#include <pixel_buffer.hpp>`

Inheritance diagram for png::basic_pixel_buffer< pixel, row, traits >:

## Public Types
typedef row | row_type
| A row of pixel data.
typedef row_type & | row_access
typedef row_type const & | row_const_access
typedef traits | row_traits

## Public Member Functions
| basic_pixel_buffer ()
| Constructs an empty 0x0 pixel buffer object.
| basic_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_type const &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.

## Protected Types
typedef std::vector< row_type > | row_vec

## Protected Attributes
uint_32 | m_width
uint_32 | m_height
row_vec | m_rows

## Detailed Description

template<typename pixel, typename row, class traits = row_traits< row >>
class png::basic_pixel_buffer< pixel, row, traits >

The basic class template to represent image pixel data.

## Member Typedef Documentation

## ◆ row_type

template<typename pixel, typename row, class traits = row_traits< row >>

typedef row png::basic_pixel_buffer< pixel, row, traits >::row_type

A row of pixel data.

## ◆ row_access

template<typename pixel, typename row, class traits = row_traits< row >>

typedef row_type& png::basic_pixel_buffer< pixel, row, traits >::row_access

## ◆ row_const_access

template<typename pixel, typename row, class traits = row_traits< row >>

typedef row_type const& png::basic_pixel_buffer< pixel, row, traits >::row_const_access

## ◆ row_traits

template<typename pixel, typename row, class traits = row_traits< row >>

typedef traits png::basic_pixel_buffer< pixel, row, traits >::row_traits

## ◆ row_vec

template<typename pixel, typename row, class traits = row_traits< row >>

typedef std::vector< row_type > png::basic_pixel_buffer< pixel, row, traits >::row_vec
| protected

## Constructor & Destructor Documentation

## ◆ basic_pixel_buffer() [1/2]

template<typename pixel, typename row, class traits = row_traits< row >>

png::basic_pixel_buffer< pixel, row, traits >::basic_pixel_buffer | ( |  | ) |
| inline

Constructs an empty 0x0 pixel buffer object.

References m_height, and m_width.

Referenced by png::pixel_buffer< packed_gray_pixel< bits > >::pixel_buffer(), and png::pixel_buffer< packed_index_pixel< bits > >::pixel_buffer().

## ◆ basic_pixel_buffer() [2/2]

template<typename pixel, typename row, class traits = row_traits< row >>

png::basic_pixel_buffer< pixel, row, traits >::basic_pixel_buffer | ( | uint_32 | width,
|  | uint_32 | height )
| inline

Constructs an empty pixel buffer object.

References m_height, m_width, and resize().

## Member Function Documentation

## ◆ get_width()

template<typename pixel, typename row, class traits = row_traits< row >>

uint_32 png::basic_pixel_buffer< pixel, row, traits >::get_width | ( |  | ) | const
| inline

References m_width.

## ◆ get_height()

template<typename pixel, typename row, class traits = row_traits< row >>

uint_32 png::basic_pixel_buffer< pixel, row, traits >::get_height | ( |  | ) | const
| inline

References m_height.

## ◆ resize()

template<typename pixel, typename row, class traits = row_traits< row >>

void png::basic_pixel_buffer< pixel, row, traits >::resize | ( | uint_32 | width,
|  | uint_32 | 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 m_height, m_rows, and m_width.

Referenced by basic_pixel_buffer().

## ◆ get_row() [1/2]

template<typename pixel, typename row, class traits = row_traits< row >>

row_access png::basic_pixel_buffer< pixel, row, traits >::get_row | ( | size_t | index | ) |
| inline

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`.

References m_rows.

Referenced by get_pixel(), and set_pixel().

## ◆ get_row() [2/2]

template<typename pixel, typename row, class traits = row_traits< row >>

row_const_access png::basic_pixel_buffer< pixel, row, traits >::get_row | ( | size_t | index | ) | const
| inline

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

The checking version.

References m_rows.

## ◆ operator[]() [1/2]

template<typename pixel, typename row, class traits = row_traits< row >>

row_access png::basic_pixel_buffer< pixel, row, traits >::operator[] | ( | size_t | index | ) |
| inline

The non-checking version of get_row() method.

References m_rows.

## ◆ operator[]() [2/2]

template<typename pixel, typename row, class traits = row_traits< row >>

row_const_access png::basic_pixel_buffer< pixel, row, traits >::operator[] | ( | size_t | index | ) | const
| inline

The non-checking version of get_row() method.

References m_rows.

## ◆ put_row()

template<typename pixel, typename row, class traits = row_traits< row >>

void png::basic_pixel_buffer< pixel, row, traits >::put_row | ( | size_t | index,
|  | row_type const & | r )
| inline

Replaces the row at specified index.

References m_rows, and m_width.

## ◆ get_pixel()

template<typename pixel, typename row, class traits = row_traits< row >>

pixel png::basic_pixel_buffer< pixel, row, traits >::get_pixel | ( | size_t | x,
|  | size_t | y ) const
| inline

Returns a pixel at (x,y) position.

References get_row().

## ◆ set_pixel()

template<typename pixel, typename row, class traits = row_traits< row >>

void png::basic_pixel_buffer< pixel, row, traits >::set_pixel | ( | size_t | x,
|  | size_t | y,
|  | pixel | p )
| inline

Replaces a pixel at (x,y) position.

References get_row().

## Member Data Documentation

## ◆ m_width

template<typename pixel, typename row, class traits = row_traits< row >>

uint_32 png::basic_pixel_buffer< pixel, row, traits >::m_width
| protected

Referenced by basic_pixel_buffer(), basic_pixel_buffer(), get_width(), put_row(), and resize().

## ◆ m_height

template<typename pixel, typename row, class traits = row_traits< row >>

uint_32 png::basic_pixel_buffer< pixel, row, traits >::m_height
| protected

Referenced by basic_pixel_buffer(), basic_pixel_buffer(), get_height(), and resize().

## ◆ m_rows

template<typename pixel, typename row, class traits = row_traits< row >>

row_vec png::basic_pixel_buffer< pixel, row, traits >::m_rows
| protected

Referenced by get_row(), get_row(), operator[](), operator[](), put_row(), and resize().

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

- pixel_buffer.hpp