Display Operations

차례

Synopsis
Description
Details

Display Operations - draw video frame images

Synopsis

#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);

Description

You can draw video frame images received from EDNetClient with these functions.

Details

ednet_display_destroy

#define ednet_display_destroy (d)     (d)

EDNetDisplay

typedef struct _EDNetDisplay EDNetDisplay;

A display object to draw video frame images

EDNetRect

typedef struct
{
  int x;
  int y;
  int width;
  int height;
} EDNetRect;

Defines the position and size of a retangle.

int x :

the x coordinate of the left edge of the rectangle

int y :

the y coordinate of the top of the rectangle

int width :

the width of the rectangle

int height :

the height of the rectangle

ednet_display_new ()

EDNetDisplay    *ednet_display_new                  (EDNetWindow   window);

Creates a new display object within specified window handle as a parent window.

window :

a window handle (HWND in Windows, Drawable in X Window)

Returns :

a new EDNetDisplay, NULL if an error occurred.

ednet_display_ref ()

EDNetDisplay    *ednet_display_ref                  (EDNetDisplay *d);

Adds a reference to the display.

d :

a EDNetDisplay

ednet_display_unref ()

void             ednet_display_unref                (EDNetDisplay *d);

Removes a reference from the display, deallocating the display if no references remain.

d :

a EDNetDisplay

ednet_display_put_video ()

void             ednet_display_put_video            (EDNetDisplay *d,
                                                     EDNetFrame   *frame);

Draws a video frame on the screen.

d :

a EDNetDisplay

frame :

a video frame, NULL if you want to draw background image.

ednet_display_draw ()

void             ednet_display_draw                 (EDNetDisplay *d);

Redraws the last video frame on the screen.

d :

a EDNetDisplay

ednet_display_set_visible ()

void             ednet_display_set_visible          (EDNetDisplay *d,
                                                     int           visible);

Determines whether video images should be visible or invisible.

d :

a EDNetDisplay

visible :

if TRUE, video images should be visible

ednet_display_set_area ()

void             ednet_display_set_area             (EDNetDisplay *d,
                                                     EDNetRect    *area);

Sets the position and size of the display window in the parent window.

d :

a EDNetDisplay

area :

a EDNetRect

ednet_display_set_src_area ()

void             ednet_display_set_src_area         (EDNetDisplay *d,
                                                     EDNetRect    *area);

Sets the position and size of the video image to draw on the window.

d :

a EDNetDisplay

area :

a EDNetRect

ednet_display_set_dest_area ()

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.

d :

a EDNetDisplay

area :

a EDNetRect

ednet_display_set_border_thickness ()

void             ednet_display_set_border_thickness (EDNetDisplay *d,
                                                     int           thickness);

Set the thickness of borders within display area.

d :

a EDNetDisplay

thickness :

thickness, 0 if no border needed.

ednet_display_set_border_color ()

void             ednet_display_set_border_color     (EDNetDisplay *d,
                                                     uint32_t      color);

Set the color of borders within display area.

d :

a EDNetDisplay

color :

a color value in 'rrggbb' format

ednet_display_get_screen_depth ()

int              ednet_display_get_screen_depth     (EDNetDisplay *d);

Returns the depth of current display screen.

It may be 8, 16, 24 or 32.

d :

a EDNetDisplay

Returns :

the depth of display screen

ednet_display_get_frame_format ()

EDNetFrameFormat ednet_display_get_frame_format     (EDNetDisplay *d);

Returns the frame format suitable for current display screen.

d :

a EDNetDisplay

Returns :

the EDNetFrameFormat

ednet_display_get_window_size ()

void             ednet_display_get_window_size      (EDNetDisplay *d,
                                                     EDNetRect    *area);

Retrieves the size of internal display window.

d :

a EDNetDisplay

area :

a EDNetRect to store information

ednet_display_set_bg ()

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.

frame :

a EDNetFrame

ednet_display_init ()

void             ednet_display_init                 (void);

Initializes display module.

ednet_display_exit ()

void             ednet_display_exit                 (void);

Finalizes display module.

ednet_rect_intersect ()

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'.

src1 :

a EDNetRect

src2 :

a EDNetRect

dest :

return location for the intersection of src1 and src2, or NULL

Returns :

TRUE if the rectangles intersect.