LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Pixel Access Reference Manual

(Return to Images)

Image Pixels may be accessed via iterators or locators; the former are simpler if you want single-pixel access, while the latter provide you with access to a pixel's friends and neighbours. There are a set of tutorials:

In the case of MaskedImage, the user-visible iterators and locators (and const variants) are derived from MaskedImageIteratorBase and MaskedImageLocatorBase; the following documentation refers to these base classes.

Iterators

N.b. These iterators aren't the most efficient way to access all the image's pixels as they may not be contiguous in memory so a test for end-of-row is needed after every pixel (we do guarantee that a row's pixels will be contiguous). The exceptions are the begin(bool) and end(bool) pairs which are only valid for contiguous images (they'll throw an exception if the image isn't), but are the fastest way to traverse an image if available. Note that they return an x_iterator not an iterator.

Locators

Locators are more flexible than iterators, permitting us to manipulate regions of an image

(Note that these are function calls, as opposed to the operator[] in the previous APIs)