27 #include "lsst/pex/exceptions.h" 34 template<
typename PixelT>
36 afw::image::Image<PixelT> &image,
37 ndarray::Array<PixelT, 1, 1>
const &table,
40 if (table.size() == 0u) {
42 pex::exceptions::LengthError,
43 "Lookup table has zero size." 46 int numOutOfRange = 0;
47 int const maxLookupCol = table.size() - 1;
48 for (
int col = 0, imHeight = image.getHeight(); col < imHeight; ++col) {
49 for (
auto imPtr = image.row_begin(col), end = image.row_end(col); imPtr != end; ++imPtr) {
50 int lookupCol = indOffset + *imPtr;
54 }
else if (lookupCol > maxLookupCol) {
55 lookupCol = maxLookupCol;
58 *imPtr += table[lookupCol];
64 #define INSTANTIATE(T) \ 65 template int applyLookupTable<T>(afw::image::Image<T> &, ndarray::Array<T, 1, 1> const &, T);
Remove all non-astronomical counts from the Chunk Exposure's pixels.
int applyLookupTable(afw::image::Image< PixelT > &image, ndarray::Array< PixelT, 1, 1 > const &table, PixelT indOffset)
Add the values in a lookup table to an image, e.g.