Zivid C++ API  1.8.1+6967bc1b-1
Defining the Future of 3D Machine Vision
Public Member Functions | List of all members
Zivid::Image< PixelFormat > Class Template Reference

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...
 

Detailed Description

template<class PixelFormat>
class Zivid::Image< PixelFormat >

A 2-dimensional image stored on the host. The format of each pixel is given by template parameter PixelFormat. PixelFormat must be Zivid::RGBA8.

Member Function Documentation

◆ dataPtr()

template<class PixelFormat >
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.

◆ height()

template<class PixelFormat >
ZIVID_API_EXPORT_TEMPLATE_H size_t Zivid::Image< PixelFormat >::height ( ) const

Return height (number of rows) of image

◆ operator()() [1/2]

template<class PixelFormat >
const PixelFormat& Zivid::Image< PixelFormat >::operator() ( size_t  i,
size_t  j 
) const
inline

Obtain a constant reference to a pixel given by row and column

Parameters
iRow
jColumn

◆ operator()() [2/2]

template<class PixelFormat >
const PixelFormat& Zivid::Image< PixelFormat >::operator() ( size_t  idx) const
inline

Obtain a constant reference to a pixel given by a 1D linear index.

Parameters
idxLinear 1D index (from 0 to number of pixels)

◆ save()

template<class PixelFormat >
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.

◆ size()

template<class PixelFormat >
ZIVID_API_EXPORT_TEMPLATE_H size_t Zivid::Image< PixelFormat >::size ( ) const

Return number of pixels in the image

◆ toString()

template<class PixelFormat >
ZIVID_API_EXPORT_TEMPLATE_H std::string Zivid::Image< PixelFormat >::toString ( ) const

Get image information as string

◆ width()

template<class PixelFormat >
ZIVID_API_EXPORT_TEMPLATE_H size_t Zivid::Image< PixelFormat >::width ( ) const

Return width (number of columns) of image


The documentation for this class was generated from the following file: