xine-lib  1.2.9
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;
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 == Color LookUp Table */
43  uint8_t cb;
44  uint8_t cr;
45  uint8_t y;
46  uint8_t foo;
48 
49 void _x_clut_yuv2rgb(uint32_t *clut, int num_items, int color_matrix) XINE_PROTECTED;
50 
51 #define XX44_PALETTE_SIZE 32
52 
53 typedef struct {
54  unsigned size;
55  unsigned max_used;
56  uint32_t cluts[XX44_PALETTE_SIZE];
57  /* cache palette entries for both colors and hili_colors */
58  int lookup_cache[OVL_PALETTE_SIZE*2];
60 
61 
62 void _x_blend_rgb16 (uint8_t * img, vo_overlay_t * img_overl,
63  int img_width, int img_height,
64  int dst_width, int dst_height,
65  alphablend_t *extra_data) XINE_PROTECTED;
66 
67 void _x_blend_rgb24 (uint8_t * img, vo_overlay_t * img_overl,
68  int img_width, int img_height,
69  int dst_width, int dst_height,
70  alphablend_t *extra_data) XINE_PROTECTED;
71 
72 void _x_blend_rgb32 (uint8_t * img, vo_overlay_t * img_overl,
73  int img_width, int img_height,
74  int dst_width, int dst_height,
75  alphablend_t *extra_data) XINE_PROTECTED;
76 
77 void _x_blend_yuv (uint8_t *dst_base[3], vo_overlay_t * img_overl,
78  int dst_width, int dst_height, int dst_pitches[3],
79  alphablend_t *extra_data) XINE_PROTECTED;
80 
81 void _x_blend_yuy2 (uint8_t * dst_img, vo_overlay_t * img_overl,
82  int dst_width, int dst_height, int dst_pitch,
83  alphablend_t *extra_data) XINE_PROTECTED;
84 
85 /*
86  * This function isn't too smart about blending. We want to avoid creating new
87  * colors in the palette as a result from two non-zero colors needed to be
88  * blended. Instead we choose the color with the highest alpha value to be
89  * visible. Some parts of the code taken from the "VeXP" project.
90  */
91 
92 void _x_blend_xx44 (uint8_t *dst_img, vo_overlay_t *img_overl,
93  int dst_width, int dst_height, int dst_pitch,
94  alphablend_t *extra_data,
95  xx44_palette_t *palette,int ia44) XINE_PROTECTED;
96 
97 /*
98  * Functions to handle the xine-specific palette.
99  */
100 
102 void _x_init_xx44_palette(xx44_palette_t *p, unsigned num_entries) XINE_PROTECTED;
104 
105 /*
106  * Convert the xine-specific palette to something useful.
107  */
108 
109 void _x_xx44_to_xvmc_palette(const xx44_palette_t *p,unsigned char *xvmc_palette,
110  unsigned first_xx44_entry, unsigned num_xx44_entries,
111  unsigned num_xvmc_components, const char *xvmc_components) XINE_PROTECTED;
112 
113 
114 #endif
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
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
void _x_clear_xx44_palette(xx44_palette_t *p)
Definition: alphablend.c:1916
Definition: alphablend.h:30
void * buffer
Definition: alphablend.h:31
Definition: video_out.h:476
void _x_clut_yuv2rgb(uint32_t *clut, int num_items, int color_matrix)
Definition: alphablend.c:2188
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:2007
#define XINE_PACKED
Definition: attributes.h:125
void _x_alphablend_init(alphablend_t *extra_data, xine_t *xine)
Definition: alphablend.c:2160
#define XX44_PALETTE_SIZE
Definition: alphablend.h:51
unsigned max_used
Definition: alphablend.h:55
int buffer_size
Definition: alphablend.h:32
void _x_init_xx44_palette(xx44_palette_t *p, unsigned num_entries)
Definition: alphablend.c:1931
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
Definition: alphablend.h:42
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
#define OVL_PALETTE_SIZE
Definition: video_out.h:281
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:1957
int offset_y
Definition: alphablend.h:36
uint8_t y
Definition: alphablend.h:45
void _x_alphablend_free(alphablend_t *extra_data)
Definition: alphablend.c:2179
#define XINE_PROTECTED
Definition: attributes.h:73
void _x_dispose_xx44_palette(xx44_palette_t *p)
Definition: alphablend.c:1936
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
Definition: alphablend.h:53
Definition: xine_internal.h:81
uint8_t foo
Definition: alphablend.h:46
uint8_t cb
Definition: alphablend.h:43
unsigned size
Definition: alphablend.h:54
int disable_exact_blending
Definition: alphablend.h:34
uint8_t cr
Definition: alphablend.h:44