Banuba SDK
Loading...
Searching...
No Matches
bnb::full_image_t Class Reference

basis is the base basis: for y/rgb basis use .basis or get_subchannel_basis_transform(1); for uv basis use get_subchannel_basis_transform(2); More...

#include <full_image.hpp>

Inheritance diagram for bnb::full_image_t:
bnb::transformable_event< full_image_t > bnb::base_event< full_image_t > bnb::base_event_iface bnb::identified_class< event_id_t, full_image_t >

Public Types

using plane_deleter = std::function<void(uint8_t*)>
 
- Public Types inherited from bnb::base_event< full_image_t >
using allocator
 

Public Member Functions

 full_image_t ()
 Construct a new full_image_t object with default params.
 
 full_image_t (bpc8_image_t image)
 Construct a new full_image_t object from image.
 
 full_image_t (yuv_image_t image)
 Construct a new full_image_t object from image.
 
 full_image_t (const full_image_t &)
 Construct a new full_image_t object using copy operation.
 
full_image_toperator= (const full_image_t &)
 
 full_image_t (full_image_t &&) noexcept
 Construct a new full_image_t object using move semantics.
 
full_image_toperator= (full_image_t &&other) noexcept
 
image_format get_format () const
 
bool is_landscape () const
 
bnb::transformation get_subchannel_basis_transform (float inv_scale=1.f) const
 
bnb::transformation image_basis () const
 
template<typename T >
const T & get_data () const noexcept
 
template<typename T >
bool has_data () const noexcept
 
void set_fov (float fov)
 Set the field of view ( fov ) object.
 
void normalize_orientation ()
 Normalize image data if it is required to be mirrored or camera orientation isn't deg_0.
 
orientation get_orientation () const
 Returns the orientation of the image.
 
bool get_mirroring () const
 Returns the mirroring of the image.
 
pixel_buffer_format get_pixel_buffer_format () const
 Returns format of the image.
 
color_std get_color_standard () const
 Returns yuv color standard of the image.
 
color_range get_color_range () const
 Returns yuv color range of the image.
 
uint32_t get_number_of_planes () const
 Returns count of the planes.
 
uint8_t * get_base_ptr () const
 Returns the shared pointer of the first plane.
 
uint8_t * get_base_ptr_of_plane (uint32_t plane_num) const
 Returns the shared pointer to pixel data of the specified plane.
 
int32_t get_bytes_per_pixel () const
 Returns the pixel size of the first plane.
 
int32_t get_bytes_per_pixel_of_plane (uint32_t plane_num) const
 Returns the pixel size of the specified plane.
 
int32_t get_bytes_per_row () const
 Returns the stride of the first plane.
 
int32_t get_bytes_per_row_of_plane (uint32_t plane_num) const
 Returns the stride of the specified plane.
 
int32_t get_width () const
 Returns the width of the first plane.
 
int32_t get_width_of_plane (uint32_t plane_num) const
 Returns the width of the specified plane.
 
int32_t get_height () const
 Returns the height of the first plane.
 
int32_t get_height_of_plane (uint32_t plane_num) const
 Returns the height of the specified plane.
 
- Public Member Functions inherited from bnb::base_event< full_image_t >
event_id_t get_type_id () const noexcept final
 
- Public Member Functions inherited from bnb::base_event_iface

Static Public Member Functions

static full_image_t load (const std::string &path, bool alpha=false)
 A method for loading video from path with/whithout alpha.
 
static full_image_t create_bpc8 (const uint8_t *rgb_plane, int32_t rgb_stride, int32_t width, int32_t height, pixel_buffer_format fmt, orientation orient, bool mirroring, plane_deleter deleter)
 
static full_image_t create_nv12 (const uint8_t *y_plane, int32_t y_stride, const uint8_t *uv_plane, int32_t uv_stride, int32_t width, int32_t height, bnb::color_std std, bnb::color_range rng, orientation orient, bool mirroring, plane_deleter y_deleter, plane_deleter uv_deleter)
 
static full_image_t create_i420 (const uint8_t *y_plane, int32_t y_stride, const uint8_t *u_plane, int32_t u_stride, const uint8_t *v_plane, int32_t v_stride, int32_t width, int32_t height, bnb::color_std std, bnb::color_range rng, orientation orient, bool mirroring, plane_deleter y_deleter, plane_deleter u_deleter, plane_deleter v_deleter)
 
- Static Public Member Functions inherited from bnb::identified_class< event_id_t, full_image_t >
static const char * get_name () noexcept
 
static event_id_t get_id () noexcept
 

Additional Inherited Members

- Public Attributes inherited from bnb::transformable_event< full_image_t >
transformation basis_transform
 (common -> some event data basis) transformation
 
pixel_rect full_roi
 rectangle area in common basis that encloses all valid & usable data
 
- Static Public Attributes inherited from bnb::base_event< full_image_t >
static const event_id_t id
 

Detailed Description

basis is the base basis: for y/rgb basis use .basis or get_subchannel_basis_transform(1); for uv basis use get_subchannel_basis_transform(2);

Definition at line 448 of file full_image.hpp.

Member Typedef Documentation

◆ plane_deleter

using bnb::full_image_t::plane_deleter = std::function<void(uint8_t*)>

Definition at line 549 of file full_image.hpp.

Constructor & Destructor Documentation

◆ full_image_t() [1/2]

bnb::full_image_t::full_image_t ( bpc8_image_t image)
explicit

Construct a new full_image_t object from image.

Parameters
imageis a C++ bpc8 image (
See also
bpc8_image ) representation.

◆ full_image_t() [2/2]

bnb::full_image_t::full_image_t ( yuv_image_t image)
explicit

Construct a new full_image_t object from image.

Parameters
imageis a C++ yuv image (
See also
yuv_image ) representation.

Member Function Documentation

◆ get_base_ptr_of_plane()

uint8_t * bnb::full_image_t::get_base_ptr_of_plane ( uint32_t plane_num) const

Returns the shared pointer to pixel data of the specified plane.

Parameters
plane_numplane number. Must be 0 for bpc8, [0..1] for nv12 and [0..2] for i420 images

◆ get_bytes_per_pixel_of_plane()

int32_t bnb::full_image_t::get_bytes_per_pixel_of_plane ( uint32_t plane_num) const

Returns the pixel size of the specified plane.

Parameters
plane_numplane number. Must be 0 for bpc8, [0..1] for nv12 and [0..2] for i420 images

◆ get_bytes_per_row_of_plane()

int32_t bnb::full_image_t::get_bytes_per_row_of_plane ( uint32_t plane_num) const

Returns the stride of the specified plane.

Parameters
plane_numplane number. Must be 0 for bpc8, [0..1] for nv12 and [0..2] for i420 images

◆ get_color_range()

color_range bnb::full_image_t::get_color_range ( ) const

Returns yuv color range of the image.

Returns
color range

◆ get_color_standard()

color_std bnb::full_image_t::get_color_standard ( ) const

Returns yuv color standard of the image.

Returns
color standard

◆ get_format()

image_format bnb::full_image_t::get_format ( ) const
Returns
Returns image format (
See also
image_format ).

◆ get_height_of_plane()

int32_t bnb::full_image_t::get_height_of_plane ( uint32_t plane_num) const

Returns the height of the specified plane.

Parameters
plane_numplane number. Must be 0 for bpc8, [0..1] for nv12 and [0..2] for i420 images

◆ get_mirroring()

bool bnb::full_image_t::get_mirroring ( ) const

Returns the mirroring of the image.

Mirroring applied after orientation

Returns
mirroring

◆ get_orientation()

orientation bnb::full_image_t::get_orientation ( ) const

Returns the orientation of the image.

Returns
orientation

◆ get_pixel_buffer_format()

pixel_buffer_format bnb::full_image_t::get_pixel_buffer_format ( ) const

Returns format of the image.

Returns
fortmat of the pixel_buffer

◆ get_subchannel_basis_transform()

bnb::transformation bnb::full_image_t::get_subchannel_basis_transform ( float inv_scale = 1.f) const
inline

Definition at line 504 of file full_image.hpp.

505 {
506 return basis_transform >> bnb::transformation(1.f / inv_scale, 1.f / inv_scale);
507 }
This class implements affine or perspective 2d transformations Standard usage implies transformation ...

◆ get_width_of_plane()

int32_t bnb::full_image_t::get_width_of_plane ( uint32_t plane_num) const

Returns the width of the specified plane.

Parameters
plane_numplane number. Must be 0 for bpc8, [0..1] for nv12 and [0..2] for i420 images

◆ image_basis()

bnb::transformation bnb::full_image_t::image_basis ( ) const
inline
Returns
Returns bassis of image as row-major matrix 3x3 (
See also
transformation ).

Definition at line 512 of file full_image.hpp.

513 {
514 using rot_t = transformation::rotate_t;
515 return bnb::transformation(full_roi, full_roi, rot_t::deg_0, get_format().require_mirroring) >> basis_transform;
516 }
image_format get_format() const
rotate_t
Rotation is counter clockwise(only in standart basis):

◆ is_landscape()

bool bnb::full_image_t::is_landscape ( ) const
Returns
true if image orientation is landscape and false in another way.

◆ load()

static full_image_t bnb::full_image_t::load ( const std::string & path,
bool alpha = false )
static

A method for loading video from path with/whithout alpha.

Parameters
pathis a full path to downloadable image.
alphais value responcible that image includes alpha channel.
Returns
Returns full_image_t object with data of image from path or nullptr.

◆ set_fov()

void bnb::full_image_t::set_fov ( float fov)

Set the field of view ( fov ) object.

Parameters
fovis a field of view in degrees.

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