67 const std::string &fileName,
68 LoadImageTag<ColorBGRA> );
70 const std::string &fileName,
71 LoadImageTag<ColorRGBA> );
73 const std::string &fileName,
74 LoadImageTag<ColorSRGB> );
83 template<
class PixelFormat>
88 std::is_same<PixelFormat, Zivid::ColorRGBA>::value || std::is_same<PixelFormat, Zivid::ColorBGRA>::value
89 || std::is_same<PixelFormat, Zivid::ColorSRGB>::value,
90 "PixelFormat must be Zivid::ColorRGBA, Zivid::ColorBGRA or Zivid::ColorSRGB");
96 template<
typename Iterator>
124 explicit Image(
const std::string &fileName)
125 :
Image{ Detail::loadImageImpl(fileName, Detail::LoadImageTag<PixelFormat>{}) }
137 void save(
const std::string &fileName)
const
139 return Detail::saveImageImpl(*
this, fileName);
144 :
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
A 2-dimensional image.
Definition Image.h:85
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:137
Image(const Resolution &resolution, const unsigned char *begin, const unsigned char *end)
Create an image from an unsigned char byte buffer.
Definition Image.h:114
Image()=default
Create an empty image.
Image(const std::string &fileName)
Load an image from a file.
Definition Image.h:124
Image(const Resolution &resolution, Iterator beginIt, Iterator endIt)
Create an image from a buffer of elements by copy.
Definition Image.h:97
Resolution resolution() const
Get the resolution of the image.
Definition Image.h:130
Class describing a resolution with a width and a height.
Definition Resolution.h:56
The main Zivid namespace. All Zivid code is found here.
Definition Application.h:56