![]() |
Banuba SDK
|
Typedefs | |
using | bnb::high_res_timer = std::chrono::high_resolution_clock |
using | bnb::time_stamp_t = std::chrono::time_point< std::chrono::high_resolution_clock > |
using | bnb::orientation = camera_orientation |
using | bnb::color_plane_data_t = std::uint8_t |
using | bnb::color_plane = std::shared_ptr< color_plane_data_t > |
Enumerations | |
enum | bnb::pixel_buffer_format : int32_t { bpc8_rgb = 0x0101, bpc8_bgr = 0x0102, bpc8_rgba = 0x0103, bpc8_bgra = 0x0104, bpc8_argb = 0x0105, nv12 = 0x0201, i420 = 0x0401 } |
bt601 and bt709 - two standards for representing color space that use the same image encoding/decoding algorithm. More... | |
enum | bnb::color_range { video, bnb::color_range::full } |
Enum class represents color range. More... | |
enum | bnb::color_std { bt601, bt709 } |
Enum class represents suppotred color standarts. | |
enum | bnb::yuv_format { yuv_nv12, yuv_i420 } |
Enum class represents supported yuv formats. | |
enum | bnb::camera_orientation : unsigned int { deg_0 = 0, deg_90 = 1, deg_180 = 2, deg_270 = 3, up = deg_0, left = deg_90, down = deg_180, right = deg_270 } |
camera image layout is top-left, 0 orientation is portrait, rotation is counterclockwise | |
enum | bnb::rect_fit_mode : uint8_t { bnb::rect_fit_mode::fit_width, bnb::rect_fit_mode::fit_height, bnb::rect_fit_mode::fit_inside, bnb::rect_fit_mode::fit_outside } |
Functions | |
bool | bnb::pixel_buffer_format_is_bpc8 (pixel_buffer_format format) |
bool | bnb::pixel_buffer_format_is_nv12 (pixel_buffer_format format) |
bool | bnb::pixel_buffer_format_is_i420 (pixel_buffer_format format) |
bool | bnb::pixel_buffer_format_is_yuv (pixel_buffer_format format) |
std::string_view | bnb::pixel_buffer_format_to_str (pixel_buffer_format format) |
color_plane | bnb::color_plane_vector (std::vector< color_plane_data_t > vector) |
color_plane | bnb::color_plane_string (std::string str) |
color_plane | bnb::color_plane_char_arr (const char *ptr, size_t size) |
color_plane | bnb::color_plane_weak (const color_plane_data_t *ptr) |
color_plane | bnb::color_plane_data (data_t &&data) |
void | bnb::fit_rects_aspect_ratio (pixel_rect &source_rect, pixel_rect &target_rect, rect_fit_mode mode=rect_fit_mode::fit_inside) |
Adjust rects to have the same aspect ratio as if fitting source_rect into target_rect according to mode, return source_rect, target_rect have the same (+-rounding) aspect ratio, and are always not exceeding corresponding input rect, preserving original centers. More... | |
void | bnb::fill_exterior (uint8_t *pixels, uint32_t width, uint32_t height, uint32_t channels, pixel_rect rect, uint8_t color, bool edge_repeat=false) |
void | bnb::transform (const uint8_t *src, uint32_t src_w, uint32_t src_h, uint8_t *dst, uint32_t dst_w, uint32_t dst_h, uint32_t channels, const transformation &t) |
Transform src image to dst. More... | |
void | bnb::transform (const float *src, uint32_t src_w, uint32_t src_h, float *dst, uint32_t dst_w, uint32_t dst_h, uint32_t channels, const transformation &t) |
Transform src image to dst. More... | |
void | bnb::transform (const uint8_t *src, uint32_t src_w, uint32_t src_h, uint8_t *dst, uint32_t dst_w, uint32_t dst_h, uint32_t channels, const transformation &from, const transformation &to) |
Transform src image to dst through common basis NOTE: both transformations should be (common -> image) More... | |
void | bnb::transform1x1 (const uint8_t *src, uint8_t *dst, uint32_t w, uint32_t h, uint32_t channels, const transformation &t) |
Transform src image to dst param src, dst source, destination image buffers param w, h source, destination width and height param channels number of channels per pixel param t transformation (src -> dst) to apply. | |
point2d | bnb::transform (const point2d &point, const transformation &t) |
Apply transformation to point. More... | |
point2d | bnb::transform (const point2d &point, const transformation &from, const transformation &to) |
Transform point through common basis Apply transformation to point from some basis to another one through common basis NOTE: both transformations should be (common -> image) param point 2D point to transform param from,to transformations (common -> image) to apply by formula (from -> common -> to) return result 2D point. | |
pixel_rect | bnb::transform (const pixel_rect &rect, const transformation &t) |
Apply transformation to rect Result is normalized wrt. More... | |
bool | bnb::pixel_rect::is_valid () const |
void | bnb::pixel_rect::transpose () |
pixel_rect | bnb::pixel_rect::intersect (const pixel_rect &rect) const |
bool | bnb::pixel_rect::operator== (const pixel_rect &cmp) const noexcept |
bool | bnb::pixel_rect::operator!= (const pixel_rect &cmp) const noexcept |
bnb::pixel_rect::pixel_rect (int32_t _x, int32_t _y, int32_t _w, int32_t _h) | |
bnb::pixel_rect::pixel_rect (int32_t _w, int32_t _h) | |
bnb::pixel_rect::pixel_rect (const interfaces::pixel_rect &rect) | |
interfaces::pixel_rect | bnb::pixel_rect::get_iface () const |
bnb::pixel_rect::operator interfaces::pixel_rect () const | |
template<typename T > | |
const T & | bnb::full_image_t::get_data () const noexcept |
template<typename T > | |
bool | bnb::full_image_t::has_data () const noexcept |
interfaces::point2d | bnb::transformation::transform_point (const interfaces::point2d &p) const override |
Apply transform to point. | |
interfaces::pixel_rect | bnb::transformation::transform_rect (const interfaces::pixel_rect &rect) const override |
Variables | |
int32_t | bnb::pixel_rect::x = 0 |
int32_t | bnb::pixel_rect::y = 0 |
int32_t | bnb::pixel_rect::w = 0 |
int32_t | bnb::pixel_rect::h = 0 |
|
strong |
Enum class represents color range.
Enumerator | |
---|---|
full | for y values range is 16-235, for u and v values range is 16-240 |
Definition at line 271 of file full_image.hpp.
|
strong |
bt601 and bt709 - two standards for representing color space that use the same image encoding/decoding algorithm.
Differ in the encoding / decoding coefficients.
Definition at line 28 of file full_image.hpp.
|
strong |
Definition at line 22 of file transformation.hpp.
void bnb::fit_rects_aspect_ratio | ( | pixel_rect & | source_rect, |
pixel_rect & | target_rect, | ||
rect_fit_mode | mode = rect_fit_mode::fit_inside |
||
) |
Adjust rects to have the same aspect ratio as if fitting source_rect into target_rect according to mode, return source_rect, target_rect have the same (+-rounding) aspect ratio, and are always not exceeding corresponding input rect, preserving original centers.
May do some per-axis scale adjustments within small margin for fast, integral and/or pixel-perfect scaling between pixel rects
|
inlinenoexcept |
Definition at line 771 of file full_image.hpp.
|
inlinenoexcept |
Definition at line 779 of file full_image.hpp.
void bnb::transform | ( | const float * | src, |
uint32_t | src_w, | ||
uint32_t | src_h, | ||
float * | dst, | ||
uint32_t | dst_w, | ||
uint32_t | dst_h, | ||
uint32_t | channels, | ||
const transformation & | t | ||
) |
Transform src image to dst.
src,src_w,src_h | source 32 bit float image buffer, width and height |
dst,dst_w,dst_h | destination 32 bit float image buffer, width and height |
channels | number of channels per pixel |
t | transformation (src -> dst) to apply |
pixel_rect bnb::transform | ( | const pixel_rect & | rect, |
const transformation & | t | ||
) |
Apply transformation to rect Result is normalized wrt.
flips/rotates so that w > 0 && h > 0
rect | pixel_rect to transform |
t | transformation to apply |
point2d bnb::transform | ( | const point2d & | point, |
const transformation & | t | ||
) |
Apply transformation to point.
point | 2D point to transform |
t | transformation to apply |
|
inline |
Transform src image to dst through common basis NOTE: both transformations should be (common -> image)
src,src_w,src_h | source image buffer, width and height |
dst,dst_w,dst_h | destination image buffer, width and height |
channels | number of channels per pixel |
from,to | transformations (common -> image) to apply by formula (from -> common -> to) |
Definition at line 229 of file transformation.hpp.
void bnb::transform | ( | const uint8_t * | src, |
uint32_t | src_w, | ||
uint32_t | src_h, | ||
uint8_t * | dst, | ||
uint32_t | dst_w, | ||
uint32_t | dst_h, | ||
uint32_t | channels, | ||
const transformation & | t | ||
) |
Transform src image to dst.
src,src_w,src_h | source uint8_t image buffer, width and height |
dst,dst_w,dst_h | destination uint8_t image buffer, width and height |
channels | number of channels per pixel |
t | transformation (src -> dst) to apply |