lsst.afw  13.0-94-ga1c444047
Image.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 
3 /*
4  * LSST Data Management System
5  * Copyright 2008, 2009, 2010 LSST Corporation.
6  *
7  * This product includes software developed by the
8  * LSST Project (http://www.lsst.org/).
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the LSST License Statement and
21  * the GNU General Public License along with this program. If not,
22  * see <http://www.lsstcorp.org/LegalNotices/>.
23  */
24 
25 /*
26  * Support for 2-D images
27  *
28  * This file contains the basic 2-d image support for LSST
29  */
30 #ifndef LSST_AFW_IMAGE_IMAGE_H
31 #define LSST_AFW_IMAGE_IMAGE_H
32 
33 #include <list>
34 #include <map>
35 #include <string>
36 #include <utility>
37 #include <functional>
38 
39 #include "boost/mpl/bool.hpp"
40 #include <climits>
41 #include <memory>
42 
43 #include "lsst/afw/geom/Extent.h"
44 #include "lsst/afw/geom/Box.h"
45 #include "lsst/afw/geom/Point.h"
46 #include "lsst/afw/image/lsstGil.h"
48 #include "lsst/afw/math/Function.h"
49 #include "lsst/daf/base.h"
50 #include "lsst/daf/base/Citizen.h"
51 #include "lsst/pex/exceptions.h"
52 #include "ndarray.h"
53 
54 namespace lsst {
55 namespace afw {
56 
57 namespace formatters {
58 template <typename PixelT>
59 class ImageFormatter;
60 template <typename PixelT>
61 class DecoratedImageFormatter;
62 }
63 
64 namespace fits {
65 class Fits;
66 class MemFileManager;
67 }
68 
69 namespace image {
70 namespace detail {
71 //
72 // Traits for image types
73 //
75 struct basic_tag {};
77 struct Image_tag : public basic_tag {};
79 template <typename ImageT>
80 struct image_traits {
81  typedef typename ImageT::image_category image_category;
82 };
83 //
84 std::string const wcsNameForXY0 = "A"; // the name of the WCS to use to save (X0, Y0) to FITS files; e.g. "A"
85 }
86 
88 class CheckIndices {
89 public:
90  explicit CheckIndices(bool check = true) : _check(check) {}
91  operator bool() const { return _check; }
92 
93 private:
94  bool _check;
95 };
96 
98 template <typename PixelT>
99 struct Reference {
100  typedef typename boost::gil::channel_traits<PixelT>::reference type;
101 };
103 template <typename PixelT>
105  typedef typename boost::gil::channel_traits<PixelT>::const_reference type;
106 };
107 
109 
111 //
112 // You are not expected to use this class directly in your own code; use one of the
113 // specialised subclasses
114 //
115 template <typename PixelT>
116 class ImageBase : public lsst::daf::base::Persistable, public lsst::daf::base::Citizen {
117 private:
118  typedef typename lsst::afw::image::detail::types_traits<PixelT>::view_t _view_t;
119  typedef typename lsst::afw::image::detail::types_traits<PixelT>::const_view_t _const_view_t;
120 
121  typedef ndarray::Manager Manager;
122 
123 public:
125 
127  typedef PixelT SinglePixel;
129  typedef PixelT Pixel;
135  typedef typename _view_t::xy_locator xy_locator;
137  typedef typename _view_t::xy_locator::const_t const_xy_locator;
139  typedef typename _view_t::iterator iterator;
141  typedef typename _const_view_t::iterator const_iterator;
143  typedef typename _view_t::reverse_iterator reverse_iterator;
145  typedef typename _const_view_t::reverse_iterator const_reverse_iterator;
147  typedef typename _view_t::x_iterator x_iterator;
151  typedef x_iterator fast_iterator;
153  typedef typename _view_t::x_iterator xy_x_iterator;
155  typedef typename _const_view_t::x_iterator const_x_iterator;
157  typedef typename _view_t::y_iterator y_iterator;
159  typedef typename _view_t::y_iterator xy_y_iterator;
161  typedef typename _const_view_t::y_iterator const_y_iterator;
163  typedef typename ndarray::Array<PixelT, 2, 1> Array;
165  typedef typename ndarray::Array<PixelT const, 2, 1> ConstArray;
166 
167  template <typename OtherPixelT>
168  friend class ImageBase; // needed by generalised copy constructors
169 
171  template <typename SinglePixelT>
172  static SinglePixel PixelCast(SinglePixelT rhs) {
173  return SinglePixel(rhs);
174  }
175  //
176  // DecoratedImage needs enough access to ImageBase to read data from disk; we might be able to design
177  // around this
178  //
179  template <typename>
180  friend class DecoratedImage;
181  template <typename, typename, typename>
182  friend class MaskedImage;
189  explicit ImageBase(const geom::Extent2I& dimensions = geom::Extent2I());
195  explicit ImageBase(const geom::Box2I& bbox);
206  ImageBase(const ImageBase& src, const bool deep = false);
221  explicit ImageBase(const ImageBase& src, const geom::Box2I& bbox, const ImageOrigin origin = PARENT,
222  const bool deep = false);
229  template <typename OtherPixelT>
230  ImageBase(const ImageBase<OtherPixelT>& rhs, const bool deep) : lsst::daf::base::Citizen(typeid(this)) {
231  if (!deep) {
232  throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError,
233  "Only deep copies are permitted for ImageBases with different pixel types");
234  }
235 
236  ImageBase<PixelT> tmp(rhs.getBBox());
237  copy_and_convert_pixels(rhs._gilView, tmp._gilView); // from boost::gil
238 
239  using std::swap; // See Meyers, Effective C++, Item 25
240  ImageBase<PixelT>::swap(tmp); // See Meyers, Effective C++, Items 11 and 43
241  }
242 
252  explicit ImageBase(Array const& array, bool deep = false, geom::Point2I const& xy0 = geom::Point2I());
253 
254  virtual ~ImageBase() {}
263  ImageBase& operator=(const ImageBase& rhs);
265  ImageBase& operator=(const PixelT rhs);
271  ImageBase& operator<<=(const ImageBase& rhs);
272 
284  void assign(ImageBase const& rhs, geom::Box2I const& bbox = geom::Box2I(), ImageOrigin origin = PARENT);
285  //
286  // Operators etc.
287  //
289  PixelReference operator()(int x, int y);
291  PixelReference operator()(int x, int y, CheckIndices const&);
293  PixelConstReference operator()(int x, int y) const;
295  PixelConstReference operator()(int x, int y, CheckIndices const&) const;
296 
297  PixelConstReference get0(int x, int y) const { return operator()(x - getX0(), y - getY0()); }
298  PixelConstReference get0(int x, int y, CheckIndices const& check) const {
299  return operator()(x - getX0(), y - getY0(), check);
300  }
301  void set0(int x, int y, const PixelT v) { operator()(x - getX0(), y - getY0()) = v; }
302  void set0(int x, int y, const PixelT v, CheckIndices const& check) {
303  operator()(x - getX0(), y - getY0(), check) = v;
304  }
305 
307  int getWidth() const { return _gilView.width(); }
309  int getHeight() const { return _gilView.height(); }
317  int getX0() const { return _origin.getX(); }
325  int getY0() const { return _origin.getY(); }
326 
334  geom::Point2I getXY0() const { return _origin; }
335 
341  std::pair<int, double> positionToIndex(
342  double const pos,
343  lsst::afw::image::xOrY const xy
344  ) const {
345  double const fullIndex = pos - PixelZeroPos - (xy == X ? getX0() : getY0());
346  int const roundedIndex = static_cast<int>(fullIndex + 0.5);
347  double const residual = fullIndex - roundedIndex;
348  return std::pair<int, double>(roundedIndex, residual);
349  }
350 
360  inline double indexToPosition(double ind,
361  lsst::afw::image::xOrY const xy
362  ) const {
363  return ind + PixelZeroPos + (xy == X ? getX0() : getY0());
364  }
365 
367  geom::Extent2I getDimensions() const { return geom::Extent2I(getWidth(), getHeight()); }
368 
369  void swap(ImageBase& rhs);
370 
371  Array getArray();
372  ConstArray getArray() const;
373  //
374  // Iterators and Locators
375  //
381  iterator begin() const;
383  iterator end() const;
385  reverse_iterator rbegin() const;
387  reverse_iterator rend() const;
389  iterator at(int x, int y) const;
390 
398  fast_iterator begin(bool) const;
406  fast_iterator end(bool) const;
407 
412  x_iterator row_begin(int y) const { return _gilView.row_begin(y); }
413 
415  x_iterator row_end(int y) const { return _gilView.row_end(y); }
416 
418  x_iterator x_at(int x, int y) const { return _gilView.x_at(x, y); }
419 
424  y_iterator col_begin(int x) const { return _gilView.col_begin(x); }
425 
427  y_iterator col_end(int x) const { return _gilView.col_end(x); }
428 
430  y_iterator y_at(int x, int y) const { return _gilView.y_at(x, y); }
431 
436  xy_locator xy_at(int x, int y) const { return xy_locator(_gilView.xy_at(x, y)); }
445  void setXY0(geom::Point2I const origin) { _origin = origin; }
454  void setXY0(int const x0, int const y0) { setXY0(geom::Point2I(x0, y0)); }
455 
457  if (origin == PARENT) {
458  return geom::Box2I(_origin, getDimensions());
459  } else
460  return geom::Box2I(geom::Point2I(0, 0), getDimensions());
461  }
462 
463 private:
464  geom::Point2I _origin;
465  Manager::Ptr _manager;
466  _view_t _gilView;
467 
468  // oring of ImageBase in some larger image as returned to and manipulated
469  // by the user
470 
471 protected:
472  static _view_t _allocateView(geom::Extent2I const& dimensions, Manager::Ptr& manager);
473  static _view_t _makeSubView(geom::Extent2I const& dimensions, geom::Extent2I const& offset,
474  const _view_t& view);
475 
476  _view_t _getRawView() const { return _gilView; }
477 
478  inline bool isContiguous() const { return begin() + getWidth() * getHeight() == end(); }
479 };
480 
481 template <typename PixelT>
483 
485 template <typename PixelT>
486 class Image : public ImageBase<PixelT> {
487 public:
488  template <typename, typename, typename>
489  friend class MaskedImage;
490 
492 
494  template <typename ImagePT = PixelT>
498  };
499  template <typename OtherPixelT>
500  friend class Image; // needed by generalised copy constructors
501 
512  explicit Image(unsigned int width, unsigned int height, PixelT initialValue = 0);
522  explicit Image(geom::Extent2I const& dimensions = geom::Extent2I(), PixelT initialValue = 0);
529  explicit Image(geom::Box2I const& bbox, PixelT initialValue = 0);
530 
544  explicit Image(Image const& rhs, geom::Box2I const& bbox, ImageOrigin const origin = PARENT,
545  const bool deep = false);
555  Image(const Image& rhs, const bool deep = false);
556 
569  explicit Image(std::string const& fileName, int hdu = INT_MIN,
570  std::shared_ptr<lsst::daf::base::PropertySet> metadata =
571  std::shared_ptr<lsst::daf::base::PropertySet>(),
572  geom::Box2I const& bbox = geom::Box2I(), ImageOrigin origin = PARENT);
573 
586  explicit Image(fits::MemFileManager& manager, int hdu = INT_MIN,
587  std::shared_ptr<lsst::daf::base::PropertySet> metadata =
588  std::shared_ptr<lsst::daf::base::PropertySet>(),
589  geom::Box2I const& bbox = geom::Box2I(), ImageOrigin origin = PARENT);
590 
600  explicit Image(fits::Fits& fitsfile, std::shared_ptr<lsst::daf::base::PropertySet> metadata =
601  std::shared_ptr<lsst::daf::base::PropertySet>(),
602  geom::Box2I const& bbox = geom::Box2I(), ImageOrigin origin = PARENT);
603 
604  // generalised copy constructor
605  template <typename OtherPixelT>
606  Image(Image<OtherPixelT> const& rhs, const bool deep) : image::ImageBase<PixelT>(rhs, deep) {}
607 
608  explicit Image(ndarray::Array<PixelT, 2, 1> const& array, bool deep = false,
609  geom::Point2I const& xy0 = geom::Point2I())
610  : image::ImageBase<PixelT>(array, deep, xy0) {}
611 
612  virtual ~Image() {}
613  //
614  // Assignment operators are not inherited
615  //
617  Image& operator=(const PixelT rhs);
627  Image& operator=(const Image& rhs);
628 
636  void writeFits(std::string const& fileName, std::shared_ptr<lsst::daf::base::PropertySet const> metadata =
637  std::shared_ptr<lsst::daf::base::PropertySet const>(),
638  std::string const& mode = "w") const;
639 
647  void writeFits(fits::MemFileManager& manager,
648  std::shared_ptr<lsst::daf::base::PropertySet const> metadata =
649  std::shared_ptr<lsst::daf::base::PropertySet const>(),
650  std::string const& mode = "w") const;
651 
658  void writeFits(fits::Fits& fitsfile, std::shared_ptr<lsst::daf::base::PropertySet const> metadata =
659  std::shared_ptr<lsst::daf::base::PropertySet const>()) const;
660 
669  static Image readFits(std::string const& filename, int hdu = INT_MIN) {
670  return Image<PixelT>(filename, hdu);
671  }
672 
681  static Image readFits(fits::MemFileManager& manager, int hdu = INT_MIN) {
682  return Image<PixelT>(manager, hdu);
683  }
684 
685  void swap(Image& rhs);
686  //
687  // Operators etc.
688  //
690  Image& operator+=(PixelT const rhs);
692  virtual Image& operator+=(Image<PixelT> const& rhs);
700  void scaledPlus(double const c, Image<PixelT> const& rhs);
702  Image& operator-=(PixelT const rhs);
704  Image& operator-=(Image<PixelT> const& rhs);
712  void scaledMinus(double const c, Image<PixelT> const& rhs);
714  Image& operator*=(PixelT const rhs);
716  Image& operator*=(Image<PixelT> const& rhs);
718  void scaledMultiplies(double const c, Image<PixelT> const& rhs);
724  Image& operator/=(PixelT const rhs);
726  Image& operator/=(Image<PixelT> const& rhs);
728  void scaledDivides(double const c, Image<PixelT> const& rhs);
729 
730  // In-place per-pixel sqrt(). Useful when handling variance planes.
731  void sqrt();
732 
733 protected:
735 
736 private:
737  LSST_PERSIST_FORMATTER(lsst::afw::formatters::ImageFormatter<PixelT>)
738 };
739 
741 template <typename LhsPixelT, typename RhsPixelT>
744 template <typename LhsPixelT, typename RhsPixelT>
747 template <typename LhsPixelT, typename RhsPixelT>
750 template <typename LhsPixelT, typename RhsPixelT>
752 
753 template <typename PixelT>
754 void swap(Image<PixelT>& a, Image<PixelT>& b);
755 
759 template <typename PixelT>
760 class DecoratedImage : public lsst::daf::base::Persistable, public lsst::daf::base::Citizen {
761 public:
776  explicit DecoratedImage(const geom::Box2I& bbox);
784  explicit DecoratedImage(std::shared_ptr<Image<PixelT>> rhs);
793  DecoratedImage(DecoratedImage const& rhs, const bool deep = false);
802  explicit DecoratedImage(std::string const& fileName, const int hdu = INT_MIN,
803  geom::Box2I const& bbox = geom::Box2I(), ImageOrigin const origin = PARENT);
804 
810  DecoratedImage& operator=(const DecoratedImage& image);
811 
812  std::shared_ptr<lsst::daf::base::PropertySet> getMetadata() const { return _metadata; }
813  void setMetadata(std::shared_ptr<lsst::daf::base::PropertySet> metadata) { _metadata = metadata; }
814 
816  int getWidth() const { return _image->getWidth(); }
818  int getHeight() const { return _image->getHeight(); }
819 
821  int getX0() const { return _image->getX0(); }
823  int getY0() const { return _image->getY0(); }
824 
826  const geom::Extent2I getDimensions() const { return _image->getDimensions(); }
827 
828  void swap(DecoratedImage& rhs);
829 
837  void writeFits(std::string const& fileName, std::shared_ptr<lsst::daf::base::PropertySet const> metadata =
838  std::shared_ptr<lsst::daf::base::PropertySet const>(),
839  std::string const& mode = "w") const;
840 
842  std::shared_ptr<Image<PixelT>> getImage() { return _image; }
844  std::shared_ptr<Image<PixelT> const> getImage() const { return _image; }
845 
851  double getGain() const { return _gain; }
853  void setGain(double gain) { _gain = gain; }
854 
855 private:
857  std::shared_ptr<Image<PixelT>> _image;
858  std::shared_ptr<lsst::daf::base::PropertySet> _metadata;
859 
860  double _gain;
861 
862  void init();
863 };
864 
865 template <typename PixelT>
867 
873 
874 }
875 }
876 } // lsst::afw::image
877 
878 #endif
bool isContiguous() const
Definition: Image.h:478
std::shared_ptr< Image< PixelT > > getImage()
Return a shared_ptr to the DecoratedImage&#39;s Image.
Definition: Image.h:842
boost::gil::channel_traits< PixelT >::reference type
reference type
Definition: Image.h:100
void setXY0(geom::Point2I const origin)
Set the ImageBase&#39;s origin.
Definition: Image.h:445
std::shared_ptr< Image< PixelT > const > getImage() const
Return a shared_ptr to the DecoratedImage&#39;s Image as const.
Definition: Image.h:844
A templated class to return this classes&#39; type (present in Image/Mask/MaskedImage) ...
Definition: Image.h:495
afw::table::PointKey< int > dimensions
Definition: GaussianPsf.cc:44
void scaledPlus(OutImageT &outImage, double c1, InImageT const &inImage1, double c2, InImageT const &inImage2)
Compute the scaled sum of two images.
_const_view_t::reverse_iterator const_reverse_iterator
An STL compliant const reverse iterator.
Definition: Image.h:145
x_iterator fast_iterator
A fast STL compliant iterator for contiguous images N.b.
Definition: Image.h:151
std::shared_ptr< lsst::daf::base::PropertySet > getMetadata() const
Definition: Image.h:812
ConstReference< PixelT >::type PixelConstReference
A ConstReference to a PixelT.
Definition: Image.h:133
int getWidth() const
Return the number of columns in the image.
Definition: Image.h:816
_view_t::reverse_iterator reverse_iterator
An STL compliant reverse iterator.
Definition: Image.h:143
std::pair< int, double > positionToIndex(double const pos, lsst::afw::image::xOrY const xy) const
Convert image position to index (nearest integer and fractional parts)
Definition: Image.h:341
int getHeight() const
Return the number of rows in the image.
Definition: Image.h:818
_view_t::x_iterator xy_x_iterator
An iterator for traversing the pixels in a row, created from an xy_locator.
Definition: Image.h:153
Image< LhsPixelT > & operator+=(Image< LhsPixelT > &lhs, Image< RhsPixelT > const &rhs)
Add lhs to Image rhs (i.e. pixel-by-pixel addition) where types are different.
Definition: Image.cc:638
void set0(int x, int y, const PixelT v, CheckIndices const &check)
Definition: Image.h:302
geom::Box2I getBBox(ImageOrigin origin=PARENT) const
Definition: Image.h:456
detail::basic_tag image_category
trait class to identify type of image
Definition: Image.h:124
int getHeight() const
Return the number of rows in the image.
Definition: Image.h:309
static Image readFits(std::string const &filename, int hdu=INT_MIN)
Read an Image from a regular FITS file.
Definition: Image.h:669
const geom::Extent2I getDimensions() const
Return the image&#39;s size; useful for passing to constructors.
Definition: Image.h:826
_const_view_t::x_iterator const_x_iterator
A const iterator for traversing the pixels in a row.
Definition: Image.h:155
PixelT Pixel
A pixel in this ImageBase.
Definition: Image.h:129
_view_t::x_iterator x_iterator
An iterator for traversing the pixels in a row.
Definition: Image.h:147
Extent< int, 2 > Extent2I
Definition: Extent.h:341
virtual ~Image()
Definition: Image.h:612
int getX0() const
Return the image&#39;s column-origin.
Definition: Image.h:317
void setMetadata(std::shared_ptr< lsst::daf::base::PropertySet > metadata)
Definition: Image.h:813
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
Definition: fits.h:199
The base class for all image classed (Image, Mask, MaskedImage, ...)
Definition: Image.h:116
A Function taking two arguments.
Definition: Function.h:266
x_iterator row_begin(int y) const
Return an x_iterator to the start of the y&#39;th row.
Definition: Image.h:412
_const_view_t::iterator const_iterator
An STL compliant const iterator.
Definition: Image.h:141
An integer coordinate rectangle.
Definition: Box.h:55
_view_t::iterator iterator
An STL compliant iterator.
Definition: Image.h:139
y_iterator y_at(int x, int y) const
Return an y_iterator to the point (x, y) in the image.
Definition: Image.h:430
y_iterator col_begin(int x) const
Return an y_iterator to the start of the y&#39;th row.
Definition: Image.h:424
geom::Extent2I getDimensions() const
Return the image&#39;s size; useful for passing to constructors.
Definition: Image.h:367
A base class for image defects.
Definition: cameraGeom.dox:3
void set0(int x, int y, const PixelT v)
Definition: Image.h:301
Lifetime-management for memory that goes into FITS memory files.
Definition: fits.h:100
A class to manipulate images, masks, and variance as a single object.
Definition: MaskedImage.h:81
_view_t::y_iterator y_iterator
An iterator for traversing the pixels in a column.
Definition: Image.h:157
traits class for image categories
Definition: Image.h:80
A class used to request that array accesses be checked.
Definition: Image.h:88
geom::Box2I bboxFromMetadata(daf::base::PropertySet &metadata)
Determine the image bounding box from its metadata (FITS header)
Definition: Image.cc:661
y_iterator col_end(int x) const
Return an y_iterator to the start of the y&#39;th row.
Definition: Image.h:427
void setGain(double gain)
Set the DecoratedImage&#39;s gain.
Definition: Image.h:853
Class implementing persistence and retrieval for Images.
Image(ndarray::Array< PixelT, 2, 1 > const &array, bool deep=false, geom::Point2I const &xy0=geom::Point2I())
Definition: Image.h:608
double x
ndarray::Array< PixelT const, 2, 1 > ConstArray
An immutable ndarray representation of the image.
Definition: Image.h:165
void setXY0(int const x0, int const y0)
Set the ImageBase&#39;s origin.
Definition: Image.h:454
_view_t::xy_locator::const_t const_xy_locator
A const_xy_locator.
Definition: Image.h:137
void swap(DecoratedImage< PixelT > &a, DecoratedImage< PixelT > &b)
Image< LhsPixelT > & operator*=(Image< LhsPixelT > &lhs, Image< RhsPixelT > const &rhs)
Multiply lhs by Image rhs (i.e. pixel-by-pixel multiplication) where types are different.
Definition: Image.cc:650
int getY0() const
Return the image&#39;s row-origin.
Definition: Image.h:325
Image< LhsPixelT > & operator-=(Image< LhsPixelT > &lhs, Image< RhsPixelT > const &rhs)
Subtract lhs from Image rhs (i.e. pixel-by-pixel subtraction) where types are different.
Definition: Image.cc:644
_const_view_t::y_iterator const_y_iterator
A const iterator for traversing the pixels in a column.
Definition: Image.h:161
lsst::daf::base::PropertySet PropertySet
Definition: Wcs.cc:55
int getWidth() const
Return the number of columns in the image.
Definition: Image.h:307
Reference< PixelT >::type PixelReference
A Reference to a PixelT.
Definition: Image.h:131
static SinglePixel PixelCast(SinglePixelT rhs)
Convert a type to our SinglePixel type.
Definition: Image.h:172
x_iterator row_end(int y) const
Return an x_iterator to the end of the y&#39;th row.
Definition: Image.h:415
x_iterator x_at(int x, int y) const
Return an x_iterator to the point (x, y) in the image.
Definition: Image.h:418
int getX0() const
Return the image&#39;s column-origin.
Definition: Image.h:821
ImageT::image_category image_category
Definition: Image.h:81
static Image readFits(fits::MemFileManager &manager, int hdu=INT_MIN)
Read an Image from a FITS RAM file.
Definition: Image.h:681
Image< LhsPixelT > & operator/=(Image< LhsPixelT > &lhs, Image< RhsPixelT > const &rhs)
Divide lhs by Image rhs (i.e. pixel-by-pixel division) where types are different. ...
Definition: Image.cc:656
Class implementing persistence and retrieval for DecoratedImages.
PixelConstReference get0(int x, int y, CheckIndices const &check) const
Definition: Image.h:298
_view_t _getRawView() const
Definition: Image.h:476
const double PixelZeroPos
position of center of pixel 0
Definition: ImageUtils.h:44
_view_t::xy_locator xy_locator
An xy_locator.
Definition: Image.h:135
ImageBase(const ImageBase< OtherPixelT > &rhs, const bool deep)
generalised copy constructor
Definition: Image.h:230
Image(Image< OtherPixelT > const &rhs, const bool deep)
Definition: Image.h:606
ndarray::Array< PixelT, 2, 1 > Array
A mutable ndarray representation of the image.
Definition: Image.h:163
xy_locator xy_at(int x, int y) const
Return an xy_locator at the point (x, y) in the image.
Definition: Image.h:436
PixelConstReference get0(int x, int y) const
Definition: Image.h:297
PixelT SinglePixel
A single Pixel of the same type as those in the ImageBase.
Definition: Image.h:127
int getY0() const
Return the image&#39;s row-origin.
Definition: Image.h:823
A class to represent a 2-dimensional array of pixels.
Definition: Image.h:486
CheckIndices(bool check=true)
Definition: Image.h:90
detail::Image_tag image_category
Definition: Image.h:491
double indexToPosition(double ind, lsst::afw::image::xOrY const xy) const
Convert image index to image position.
Definition: Image.h:360
double getGain() const
Return the DecoratedImage&#39;s gain.
Definition: Image.h:851
std::string const wcsNameForXY0
Definition: Image.h:84
int end
boost::gil::channel_traits< PixelT >::const_reference type
const reference type
Definition: Image.h:105
Image< ImagePT > type
Return the desired type.
Definition: Image.h:497
A container for an Image and its associated metadata.
Definition: Image.h:760
metafunction to extract reference type from PixelT
Definition: Image.h:99
_view_t::y_iterator xy_y_iterator
An iterator for traversing the pixels in a row, created from an xy_locator.
Definition: Image.h:159
geom::Point2I getXY0() const
Return the image&#39;s origin.
Definition: Image.h:334
metafunction to extract const reference type from PixelT
Definition: Image.h:104