# wxPixelData< Image, PixelFormat >::wxPixelData::Iterator Class Reference

`#include <wx/rawbmp.h>`

## Detailed Description

### template<class Image, class PixelFormat = wxPixelFormatFor<Image>>
class wxPixelData< Image, PixelFormat >::Iterator

The iterator of class wxPixelData.

## Public Member Functions
void | Reset (const PixelData &data)
| Reset the iterator to point to (0, 0).
| Iterator (PixelData &data)
| Initializes the iterator to point to the origin of the given pixel data.
| Iterator (wxBitmap &bmp, PixelData &data)
| Initializes the iterator to point to the origin of the given Bitmap.
| Iterator ()
| Default constructor.
bool | IsOk () const
| Return true if this iterator is valid.
Iterator & | operator++ ()
| Advance the iterator to the next pixel, prefix version.
Iterator | operator++ (int)
| Advance the iterator to the next pixel, postfix (hence less efficient -- don't use it unless you absolutely must) version.
void | Offset (const PixelData &data, int x, int y)
| Move x pixels to the right and y down.
void | OffsetX (const PixelData &data, int x)
| Move x pixels to the right.
void | OffsetY (const PixelData &data, int y)
| Move y rows to the bottom.
void | MoveTo (const PixelData &data, int x, int y)
| Go to the given position.
ChannelType & | Red ()
| Data Access: Access to individual colour components.
ChannelType & | Green ()
| Data Access: Access to individual colour components.
ChannelType & | Blue ()
| Data Access: Access to individual colour components.
ChannelType & | Alpha ()
| Data Access: Access to individual colour components.

List of all members.

## Constructor & Destructor Documentation

template<class Image , class PixelFormat = wxPixelFormatFor<Image>>

wxPixelData< Image, PixelFormat >::wxPixelData::Iterator::Iterator | ( | PixelData & | data | ) |

Initializes the iterator to point to the origin of the given pixel data.

template<class Image , class PixelFormat = wxPixelFormatFor<Image>>

wxPixelData< Image, PixelFormat >::wxPixelData::Iterator::Iterator | ( | wxBitmap & | bmp,
|  | PixelData & | data |
| ) |  |  |

Initializes the iterator to point to the origin of the given Bitmap.

template<class Image , class PixelFormat = wxPixelFormatFor<Image>>

wxPixelData< Image, PixelFormat >::wxPixelData::Iterator::Iterator | ( |  | ) |

Default constructor.

## Member Function Documentation

template<class Image , class PixelFormat = wxPixelFormatFor<Image>>

ChannelType& wxPixelData< Image, PixelFormat >::wxPixelData::Iterator::Alpha | ( |  | ) |

Data Access: Access to individual colour components.

template<class Image , class PixelFormat = wxPixelFormatFor<Image>>

ChannelType& wxPixelData< Image, PixelFormat >::wxPixelData::Iterator::Blue | ( |  | ) |

Data Access: Access to individual colour components.

template<class Image , class PixelFormat = wxPixelFormatFor<Image>>

ChannelType& wxPixelData< Image, PixelFormat >::wxPixelData::Iterator::Green | ( |  | ) |

Data Access: Access to individual colour components.

template<class Image , class PixelFormat = wxPixelFormatFor<Image>>

bool wxPixelData< Image, PixelFormat >::wxPixelData::Iterator::IsOk | ( |  | ) | const

Return true if this iterator is valid.

template<class Image , class PixelFormat = wxPixelFormatFor<Image>>

void wxPixelData< Image, PixelFormat >::wxPixelData::Iterator::MoveTo | ( | const PixelData & | data,
|  | int | x,
|  | int | y |
| ) |  |  |

Go to the given position.

template<class Image , class PixelFormat = wxPixelFormatFor<Image>>

void wxPixelData< Image, PixelFormat >::wxPixelData::Iterator::Offset | ( | const PixelData & | data,
|  | int | x,
|  | int | y |
| ) |  |  |

Move x pixels to the right and y down.

Note:
  The rows won't wrap automatically.

template<class Image , class PixelFormat = wxPixelFormatFor<Image>>

void wxPixelData< Image, PixelFormat >::wxPixelData::Iterator::OffsetX | ( | const PixelData & | data,
|  | int | x |
| ) |  |  |

Move x pixels to the right.

Note:
  The rows won't wrap automatically.

template<class Image , class PixelFormat = wxPixelFormatFor<Image>>

void wxPixelData< Image, PixelFormat >::wxPixelData::Iterator::OffsetY | ( | const PixelData & | data,
|  | int | y |
| ) |  |  |

Move y rows to the bottom.

template<class Image , class PixelFormat = wxPixelFormatFor<Image>>

Iterator wxPixelData< Image, PixelFormat >::wxPixelData::Iterator::operator++ | ( | int |  | ) |

Advance the iterator to the next pixel, postfix (hence less efficient -- don't use it unless you absolutely must) version.

template<class Image , class PixelFormat = wxPixelFormatFor<Image>>

Iterator& wxPixelData< Image, PixelFormat >::wxPixelData::Iterator::operator++ | ( |  | ) |

Advance the iterator to the next pixel, prefix version.

template<class Image , class PixelFormat = wxPixelFormatFor<Image>>

ChannelType& wxPixelData< Image, PixelFormat >::wxPixelData::Iterator::Red | ( |  | ) |

Data Access: Access to individual colour components.

template<class Image , class PixelFormat = wxPixelFormatFor<Image>>

void wxPixelData< Image, PixelFormat >::wxPixelData::Iterator::Reset | ( | const PixelData & | data | ) |

Reset the iterator to point to (0, 0).

|  | [ top ]