![]() |
bbox
|
A class representing a bbox session. More...
#include <stdint.h>#include <stddef.h>#include <stdbool.h>
Go to the source code of this file.
Functions | |
Constructors and Destructors | |
| bbox_t * | bbox_new (size_t n_channels,...) |
| Create a new bbox object with global coordinate-space. More... | |
| bbox_t * | bbox_view_new (bbox_channel_t view) |
| Create a new bbox object with view coordinate-space. More... | |
| bool | bbox_destroy (bbox_t *self) |
| Destroy the bbox object. More... | |
Functions | |
| bool | bbox_coordinates_scene_normalized (bbox_t *self) |
| Switch to scene normalized coordinate space [Default]. More... | |
| bool | bbox_coordinates_frame_normalized (bbox_t *self) |
| Switch to frame normalized coordinate space. More... | |
| bool | bbox_video_output (bbox_t *self, bool enabled) |
| Control drawing on video-output. More... | |
| bbox_color_t | bbox_color_from_rgb (uint8_t r, uint8_t g, uint8_t b) |
| Create a new native color from rgb. More... | |
| bbox_color_t | bbox_color_from_rgba (uint8_t r, uint8_t g, uint8_t b, uint8_t a) |
| Create a new native color from rgba. More... | |
| bool | bbox_clear (bbox_t *self) |
| Clear all existing geometry. More... | |
| bool | bbox_color (bbox_t *self, bbox_color_t color) |
| Apply color to all new geometry. More... | |
| bool | bbox_style_outline (bbox_t *self) |
Replace existing style with ┏━━━━━┓ for all new rectangles. More... | |
| bool | bbox_style_corners (bbox_t *self) |
Replace existing style with ┏━ ━┓ for all new rectangles. More... | |
| bool | bbox_thickness_thin (bbox_t *self) |
Change line-thickness to thin for all new geometry. More... | |
| bool | bbox_thickness_medium (bbox_t *self) |
Change line-thickness to medium for all new geometry. More... | |
| bool | bbox_thickness_thick (bbox_t *self) |
Change line-thickness to thick for all new geometry. More... | |
| bool | bbox_rectangle (bbox_t *self, float x1, float y1, float x2, float y2) |
| Create a new Rectangle. More... | |
| bool | bbox_line (bbox_t *self, float x1, float y1, float x2, float y2) |
| Create a new Line. More... | |
| bool | bbox_quad (bbox_t *self, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) |
| Create a new Quadrilateral. More... | |
| bool | bbox_move_to (bbox_t *self, float x, float y) |
| Move to the specified point. More... | |
| bool | bbox_line_to (bbox_t *self, float x, float y) |
| Adds a point to the current path. More... | |
| bool | bbox_draw_path (bbox_t *self) |
| Draw the current path. More... | |
| bool | bbox_commit (bbox_t *self, int64_t when_us) |
| Draw all queued geometry. More... | |
A class representing a bbox session.
Copyright (C) 2021, Axis Communications AB, Lund
| bool bbox_clear | ( | bbox_t * | self | ) |
Clear all existing geometry.
| self | The bbox object |
errno on error. | bool bbox_color | ( | bbox_t * | self, |
| bbox_color_t | color | ||
| ) |
Apply color to all new geometry.
| self | The bbox object |
| color | The color to apply |
errno on error. | bbox_color_t bbox_color_from_rgb | ( | uint8_t | r, |
| uint8_t | g, | ||
| uint8_t | b | ||
| ) |
Create a new native color from rgb.
| r | Red |
| g | Green |
| b | Blue |
bbox_color_t in native format | bbox_color_t bbox_color_from_rgba | ( | uint8_t | r, |
| uint8_t | g, | ||
| uint8_t | b, | ||
| uint8_t | a | ||
| ) |
Create a new native color from rgba.
| r | Red |
| g | Green |
| b | Blue |
| a | Alpha |
bbox_color_t in native format | bool bbox_commit | ( | bbox_t * | self, |
| int64_t | when_us | ||
| ) |
Draw all queued geometry.
| self | The bbox object |
| when_us | Synchronization time in µs. |
errno on error. | bool bbox_coordinates_frame_normalized | ( | bbox_t * | self | ) |
Switch to frame normalized coordinate space.
This coordinate system is normalized and aligned with the camera frame, i.e. top-left is [0,0] and bottom-right is [1,1].
| self | The bbox object |
errno on error. | bool bbox_coordinates_scene_normalized | ( | bbox_t * | self | ) |
Switch to scene normalized coordinate space [Default].
This coordinate system is normalized to [0,0]-[1,1] and follows the filmed scene, i.e. static objects in the world have the same coordinates regardless of global rotation.
| self | The bbox object |
errno on error. | bool bbox_destroy | ( | bbox_t * | self | ) |
Destroy the bbox object.
| self | The bbox object |
errno on error. | bool bbox_draw_path | ( | bbox_t * | self | ) |
Draw the current path.
| self | The bbox object |
errno on error. | bool bbox_line | ( | bbox_t * | self, |
| float | x1, | ||
| float | y1, | ||
| float | x2, | ||
| float | y2 | ||
| ) |
Create a new Line.
The visible coordinates are in the range 0.0 to 1.0. Coordinates outside of this range will be clipped, this can result in partial lines being drawn.
The effect of this call is delayed until the next bbox_commit
| self | The bbox object |
| x1 | Left |
| y1 | Top |
| x2 | Right |
| y2 | Bottom |
errno on error. | bool bbox_line_to | ( | bbox_t * | self, |
| float | x, | ||
| float | y | ||
| ) |
Adds a point to the current path.
| self | The bbox object |
| x | Left |
| y | Top |
errno on error. | bool bbox_move_to | ( | bbox_t * | self, |
| float | x, | ||
| float | y | ||
| ) |
Move to the specified point.
| self | The bbox object |
| x | Left |
| y | Top |
errno on error. | bbox_t* bbox_new | ( | size_t | n_channels, |
| ... | |||
| ) |
Create a new bbox object with global coordinate-space.
[0,0] ┏━━━━━━━━━━━━━┓ ┃ ┏━━━━━┓ ┃ ┃ ┃View1┃ ┃ ┃ ┗━━━━━┛ ┃ ┗━━━━━━━━━━━━━┛ [1,1]
| n_channels | Number of channels to draw upon |
| ... | List of bbox_channel_t to draw upon |
NULL on error. Free with bbox_destroy. | bool bbox_quad | ( | bbox_t * | self, |
| float | x1, | ||
| float | y1, | ||
| float | x2, | ||
| float | y2, | ||
| float | x3, | ||
| float | y3, | ||
| float | x4, | ||
| float | y4 | ||
| ) |
Create a new Quadrilateral.
The visible coordinates are in the range 0.0 to 1.0. Coordinates outside of this range will be clipped, this can result in partial quads being drawn.
The effect of this call is delayed until the next bbox_commit
| self | The bbox object |
| x1 | Vertex1 |
| y1 | Vertex1 |
| x2 | Vertex2 |
| y2 | Vertex2 |
| x3 | Vertex3 |
| y3 | Vertex3 |
| x4 | Vertex4 |
| y4 | Vertex4 |
errno on error. | bool bbox_rectangle | ( | bbox_t * | self, |
| float | x1, | ||
| float | y1, | ||
| float | x2, | ||
| float | y2 | ||
| ) |
Create a new Rectangle.
The visible coordinates are in the range 0.0 to 1.0. Coordinates outside of this range will be clipped, this can result in partial rectangles being drawn.
The effect of this call is delayed until the next bbox_commit
| self | The bbox object |
| x1 | Left |
| y1 | Top |
| x2 | Right |
| y2 | Bottom |
errno on error. | bool bbox_style_corners | ( | bbox_t * | self | ) |
Replace existing style with ┏━ ━┓ for all new rectangles.
| self | The bbox object |
errno on error. | bool bbox_style_outline | ( | bbox_t * | self | ) |
Replace existing style with ┏━━━━━┓ for all new rectangles.
| self | The bbox object |
errno on error. | bool bbox_thickness_medium | ( | bbox_t * | self | ) |
Change line-thickness to medium for all new geometry.
| self | The bbox object |
errno on error. | bool bbox_thickness_thick | ( | bbox_t * | self | ) |
Change line-thickness to thick for all new geometry.
| self | The bbox object |
errno on error. | bool bbox_thickness_thin | ( | bbox_t * | self | ) |
Change line-thickness to thin for all new geometry.
| self | The bbox object |
errno on error. | bool bbox_video_output | ( | bbox_t * | self, |
| bool | enabled | ||
| ) |
Control drawing on video-output.
The effect of this call is delayed until the next bbox_commit
| self | The bbox object |
| enabled | Enable or Disable drawing on video-output |
errno on error. | bbox_t* bbox_view_new | ( | bbox_channel_t | view | ) |
Create a new bbox object with view coordinate-space.
┏━━━━━━━━━━━━━┓ ┃ [0,0] ┃ ┃ ┏━━━━━┓ ┃ ┃ ┃View1┃ ┃ ┃ ┗━━━━━┛ ┃ ┃ [1,1] ┃ ┗━━━━━━━━━━━━━┛
| view | The view to draw upon |
NULL on error. Free with bbox_destroy.