63 ZIVID_CORE_EXPORT void saveImageImpl(
const Zivid::Array2D<ColorRGBA> &image,
const std::string &fileName);
64 ZIVID_CORE_EXPORT void saveImageImpl(
const Zivid::Array2D<ColorBGRA> &image,
const std::string &fileName);
65 ZIVID_CORE_EXPORT void saveImageImpl(
const Zivid::Array2D<ColorRGBA_SRGB> &image,
const std::string &fileName);
66 ZIVID_CORE_EXPORT void saveImageImpl(
const Zivid::Array2D<ColorBGRA_SRGB> &image,
const std::string &fileName);
67 ZIVID_CORE_EXPORT void saveImageImpl(
const Zivid::Array2D<ColorRGB> &image,
const std::string &fileName);
68 ZIVID_CORE_EXPORT void saveImageImpl(
const Zivid::Array2D<ColorRGB_SRGB> &image,
const std::string &fileName);
69 ZIVID_CORE_EXPORT void saveImageImpl(
const Zivid::Array2D<ColorBGR> &image,
const std::string &fileName);
70 ZIVID_CORE_EXPORT void saveImageImpl(
const Zivid::Array2D<ColorBGR_SRGB> &image,
const std::string &fileName);
72 const std::string &fileName,
73 LoadImageTag<ColorBGRA> );
75 const std::string &fileName,
76 LoadImageTag<ColorRGBA> );
78 const std::string &fileName,
79 LoadImageTag<ColorRGBA_SRGB> );
81 const std::string &fileName,
82 LoadImageTag<ColorBGRA_SRGB> );
84 const std::string &fileName,
85 LoadImageTag<ColorRGB> );
87 const std::string &fileName,
88 LoadImageTag<ColorRGB_SRGB> );
90 const std::string &fileName,
91 LoadImageTag<ColorBGR> );
93 const std::string &fileName,
94 LoadImageTag<ColorBGR_SRGB> );
96 template<
typename ColorFormat>
97 struct SupportedImageColorFormat : std::false_type
101 struct SupportedImageColorFormat<ColorRGBA> : std::true_type
105 struct SupportedImageColorFormat<ColorBGRA> : std::true_type
113 struct SupportedImageColorFormat<ColorBGRA_SRGB> : std::true_type
117 struct SupportedImageColorFormat<ColorRGB> : std::true_type
121 struct SupportedImageColorFormat<ColorRGB_SRGB> : std::true_type
125 struct SupportedImageColorFormat<ColorBGR> : std::true_type
129 struct SupportedImageColorFormat<ColorBGR_SRGB> : std::true_type
139 template<
class PixelFormat>
144 Detail::SupportedImageColorFormat<PixelFormat>::value,
145 "PixelFormat must be Zivid::ColorRGBA, Zivid::ColorBGRA, Zivid::ColorRGBA_SRGB, Zivid::ColorBGRA_SRGB, "
146 "Zivid::ColorRGB, Zivid::ColorRGB_SRGB, Zivid::ColorBGR, or Zivid::ColorBGR_SRGB");
152 template<
typename Iterator>
180 explicit Image(
const std::string &fileName)
193 void save(
const std::string &fileName)
const
195 return Detail::saveImageImpl(*
this, fileName);
200 :
Array2D<PixelFormat>(std::move(a))
#define ZIVID_CORE_EXPORT
Definition CoreExport.h:56
Two-dimensional container of data.
Definition Array2D.h:83
size_t height() const
Get the height of the array (number of rows)
Definition Array2D.h:106
ConstIterator end() const
Definition Array2D.h:174
size_t width() const
Get the width of the array (number of columns)
Definition Array2D.h:100
ConstIterator begin() const
Definition Array2D.h:168
Array2D()
Definition Array2D.h:94
A 2-dimensional image.
Definition Image.h:141
void save(const std::string &fileName) const
Save the image to a file. The supported file types are PNG (.png), JPEG (.jpg, .jpeg) and BMP (....
Definition Image.h:193
Image(const Resolution &resolution, const unsigned char *begin, const unsigned char *end)
Create an image from an unsigned char byte buffer.
Definition Image.h:170
Image()=default
Create an empty image.
Image(const std::string &fileName)
Load an image from a file.
Definition Image.h:180
Image(const Resolution &resolution, Iterator beginIt, Iterator endIt)
Create an image from a buffer of elements by copy.
Definition Image.h:153
Resolution resolution() const
Get the resolution of the image.
Definition Image.h:186
Class describing a resolution with a width and a height.
Definition Resolution.h:56
Definition EnvironmentInfo.h:74
The main Zivid namespace. All Zivid code is found here.
Definition Application.h:85
ColorSRGB ColorRGBA_SRGB
Color with 8-bit red, green, blue and alpha channels in the sRGB color space.
Definition Color.h:93