1 #if !defined(_VIDEO_OVERLAY_H_)
2 #define _VIDEO_OVERLAY_H_
5 Copyright Be Incorporated.
6 This file will eventually be merged into Accelerant.h once the API is finalized.
9 #include <Accelerant.h>
10 #include <GraphicsDefs.h>
12 #if defined(__cplusplus)
17 B_SUPPORTS_OVERLAYS
= 1U << 31 // part of display_mode.flags
21 B_OVERLAY_COUNT
= 0x08000000,
22 B_OVERLAY_SUPPORTED_SPACES
,
23 B_OVERLAY_SUPPORTED_FEATURES
,
24 B_ALLOCATE_OVERLAY_BUFFER
,
25 B_RELEASE_OVERLAY_BUFFER
,
26 B_GET_OVERLAY_CONSTRAINTS
,
33 uint32 space
; /* color_space of buffer */
34 uint16 width
; /* width in pixels */
35 uint16 height
; /* height in lines */
36 uint32 bytes_per_row
; /* number of bytes in one line */
37 void *buffer
; /* pointer to first byte of overlay buffer in virtual memory */
38 void *buffer_dma
; /* pointer to first byte of overlay buffer in physical memory for DMA */
49 B_OVERLAY_COLOR_KEY
= 1 << 0,
50 B_OVERLAY_CHROMA_KEY
= 1 << 1,
51 B_OVERLAY_HORIZONTAL_FILTERING
= 1 << 2,
52 B_OVERLAY_VERTICAL_FILTERING
= 1 << 3,
53 B_OVERLAY_HORIZONTAL_MIRRORING
= 1 << 4,
54 B_OVERLAY_KEYING_USES_ALPHA
= 1 << 5
58 uint8 value
; /* if DAC color component of graphic pixel & mask == value, */
59 uint8 mask
; /* then show overlay pixel, else show graphic pixel */
63 int16 h_start
; /* Top left un-clipped corner of the window in the virtual display */
64 int16 v_start
; /* Note that these are _signed_ values */
65 uint16 width
; /* un-clipped width of the overlay window */
66 uint16 height
; /* un-clipped height of the overlay window */
68 uint16 offset_left
; /* that portion of the overlay_window which is actually displayed */
69 uint16 offset_top
; /* ie, the first line displayed is v_start + offset_top */
70 uint16 offset_right
; /* and the first pixel displayed is h_start + offset_left */
73 overlay_key_color red
; /* when using color keying, all components must match */
74 overlay_key_color green
;
75 overlay_key_color blue
;
76 overlay_key_color alpha
;
77 uint32 flags
; /* which features should be enabled. See enum above. */
83 } overlay_uint16_minmax
;
88 } overlay_float_minmax
;
91 uint16 h_alignment
; /* alignments: a 1 bit set in every bit which must be zero */
93 uint16 width_alignment
;
94 uint16 height_alignment
;
95 overlay_uint16_minmax width
; /* min and max sizes in each axis */
96 overlay_uint16_minmax height
;
101 overlay_limits window
;
102 overlay_float_minmax h_scale
;
103 overlay_float_minmax v_scale
;
104 } overlay_constraints
;
106 typedef void * overlay_token
;
108 typedef uint32 (*overlay_count
)(const display_mode
*dm
);
109 typedef const uint32
*(*overlay_supported_spaces
)(const display_mode
*dm
);
110 typedef uint32 (*overlay_supported_features
)(uint32 a_color_space
);
111 typedef const overlay_buffer
*(*allocate_overlay_buffer
)(color_space cs
, uint16 width
, uint16 height
);
112 typedef status_t (*release_overlay_buffer
)(const overlay_buffer
*ob
);
113 typedef status_t (*get_overlay_constraints
)(const display_mode
*dm
, const overlay_buffer
*ob
, overlay_constraints
*oc
);
114 typedef overlay_token (*allocate_overlay
)(void);
115 typedef status_t (*release_overlay
)(overlay_token ot
);
116 typedef status_t (*configure_overlay
)(overlay_token ot
, const overlay_buffer
*ob
, const overlay_window
*ow
, const overlay_view
*ov
);
118 #if defined(__cplusplus)