LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
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)