The Frame structure provides storage and manipulation of frames (multiplanar images). More...
Public Types | |
enum | Format { None = 0, Nv12, Yuv420p, Bgra32, Bgr24, Gray8 } |
typedef A< uint8_t > | Allocator |
Public Member Functions | |
Frame () | |
Frame (const Frame &frame) | |
Frame (const View< A > &view, bool flipped_=false, double timestamp_=0) | |
Frame (size_t width_, size_t height_, Format format_, bool flipped_=false, double timestamp_=0) | |
Frame (const Point< ptrdiff_t > &size, Format format_, bool flipped_=false, double timestamp_=0) | |
Frame (size_t width_, size_t height_, Format format_, uint8_t *data0, size_t stride0, uint8_t *data1, size_t stride1, uint8_t *data2, size_t stride2, bool flipped_=false, double timestamp_=0) | |
~Frame () | |
Frame * | Clone () const |
Frame & | operator= (const Frame &frame) |
Frame & | Ref () |
void | Recreate (size_t width_, size_t height_, Format format_) |
void | Recreate (const Point< ptrdiff_t > &size, Format format_) |
Frame | Region (const ptrdiff_t &left, const ptrdiff_t &top, const ptrdiff_t &right, const ptrdiff_t &bottom) const |
Frame | Region (ptrdiff_t &left, ptrdiff_t &top, ptrdiff_t &right, ptrdiff_t &bottom) const |
Frame | Region (const Point< ptrdiff_t > &topLeft, const Point< ptrdiff_t > &bottomRight) const |
Frame | Region (Point< ptrdiff_t > &topLeft, Point< ptrdiff_t > &bottomRight) const |
Frame | Region (const Rectangle< ptrdiff_t > &rect) const |
Frame | Region (Rectangle< ptrdiff_t > &rect) const |
Frame | Flipped () const |
Point< ptrdiff_t > | Size () const |
size_t | DataSize () const |
size_t | Area () const |
size_t | PlaneCount () const |
Static Public Member Functions | |
static size_t | PlaneCount (Format format) |
Data Fields | |
const size_t | width |
A width of the frame. | |
const size_t | height |
A height of the frame. | |
const Format | format |
A pixel format types of the frame. | |
View< A > | planes [PLANE_COUNT_MAX] |
Planes of the frame. | |
bool | flipped |
A flag of vertically flipped image (false - frame point (0, 0) is placed at top left corner of the frame, true - frame point (0, 0) is placed at bottom left corner of the frame. | |
double | timestamp |
A timestamp of the frame. | |
Static Public Attributes | |
static const size_t | PLANE_COUNT_MAX = 4 |
Detailed Description
template<template< class > class A>
struct Simd::Frame< A >
The Frame structure provides storage and manipulation of frames (multiplanar images).
Member Typedef Documentation
◆ Allocator
Member Enumeration Documentation
◆ Format
enum Format |
Describes pixel format types of a frame.
Constructor & Destructor Documentation
◆ Frame() [1/6]
◆ Frame() [2/6]
Creates a new Frame structure on the base of the other frame.
- Note
- This constructor is not create new frame! It only creates a reference to the same frame. If you want to create a copy then must use method Simd::FRame::Clone.
- Parameters
-
[in] frame - an original frame.
◆ Frame() [3/6]
Creates a new one plane Frame structure on the base of the image view.
- Note
- This constructor is not create new image frame! It only creates a reference to the same image. If you want to create a copy then must use method Simd::Frame::Clone.
- Parameters
-
[in] view - an original image view. [in] flipped_ - a flag of vertically flipped image of created frame. It is equal to false by default. [in] timestamp_ - a timestamp of created frame. It is equal to 0 by default.
◆ Frame() [4/6]
SIMD_INLINE Frame | ( | size_t | width_, |
size_t | height_, | ||
Format | format_, | ||
bool | flipped_ = false , |
||
double | timestamp_ = 0 |
||
) |
Creates a new Frame structure with specified width, height and pixel format.
- Parameters
-
[in] width_ - a width of created frame. [in] height_ - a height of created frame. [in] format_ - a pixel format of created frame. [in] flipped_ - a flag of vertically flipped image of created frame. It is equal to false by default. [in] timestamp_ - a timestamp of created frame. It is equal to 0 by default.
◆ Frame() [5/6]
SIMD_INLINE Frame | ( | const Point< ptrdiff_t > & | size, |
Format | format_, | ||
bool | flipped_ = false , |
||
double | timestamp_ = 0 |
||
) |
Creates a new Frame structure with specified width, height and pixel format.
- Parameters
-
[in] size - a size (width and height) of created frame. [in] format_ - a pixel format of created frame. [in] flipped_ - a flag of vertically flipped image of created frame. It is equal to false by default. [in] timestamp_ - a timestamp of created frame. It is equal to 0 by default.
◆ Frame() [6/6]
SIMD_INLINE Frame | ( | size_t | width_, |
size_t | height_, | ||
Format | format_, | ||
uint8_t * | data0, | ||
size_t | stride0, | ||
uint8_t * | data1, | ||
size_t | stride1, | ||
uint8_t * | data2, | ||
size_t | stride2, | ||
bool | flipped_ = false , |
||
double | timestamp_ = 0 |
||
) |
Creates a new Frame structure with specified width, height and pixel format around external buffers.
- Parameters
-
[in] width_ - a width of created frame. [in] height_ - a height of created frame. [in] format_ - a pixel format of created frame. [in] data0 - a pointer to the pixel data of first image plane. [in] stride0 - a row size of first image plane. [in] data1 - a pointer to the pixel data of second image plane. [in] stride1 - a row size of second image plane. [in] data2 - a pointer to the pixel data of third image plane. [in] stride2 - a row size of third image plane. [in] flipped_ - a flag of vertically flipped image of created frame. It is equal to false by default. [in] timestamp_ - a timestamp of created frame. It is equal to 0 by default.
◆ ~Frame()
Member Function Documentation
◆ Clone()
SIMD_INLINE Frame< A > * Clone | ( | ) | const |
Gets a copy of current frame.
- Returns
- a pointer to the new Frame structure. The user must free this pointer after usage.
◆ operator=()
Creates reference to other Frame structure.
- Note
- This function is not create copy of the frame! It only create a reference to the same frame.
- Parameters
-
[in] frame - an original frame.
- Returns
- a reference to itself.
◆ Ref()
SIMD_INLINE Frame< A > & Ref | ( | ) |
Creates reference to itself.
- Returns
- a reference to itself.
◆ Recreate() [1/2]
SIMD_INLINE void Recreate | ( | size_t | width_, |
size_t | height_, | ||
Format | format_ | ||
) |
Re-creates a Frame structure with specified width, height and pixel format.
- Parameters
-
[in] width_ - a width of re-created frame. [in] height_ - a height of re-created frame. [in] format_ - a pixel format of re-created frame.
◆ Recreate() [2/2]
Re-creates a Frame structure with specified width, height and pixel format.
- Parameters
-
[in] size - a size (width and height) of re-created frame. [in] format_ - a pixel format of re-created frame.
◆ Region() [1/6]
SIMD_INLINE Frame< A > Region | ( | const ptrdiff_t & | left, |
const ptrdiff_t & | top, | ||
const ptrdiff_t & | right, | ||
const ptrdiff_t & | bottom | ||
) | const |
Creates a new Frame structure which points to the region of current frame bounded by the rectangle with specified coordinates.
- Parameters
-
[in] left - a left side of the region. [in] top - a top side of the region. [in] right - a right side of the region. [in] bottom - a bottom side of the region.
- Returns
- - a new Frame structure which points to the region of frame.
◆ Region() [2/6]
SIMD_INLINE Frame< A > Region | ( | ptrdiff_t & | left, |
ptrdiff_t & | top, | ||
ptrdiff_t & | right, | ||
ptrdiff_t & | bottom | ||
) | const |
Creates a new Frame structure which points to the region of current frame bounded by the rectangle with specified coordinates.
- Parameters
-
[in,out] left - a left side of the required region. Returns the left side of the actual region. [in,out] top - a top side of the required region. Returns the top side of the actual region. [in,out] right - a right side of the required region. Returns the right side of the actual region. [in,out] bottom - a bottom side of the required region. Returns the bottom side of the actual region.
- Returns
- - a new Frame structure which points to the region of frame.
◆ Region() [3/6]
◆ Region() [4/6]
SIMD_INLINE Frame< A > Region | ( | Point< ptrdiff_t > & | topLeft, |
Point< ptrdiff_t > & | bottomRight | ||
) | const |
Creates a new Frame structure which points to the region of frame bounded by the rectangle with specified coordinates.
- Parameters
-
[in,out] topLeft - a top-left corner of the required region. Returns the top-left corner of the actual region. [in,out] bottomRight - a bottom-right corner of the required region. Returns the bottom-right corner of the actual region.
- Returns
- - a new Frame structure which points to the region of frame.
◆ Region() [5/6]
◆ Region() [6/6]
◆ Flipped()
SIMD_INLINE Frame< A > Flipped | ( | ) | const |
◆ Size()
SIMD_INLINE Point< ptrdiff_t > Size | ( | ) | const |
Gets size (width and height) of the frame.
- Returns
- - a new Point structure with frame width and height.
◆ DataSize()
SIMD_INLINE size_t DataSize | ( | ) | const |
Gets size in bytes required to store pixel data of current Frame structure.
- Returns
- - a size of data pixels in bytes.
◆ Area()
SIMD_INLINE size_t Area | ( | ) | const |
◆ PlaneCount() [1/2]
|
static |
Gets number of planes in the frame for current pixel format.
- Parameters
-
[in] format - a pixel format.
- Returns
- - a number of planes.
◆ PlaneCount() [2/2]
SIMD_INLINE size_t PlaneCount | ( | ) | const |
Gets number of planes for current frame.
- Returns
- - a number of planes.
Field Documentation
◆ PLANE_COUNT_MAX
|
static |
Maximal count of pixel planes in a frame.