Display Operations - draw video frame images
#define ednet_display_destroy typedef EDNetDisplay; struct EDNetRect; EDNetDisplay *ednet_display_new (EDNetWindow window); EDNetDisplay *ednet_display_ref (EDNetDisplay *d); void ednet_display_unref (EDNetDisplay *d); void ednet_display_put_video (EDNetDisplay *d, EDNetFrame *frame); void ednet_display_draw (EDNetDisplay *d); void ednet_display_set_visible (EDNetDisplay *d, int visible); void ednet_display_set_area (EDNetDisplay *d, EDNetRect *area); void ednet_display_set_src_area (EDNetDisplay *d, EDNetRect *area); void ednet_display_set_dest_area (EDNetDisplay *d, EDNetRect *area); void ednet_display_set_border_thickness (EDNetDisplay *d, int thickness); void ednet_display_set_border_color (EDNetDisplay *d, uint32_t color); int ednet_display_get_screen_depth (EDNetDisplay *d); EDNetFrameFormat ednet_display_get_frame_format (EDNetDisplay *d); void ednet_display_get_window_size (EDNetDisplay *d, EDNetRect *area); void ednet_display_set_bg (EDNetFrame *frame); void ednet_display_init (void); void ednet_display_exit (void); int ednet_rect_intersect (EDNetRect *src1, EDNetRect *src2, EDNetRect *dest);
You can draw video frame images received from EDNetClient with these functions.
typedef struct { int x; int y; int width; int height; } EDNetRect;
Defines the position and size of a retangle.
EDNetDisplay *ednet_display_new (EDNetWindow window);
Creates a new display object within specified window handle as a parent window.
|
a window handle (HWND in Windows, Drawable in X Window) |
Returns : |
a new EDNetDisplay, NULL if an error occurred. |
EDNetDisplay *ednet_display_ref (EDNetDisplay *d);
Adds a reference to the display.
|
void ednet_display_unref (EDNetDisplay *d);
Removes a reference from the display, deallocating the display if no references remain.
|
void ednet_display_put_video (EDNetDisplay *d, EDNetFrame *frame);
Draws a video frame on the screen.
|
|
|
a video frame, NULL if you want to draw background image. |
void ednet_display_draw (EDNetDisplay *d);
Redraws the last video frame on the screen.
|
void ednet_display_set_visible (EDNetDisplay *d, int visible);
Determines whether video images should be visible or invisible.
|
|
|
if TRUE, video images should be visible |
void ednet_display_set_area (EDNetDisplay *d, EDNetRect *area);
Sets the position and size of the display window in the parent window.
|
|
|
void ednet_display_set_src_area (EDNetDisplay *d, EDNetRect *area);
Sets the position and size of the video image to draw on the window.
|
|
|
void ednet_display_set_dest_area (EDNetDisplay *d, EDNetRect *area);
Sets the position and size of the display window on which it draws video images.
|
|
|
void ednet_display_set_border_thickness (EDNetDisplay *d, int thickness);
Set the thickness of borders within display area.
|
|
|
thickness, 0 if no border needed. |
void ednet_display_set_border_color (EDNetDisplay *d, uint32_t color);
Set the color of borders within display area.
|
|
|
a color value in 'rrggbb' format |
int ednet_display_get_screen_depth (EDNetDisplay *d);
Returns the depth of current display screen.
It may be 8, 16, 24 or 32.
|
Returns : |
the depth of display screen |
EDNetFrameFormat ednet_display_get_frame_format (EDNetDisplay *d);
Returns the frame format suitable for current display screen.
|
Returns : |
the EDNetFrameFormat |
void ednet_display_get_window_size (EDNetDisplay *d, EDNetRect *area);
Retrieves the size of internal display window.
|
|
|
a EDNetRect to store information |
void ednet_display_set_bg (EDNetFrame *frame);
Changes the background image with a specified frame.
The background image is used to draw images for signal loss or non-exist cameras.
|
int ednet_rect_intersect (EDNetRect *src1, EDNetRect *src2, EDNetRect *dest);
Calculates the intersection of two rectangles. It is allowed for 'dest' to be the same as either 'src1' or 'src2'. If the rectangles do not intersect, dest's width and height is set to 0 and its x and y values are undefined. If you are only interested in whether the rectangles intersect, but not in the intersecting area itself, pass NULL for 'dest'.
|
|
|
|
|
return location for the intersection of src1 and src2, or NULL |
Returns : |
TRUE if the rectangles intersect. |