![]() |
Zivid C++ API
1.8.1+6967bc1b-1
Defining the Future of 3D Machine Vision
|
A 2-dimensional image stored on the host. The format of each pixel is given by template parameter PixelFormat. PixelFormat must be Zivid::RGBA8. More...
#include <Zivid/Image.h>
Public Member Functions | |
ZIVID_API_EXPORT_TEMPLATE_H size_t | width () const |
Return width (number of columns) of image More... | |
ZIVID_API_EXPORT_TEMPLATE_H size_t | height () const |
Return height (number of rows) of image More... | |
ZIVID_API_EXPORT_TEMPLATE_H size_t | size () const |
Return number of pixels in the image More... | |
const ZIVID_API_EXPORT_TEMPLATE_H PixelFormat * | dataPtr () const |
Obtain a pointer to the first pixel in the image. The pointer is valid for the lifetime of this object. More... | |
const PixelFormat & | operator() (size_t idx) const |
Obtain a constant reference to a pixel given by a 1D linear index. More... | |
const PixelFormat & | operator() (size_t i, size_t j) const |
Obtain a constant reference to a pixel given by row and column More... | |
ZIVID_API_EXPORT_TEMPLATE_H void | save (const std::string &fileName) const |
Save the image to a file. The supported file type is PNG with extension .png. This method will throw an exception if failing to save to the provided fileName. More... | |
ZIVID_API_EXPORT_TEMPLATE_H std::string | toString () const |
Get image information as string More... | |
A 2-dimensional image stored on the host. The format of each pixel is given by template parameter PixelFormat. PixelFormat must be Zivid::RGBA8.
const ZIVID_API_EXPORT_TEMPLATE_H PixelFormat* Zivid::Image< PixelFormat >::dataPtr | ( | ) | const |
Obtain a pointer to the first pixel in the image. The pointer is valid for the lifetime of this object.
ZIVID_API_EXPORT_TEMPLATE_H size_t Zivid::Image< PixelFormat >::height | ( | ) | const |
Return height (number of rows) of image
|
inline |
Obtain a constant reference to a pixel given by row and column
i | Row |
j | Column |
|
inline |
Obtain a constant reference to a pixel given by a 1D linear index.
idx | Linear 1D index (from 0 to number of pixels) |
ZIVID_API_EXPORT_TEMPLATE_H void Zivid::Image< PixelFormat >::save | ( | const std::string & | fileName | ) | const |
Save the image to a file. The supported file type is PNG with extension .png. This method will throw an exception if failing to save to the provided fileName.
ZIVID_API_EXPORT_TEMPLATE_H size_t Zivid::Image< PixelFormat >::size | ( | ) | const |
Return number of pixels in the image
ZIVID_API_EXPORT_TEMPLATE_H std::string Zivid::Image< PixelFormat >::toString | ( | ) | const |
Get image information as string
ZIVID_API_EXPORT_TEMPLATE_H size_t Zivid::Image< PixelFormat >::width | ( | ) | const |
Return width (number of columns) of image