DocSDK  2.4.1
docsdk::Image Struct Reference

Image representation. More...

#include <image.h>

Public Types

enum  ColorEncoding { ColorEncoding::kRGB888, ColorEncoding::kBGR888 }
 Image color encoding. More...
 
using Ptr = std::shared_ptr< Image >
 

Public Member Functions

virtual ~Image () noexcept=default
 

Static Public Member Functions

static Ptr Create (const uint8_t *bytes, size_t num_bytes)
 
static Ptr Create (const std::string &path)
 
static Ptr Create (const uint8_t *raw_data, uint32_t num_rows, uint32_t num_cols, ColorEncoding encoding)
 

Detailed Description

Image representation.

Member Typedef Documentation

◆ Ptr

using docsdk::Image::Ptr = std::shared_ptr<Image>

Member Enumeration Documentation

◆ ColorEncoding

Image color encoding.

Enumerator
kRGB888 

RGB encoding, each channel value is represented as 8 bits

kBGR888 

BGR encoding, each channel value is represented as 8 bits

Constructor & Destructor Documentation

◆ ~Image()

virtual docsdk::Image::~Image ( )
virtualdefaultnoexcept

Member Function Documentation

◆ Create() [1/3]

static Ptr docsdk::Image::Create ( const uint8_t *  bytes,
size_t  num_bytes 
)
static

Image factory method, creates Image from a buffer containing image file contents.

Parameters
bytesPointer to a buffer containing image file contents
num_bytesBuffer size
Returns
Smart pointer to created Image instance
Exceptions
std::runtime_error

◆ Create() [2/3]

static Ptr docsdk::Image::Create ( const std::string &  path)
static

Image factory method, creates Image from an image file using given file path.

Parameters
pathPath to image file
Returns
Smart pointer to created Image instance
Exceptions
std::runtime_error

◆ Create() [3/3]

static Ptr docsdk::Image::Create ( const uint8_t *  raw_data,
uint32_t  num_rows,
uint32_t  num_cols,
ColorEncoding  encoding 
)
static

Image factory method, creates Image from raw color data.

Parameters
raw_dataRaw color data (three-dimensional array containing color channel values for each image pixel)
num_rowsNumber of image rows
num_colsNumber of image columns
encodingImage color encoding
Returns
Smart pointer to created Image instance
Exceptions
std::runtime_error

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