30 #define __attribute__(x) 37 #include "boost/serialization/shared_ptr.hpp" 38 #include "boost/serialization/binary_object.hpp" 39 #include "boost/serialization/nvp.hpp" 40 #include <boost/archive/binary_oarchive.hpp> 41 #include <boost/archive/binary_iarchive.hpp> 50 LOG_LOGGER _log =
LOG_GET(
"afw.DecoratedImageFormatter");
53 using boost::serialization::make_nvp;
63 namespace formatters {
65 template <
typename ImagePixelT>
97 template <
typename ImagePixelT>
102 template <
typename ImagePixelT>
106 template <
typename ImagePixelT>
109 template <
typename ImagePixelT>
113 LOGL_DEBUG(_log,
"DecoratedImageFormatter write start");
122 LOGL_DEBUG(_log,
"DecoratedImageFormatter write BoostStorage");
123 boost->getOArchive() & *ip;
124 LOGL_DEBUG(_log,
"DecoratedImageFormatter write end");
129 LOGL_DEBUG(_log,
"DecoratedImageFormatter write XmlStorage");
130 xml->getOArchive() & make_nvp(
"img", *ip);
131 LOGL_DEBUG(_log,
"DecoratedImageFormatter write end");
136 LOGL_DEBUG(_log,
"DecoratedImageFormatter write FitsStorage");
142 LOGL_DEBUG(_log,
"DecoratedImageFormatter write end");
146 "Unrecognized FormatterStorage for DecoratedImage");
149 template <
typename ImagePixelT>
153 LOGL_DEBUG(_log,
"DecoratedImageFormatter read start");
157 LOGL_DEBUG(_log,
"DecoratedImageFormatter read BoostStorage");
159 boost->getIArchive() & *ip;
160 LOGL_DEBUG(_log,
"DecoratedImageFormatter read end");
165 LOGL_DEBUG(_log,
"DecoratedImageFormatter read XmlStorage");
167 boost->getIArchive() & make_nvp(
"img", *ip);
168 LOGL_DEBUG(_log,
"DecoratedImageFormatter read end");
173 LOGL_DEBUG(_log,
"DecoratedImageFormatter read FitsStorage");
175 if (additionalData->exists(
"llcX")) {
176 int llcX = additionalData->
get<
int>(
"llcX");
177 int llcY = additionalData->
get<
int>(
"llxY");
178 int width = additionalData->
get<
int>(
"width");
179 int height = additionalData->
get<
int>(
"height");
184 LOGL_DEBUG(_log,
"DecoratedImageFormatter read end");
188 "Unrecognized FormatterStorage for DecoratedImage");
191 template <
typename ImagePixelT>
198 template <
typename ImagePixelT>
199 template <
class Archive>
201 LOGL_DEBUG(_log,
"DecoratedImageFormatter delegateSerialize start");
207 "DecoratedImage serialization not yet implemented");
210 template <
typename ImagePixelT>
217 #define InstantiateFormatter(ImagePixelT) \ 218 template class DecoratedImageFormatter<ImagePixelT>; \ 219 template void DecoratedImageFormatter<ImagePixelT>::delegateSerialize(boost::archive::text_oarchive&, \ 220 int const, Persistable*); \ 221 template void DecoratedImageFormatter<ImagePixelT>::delegateSerialize(boost::archive::text_iarchive&, \ 222 int const, Persistable*); \ 223 template void DecoratedImageFormatter<ImagePixelT>::delegateSerialize(boost::archive::binary_oarchive&, \ 224 int const, Persistable*); \ 225 template void DecoratedImageFormatter<ImagePixelT>::delegateSerialize(boost::archive::binary_iarchive&, \ 226 int const, Persistable*); 234 #undef InstantiateFormatter
#define LOGL_DEBUG(logger, message...)
An integer coordinate rectangle.
A base class for image defects.
void writeFits(std::string const &fileName, std::shared_ptr< lsst::daf::base::PropertySet const > metadata=std::shared_ptr< lsst::daf::base::PropertySet const >(), std::string const &mode="w") const
Write a FITS file.
T dynamic_pointer_cast(T... args)
#define LSST_EXCEPT(type,...)
A container for an Image and its associated metadata.