31 namespace afwGeom = lsst::afw::geom;
40 template<
typename ImageT>
44 typename ImageT::Ptr outImage;
46 while (nQuarter < 0) {
52 outImage.reset(
new ImageT(inImage,
true));
55 outImage.reset(
new ImageT(
afwGeom::Extent2I(inImage.getHeight(), inImage.getWidth())));
57 for (
int y = 0;
y != inImage.getHeight(); ++
y) {
58 typename ImageT::y_iterator optr = outImage->col_begin(inImage.getHeight() -
y - 1);
59 for (
typename ImageT::x_iterator iptr = inImage.row_begin(
y), end = inImage.row_end(
y);
60 iptr != end; ++iptr, ++optr) {
67 outImage.reset(
new ImageT(inImage.getDimensions()));
69 for (
int y = 0;
y != inImage.getHeight(); ++
y) {
70 typename ImageT::x_iterator optr = outImage->x_at(inImage.getWidth() - 1,
71 inImage.getHeight() -
y - 1);
72 for (
typename ImageT::x_iterator iptr = inImage.row_begin(
y), end = inImage.row_end(
y);
73 iptr != end; ++iptr, optr -= 1) {
79 outImage.reset(
new ImageT(
afwGeom::Extent2I(inImage.getHeight(), inImage.getWidth())));
81 for (
int y = 0;
y != inImage.getHeight(); ++
y) {
82 typename ImageT::y_iterator optr = outImage->y_at(
y, inImage.getWidth() - 1);
83 for (
typename ImageT::x_iterator iptr = inImage.row_begin(
y), end = inImage.row_end(
y);
84 iptr != end; ++iptr, optr -= 1) {
98 template<
typename ImageT>
103 typename ImageT::Ptr outImage(
new ImageT(inImage,
true));
107 for (
int y = 0;
y != inImage.getHeight(); ++
y) {
108 typename ImageT::x_iterator optr = outImage->x_at(inImage.getWidth() - 1,
109 inImage.getHeight() -
y - 1);
110 for (
typename ImageT::x_iterator iptr = inImage.row_begin(
y), end = inImage.row_end(
y);
111 iptr != end; ++iptr, optr -= 1) {
116 for (
int y = 0;
y != inImage.getHeight(); ++
y) {
117 typename ImageT::x_iterator optr = outImage->x_at(inImage.getWidth() - 1,
y);
118 for (
typename ImageT::x_iterator iptr = inImage.row_begin(
y), end = inImage.row_end(
y);
119 iptr != end; ++iptr, optr -= 1) {
126 for (
int y = 0;
y != inImage.getHeight(); ++
y) {
127 typename ImageT::x_iterator optr = outImage->row_begin(inImage.getHeight() -
y - 1);
128 for (
typename ImageT::x_iterator iptr = inImage.row_begin(
y), end = inImage.row_end(
y);
129 iptr != end; ++iptr, ++optr) {
146 #define INSTANTIATE(TYPE) \
147 template afwImage::Image<TYPE>::Ptr rotateImageBy90(afwImage::Image<TYPE> const&, int); \
148 template afwImage::MaskedImage<TYPE>::Ptr rotateImageBy90(afwImage::MaskedImage<TYPE> const&, int); \
149 template afwImage::Image<TYPE>::Ptr flipImage(afwImage::Image<TYPE> const&, bool flipLR, bool flipTB); \
150 template afwImage::MaskedImage<TYPE>::Ptr flipImage(afwImage::MaskedImage<TYPE> const&, bool flipLR, bool flipTB);
157 template afwImage::Mask<boost::uint16_t>::Ptr
rotateImageBy90(afwImage::Mask<boost::uint16_t> const&,
int);
158 template afwImage::Mask<boost::uint16_t>::Ptr
flipImage(afwImage::Mask<boost::uint16_t> const&,
bool flipLR,
bool flipTB);
boost::shared_ptr< ImageT > flipImage(ImageT const &inImage, bool flipLR, bool flipTB)
table::Key< table::Array< Kernel::Pixel > > image
ImageT::Ptr rotateImageBy90(ImageT const &image, int nQuarter)