xine-lib  1.2.10
alphablend.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (C) 2000 Thomas Mirlacher
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA.
18  *
19  * The author may be reached as <dent@linuxvideo.org>
20  *
21  *------------------------------------------------------------
22  *
23  */
24 
25 #ifndef __ALPHABLEND_H__
26 #define __ALPHABLEND_H__
27 
28 #include "video_out.h"
29 
30 typedef struct {
31  void *buffer;
32  unsigned int buffer_size;
33 
35 
36  int offset_x, offset_y;
37 } alphablend_t;
38 
39 void _x_alphablend_init(alphablend_t *extra_data, xine_t *xine) XINE_PROTECTED;
41 
42 typedef struct clut_s clut_t;
43 
44 struct clut_s { /* CLUT == Color LookUp Table */
45  uint8_t cb;
46  uint8_t cr;
47  uint8_t y;
48  uint8_t foo;
49 } XINE_PACKED;
50 
51 void _x_clut_yuv2rgb(uint32_t *clut, int num_items, int color_matrix) XINE_PROTECTED;
52 
53 #define XX44_PALETTE_SIZE 32
54 
55 typedef struct {
56  unsigned size;
57  unsigned max_used;
58  uint32_t cluts[XX44_PALETTE_SIZE];
59  /* cache palette entries for both colors and hili_colors */
60  int lookup_cache[OVL_PALETTE_SIZE*2];
62 
63 
64 void _x_blend_rgb16 (uint8_t * img, vo_overlay_t * img_overl,
65  int img_width, int img_height,
66  int dst_width, int dst_height,
67  alphablend_t *extra_data) XINE_PROTECTED;
68 
69 void _x_blend_rgb24 (uint8_t * img, vo_overlay_t * img_overl,
70  int img_width, int img_height,
71  int dst_width, int dst_height,
72  alphablend_t *extra_data) XINE_PROTECTED;
73 
74 void _x_blend_rgb32 (uint8_t * img, vo_overlay_t * img_overl,
75  int img_width, int img_height,
76  int dst_width, int dst_height,
77  alphablend_t *extra_data) XINE_PROTECTED;
78 
79 void _x_blend_yuv (uint8_t *dst_base[3], vo_overlay_t * img_overl,
80  int dst_width, int dst_height, int dst_pitches[3],
81  alphablend_t *extra_data) XINE_PROTECTED;
82 
83 void _x_blend_yuy2 (uint8_t * dst_img, vo_overlay_t * img_overl,
84  int dst_width, int dst_height, int dst_pitch,
85  alphablend_t *extra_data) XINE_PROTECTED;
86 
87 /*
88  * This function isn't too smart about blending. We want to avoid creating new
89  * colors in the palette as a result from two non-zero colors needed to be
90  * blended. Instead we choose the color with the highest alpha value to be
91  * visible. Some parts of the code taken from the "VeXP" project.
92  */
93 
94 void _x_blend_xx44 (uint8_t *dst_img, vo_overlay_t *img_overl,
95  int dst_width, int dst_height, int dst_pitch,
96  alphablend_t *extra_data,
97  xx44_palette_t *palette,int ia44) XINE_PROTECTED;
98 
99 /*
100  * Functions to handle the xine-specific palette.
101  */
102 
104 void _x_init_xx44_palette(xx44_palette_t *p, unsigned num_entries) XINE_PROTECTED;
106 
107 /*
108  * Convert the xine-specific palette to something useful.
109  */
110 
111 void _x_xx44_to_xvmc_palette(const xx44_palette_t *p,unsigned char *xvmc_palette,
112  unsigned first_xx44_entry, unsigned num_xx44_entries,
113  unsigned num_xvmc_components, const char *xvmc_components) XINE_PROTECTED;
114 
115 
116 #endif
xine_s
Definition: xine_internal.h:80
_x_blend_rgb24
void _x_blend_rgb24(uint8_t *img, vo_overlay_t *img_overl, int img_width, int img_height, int dst_width, int dst_height, alphablend_t *extra_data)
Definition: alphablend.c:727
_x_blend_yuv
void _x_blend_yuv(uint8_t *dst_base[3], vo_overlay_t *img_overl, int dst_width, int dst_height, int dst_pitches[3], alphablend_t *extra_data)
Definition: alphablend.c:1155
clut_s::cb
uint8_t cb
Definition: alphablend.h:45
alphablend_t::buffer
void * buffer
Definition: alphablend.h:31
_x_blend_xx44
void _x_blend_xx44(uint8_t *dst_img, vo_overlay_t *img_overl, int dst_width, int dst_height, int dst_pitch, alphablend_t *extra_data, xx44_palette_t *palette, int ia44)
Definition: alphablend.c:2008
alphablend_t
Definition: alphablend.h:30
_x_clut_yuv2rgb
void _x_clut_yuv2rgb(uint32_t *clut, int num_items, int color_matrix)
Definition: alphablend.c:2189
_x_clear_xx44_palette
void _x_clear_xx44_palette(xx44_palette_t *p)
Definition: alphablend.c:1916
_x_alphablend_init
void _x_alphablend_init(alphablend_t *extra_data, xine_t *xine)
Definition: alphablend.c:2161
alphablend_t::disable_exact_blending
int disable_exact_blending
Definition: alphablend.h:34
vo_overlay_s
Definition: video_out.h:472
alphablend_t::offset_y
int offset_y
Definition: alphablend.h:36
video_out.h
OVL_PALETTE_SIZE
#define OVL_PALETTE_SIZE
Definition: video_out.h:280
clut_s::y
uint8_t y
Definition: alphablend.h:47
xx44_palette_t::max_used
unsigned max_used
Definition: alphablend.h:57
_x_blend_rgb32
void _x_blend_rgb32(uint8_t *img, vo_overlay_t *img_overl, int img_width, int img_height, int dst_width, int dst_height, alphablend_t *extra_data)
Definition: alphablend.c:899
clut_s::foo
uint8_t foo
Definition: alphablend.h:48
_x_blend_rgb16
void _x_blend_rgb16(uint8_t *img, vo_overlay_t *img_overl, int img_width, int img_height, int dst_width, int dst_height, alphablend_t *extra_data)
Definition: alphablend.c:560
_x_init_xx44_palette
void _x_init_xx44_palette(xx44_palette_t *p, unsigned num_entries)
Definition: alphablend.c:1931
XINE_PACKED
#define XINE_PACKED
Definition: attributes.h:145
XX44_PALETTE_SIZE
#define XX44_PALETTE_SIZE
Definition: alphablend.h:53
_x_dispose_xx44_palette
void _x_dispose_xx44_palette(xx44_palette_t *p)
Definition: alphablend.c:1936
_x_xx44_to_xvmc_palette
void _x_xx44_to_xvmc_palette(const xx44_palette_t *p, unsigned char *xvmc_palette, unsigned first_xx44_entry, unsigned num_xx44_entries, unsigned num_xvmc_components, const char *xvmc_components)
Definition: alphablend.c:1958
xx44_palette_t::size
unsigned size
Definition: alphablend.h:56
_x_alphablend_free
void _x_alphablend_free(alphablend_t *extra_data)
Definition: alphablend.c:2180
_x_blend_yuy2
void _x_blend_yuy2(uint8_t *dst_img, vo_overlay_t *img_overl, int dst_width, int dst_height, int dst_pitch, alphablend_t *extra_data)
Definition: alphablend.c:1602
XINE_PROTECTED
#define XINE_PROTECTED
Definition: attributes.h:73
xx44_palette_t
Definition: alphablend.h:55
clut_s
Definition: alphablend.h:44
alphablend_t::buffer_size
unsigned int buffer_size
Definition: alphablend.h:32
clut_s::cr
uint8_t cr
Definition: alphablend.h:46