Enrollment 28.2.0
Loading...
Searching...
No Matches

Contains plain image data. More...

#include <ImageAttribute.h>

Collaboration diagram for RawImage:

Public Types

enum  Type : uint8_t { GRAYSCALE , BGR , BGRA }
 RawImage encoding type. More...

Public Member Functions

const std::vector< uint8_t > & Data () const
void WriteTo (Writer &writer) const final
 Write itself into writer.
 RawImage (ImageWidth w, ImageHeight h, ImageDpi d, Type t, std::vector< uint8_t > &&r)
 Construct a new Raw Image object Data vector is passed by rvalue reference for efficient transfer without unnecessary copying.
 RawImage (ImageWidth w, ImageHeight h, ImageDpi d, Type t, const std::vector< uint8_t > &r)
 Construct a new Raw Image object Data vector is stored as a copy.

Public Attributes

const ImageDpi dpi
 Image DPI.
const ImageWidth width
 Image width in pixels.
const ImageHeight height
 Image height in pixels.
const Type type
 RawImage type.
const unsigned char channels
 Number of RawImage channels.

Detailed Description

Contains plain image data.

Member Enumeration Documentation

◆ Type

enum Type : uint8_t

RawImage encoding type.

Enumerator
GRAYSCALE 

Raw data where image pixels are stored in grayscale format.

The data are in format where each pixel has 1 byte. Each byte represent color. Then pixels are stored by columns, it means that data starts with row index 1 and column index 1 pixel and ends with last row and last column pixel.

BGR 

Raw data where image pixels are stored in BGR format.

The data are in format where each pixel has 3 bytes. Each byte represent color in order Blue, Green, Red. Then pixels are stored by columns, it means that data starts with row index 1 and column index 1 pixel and ends with last row and last column pixel.

BGRA 

Raw data where image pixels are stored in BGR with alpha format.

The data are in format where each pixel has 4 bytes. Each byte represent color in order Blue, Green, Red and Alpha channel. Then pixels are stored by columns, it means that data starts with row index 1 and column index 1 pixel and ends with last row and last column pixel.
RGBA stands for red green blue alpha. While it is sometimes described as a color space, it is actually a three-channel RGB color model supplemented with a fourth alpha channel. Alpha indicates how opaque each pixel is and allows an image to be combined over others using alpha compositing, with transparent areas and anti-aliasing of the edges of opaque regions. [11]

Constructor & Destructor Documentation

◆ RawImage() [1/2]

RawImage ( ImageWidth w,
ImageHeight h,
ImageDpi d,
Type t,
std::vector< uint8_t > && r )
inline

Construct a new Raw Image object Data vector is passed by rvalue reference for efficient transfer without unnecessary copying.

Parameters
wImage Width
hImage Height
dImage DPI
tRaw data type
rraw data

References channels, dpi, height, type, and width.

◆ RawImage() [2/2]

RawImage ( ImageWidth w,
ImageHeight h,
ImageDpi d,
Type t,
const std::vector< uint8_t > & r )
inline

Construct a new Raw Image object Data vector is stored as a copy.

Parameters
wImage Width
hImage Height
dImage DPI
tRaw data type
rraw data

References channels, dpi, height, type, and width.

Member Function Documentation

◆ Data()

const std::vector< uint8_t > & Data ( ) const
inlinenodiscard
Returns
std::vector<uint8_t>

Referenced by Image::DecodeRawImage().

Here is the caller graph for this function:

◆ WriteTo()

void WriteTo ( Writer & writer) const
inlinefinalvirtual

Write itself into writer.

Parameters
writerWriter to use to serialize this Serializable

Implements Serializable.

References dpi, height, type, and width.


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