xine-lib 1.2.11
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
30typedef struct {
31 void *buffer;
32 unsigned int buffer_size;
33
35
36 int offset_x, offset_y;
38
41
42typedef struct clut_s clut_t;
43
44struct clut_s { /* CLUT == Color LookUp Table */
45 uint8_t cb;
46 uint8_t cr;
47 uint8_t y;
48 uint8_t foo;
50
51void _x_clut_yuv2rgb(uint32_t *clut, int num_items, int color_matrix) XINE_PROTECTED;
52
53#define XX44_PALETTE_SIZE 32
54
55typedef 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
64void _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
69void _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
74void _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
79void _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
83void _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
94void _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
104void _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
111void _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
void _x_clut_yuv2rgb(uint32_t *clut, int num_items, int color_matrix)
Definition: alphablend.c:2189
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_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
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
void _x_clear_xx44_palette(xx44_palette_t *p)
Definition: alphablend.c:1916
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_dispose_xx44_palette(xx44_palette_t *p)
Definition: alphablend.c:1936
#define XX44_PALETTE_SIZE
Definition: alphablend.h:53
void _x_alphablend_init(alphablend_t *extra_data, xine_t *xine)
Definition: alphablend.c:2161
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
void _x_init_xx44_palette(xx44_palette_t *p, unsigned num_entries)
Definition: alphablend.c:1931
void _x_alphablend_free(alphablend_t *extra_data)
Definition: alphablend.c:2180
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
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
#define XINE_PROTECTED
Definition: attributes.h:75
#define XINE_PACKED
Definition: attributes.h:147
#define OVL_PALETTE_SIZE
Definition: video_out.h:280
Definition: alphablend.h:30
int offset_x
Definition: alphablend.h:36
int disable_exact_blending
Definition: alphablend.h:34
unsigned int buffer_size
Definition: alphablend.h:32
void * buffer
Definition: alphablend.h:31
Definition: alphablend.h:44
uint8_t cb
Definition: alphablend.h:45
uint8_t foo
Definition: alphablend.h:48
uint8_t y
Definition: alphablend.h:47
uint8_t cr
Definition: alphablend.h:46
Definition: video_out.h:472
Definition: xine_internal.h:80
Definition: alphablend.h:55
unsigned max_used
Definition: alphablend.h:57
unsigned size
Definition: alphablend.h:56