38 #ifndef OME_BIOFORMATS_PIXELBUFFER_H
39 #define OME_BIOFORMATS_PIXELBUFFER_H
47 #include <boost/multi_array.hpp>
49 #include <ome/bioformats/PixelProperties.h>
57 #include <ome/xml/model/enums/DimensionOrder.h>
112 typedef boost::multi_array_types::index
index;
115 typedef ome::compat::array<boost::multi_array_types::index,
122 typedef boost::detail::multi_array::extent_gen<dimensions>
range_type;
134 pixeltype(pixeltype),
135 endiantype(endiantype)
177 static storage_order_type
189 static storage_order_type
251 typedef boost::multi_array<value_type, dimensions>
array_type;
261 multiarray(
ome::compat::shared_ptr<array_type>(new array_type(boost::extents[1][1][1][1][1][1][1][1][1],
276 template<
class ExtentList>
283 multiarray(
ome::compat::shared_ptr<array_type>(new array_type(extents, storage)))
300 template<
class ExtentList>
303 const ExtentList& extents,
308 multiarray(
ome::compat::shared_ptr<array_ref_type>(new array_ref_type(pixeldata, extents, storage)))
328 multiarray(
ome::compat::shared_ptr<array_type>(new array_type(range, storage)))
352 multiarray(
ome::compat::shared_ptr<array_ref_type>(new array_ref_type(pixeldata, range, storage)))
388 const array_ref_type&
402 return array().data();
416 return array().data();
432 bool is_valid =
true;
438 catch (
const std::runtime_error& e)
456 return (boost::get<ome::compat::shared_ptr<array_type> >(&
multiarray) != 0);
465 return array().num_elements();
474 return array().num_dimensions();
487 return array().shape();
497 const boost::multi_array_types::index *
500 return array().strides();
511 const boost::multi_array_types::index *
514 return array().index_bases();
530 return array().origin();
541 return array().storage_order();
599 return array() == rhs;
623 return array() != rhs;
647 return array() < rhs;
671 return array() <= rhs;
695 return array() > rhs;
719 return array() >= rhs;
730 template <
typename InputIterator>
735 array().assign(begin, end);
751 return array()(indices);
767 return array()(indices);
780 template<
class charT,
class traits>
782 read(std::basic_istream<charT,traits>& stream)
784 stream.read(reinterpret_cast<char *>(
data()),
785 static_cast<std::streamsize>(
num_elements() *
sizeof(value_type)));
798 template<
class charT,
class traits>
800 write(std::basic_ostream<charT,traits>& stream)
const
802 stream.write(reinterpret_cast<const char *>(
data()),
803 static_cast<std::streamsize>(
num_elements() *
sizeof(value_type)));
822 boost::variant<ome::compat::shared_ptr<array_type>,
839 template <
typename U>
844 throw std::runtime_error(
"Null array type");
859 template <
typename U>
864 throw std::runtime_error(
"Null array type");
872 typename PixelBuffer<T>::array_ref_type&
876 return boost::apply_visitor(v, multiarray);
884 return boost::apply_visitor(v, multiarray);
900 template<
typename T,
class charT,
class traits>
901 inline std::basic_istream<charT,traits>&
902 operator>> (std::basic_istream<charT,traits>& is,
916 template<
typename T,
class charT,
class traits>
917 inline std::basic_ostream<charT,traits>&
918 operator<< (std::basic_ostream<charT,traits>& os,
919 const ::ome::bioformats::PixelBuffer<T>& buf)
927 #endif // OME_BIOFORMATS_PIXELBUFFER_H
uint8
Definition: PixelType.h:83
Memory type substitution.
DimensionOrder enumeration.
Definition: DimensionOrder.h:70
Variant type limit workaround.
Open Microscopy Environment C++ implementation.
Definition: CoreMetadata.cpp:40
PixelType enumeration.
Definition: PixelType.h:70
Xerces-C modern C++ wrapper.
Definition: Base.h:53