xine-lib  1.2.9
yuv2rgb.h
Go to the documentation of this file.
1 /*
2  * yuv2rgb.h
3  *
4  * Copyright (C) 2001-2017 the xine project
5  * This file is part of xine, a free video player.
6  *
7  * based on work from mpeg2dec:
8  * Copyright (C) 1999-2001 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
9  *
10  * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
11  *
12  * mpeg2dec is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * mpeg2dec is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
25  */
26 
27 #ifndef XINE_YUV2RGB_H
28 #define XINE_YUV2RGB_H
29 
30 #include <inttypes.h>
31 
32 #include <xine/attributes.h>
33 
34 typedef struct yuv2rgb_s yuv2rgb_t;
35 
37 
38 /*
39  * function types for functions which can be replaced
40  * by hardware-accelerated versions
41  */
42 
43 typedef void (*yuv2rgb_fun_t) (yuv2rgb_t *this, uint8_t * image, uint8_t * py, uint8_t * pu, uint8_t * pv) ;
44 
45 typedef void (*yuy22rgb_fun_t) (yuv2rgb_t *this, uint8_t * image, uint8_t * p);
46 
47 typedef uint32_t (*yuv2rgb_single_pixel_fun_t) (yuv2rgb_t *this, uint8_t y, uint8_t u, uint8_t v);
48 
49 /*
50  * modes supported - feel free to implement yours
51  */
52 
53 #define MODE_8_RGB 1
54 #define MODE_8_BGR 2
55 #define MODE_15_RGB 3
56 #define MODE_15_BGR 4
57 #define MODE_16_RGB 5
58 #define MODE_16_BGR 6
59 #define MODE_24_RGB 7
60 #define MODE_24_BGR 8
61 #define MODE_32_RGB 9
62 #define MODE_32_BGR 10
63 #define MODE_8_GRAY 11
64 #define MODE_PALETTE 12
65 
66 /*
67  * colormatrix values - (mpeg_matrix_index << 1) | fullrange
68  */
69 
70 #define CM_DEFAULT 10
71 #define CM_SD 10
72 #define CM_HD 2
73 #define CM_FULLRANGE 1
74 
75 struct yuv2rgb_s {
76  /*
77  * configure converter for scaling factors
78  */
79  int (*configure) (yuv2rgb_t *this,
80  int source_width, int source_height,
81  int y_stride, int uv_stride,
82  int dest_width, int dest_height,
83  int rgb_stride);
84 
85  /*
86  * start a new field or frame if dest is NULL
87  */
88  int (*next_slice) (yuv2rgb_t *this, uint8_t **dest);
89 
90  /*
91  * free resources
92  */
93  void (*dispose) (yuv2rgb_t *this);
94 
95  /*
96  * this is the function to call for the yuv2rgb and scaling process
97  */
99 
100  /*
101  * this is the function to call for the yuy2->rgb and scaling process
102  */
104 
105  /*
106  * this is the function to call for the yuv2rgb for a single pixel
107  * (used for converting clut colors)
108  */
109 
111 };
112 
113 /*
114  * convenience class to easily create a lot of converters
115  */
116 
118  yuv2rgb_t* (*create_converter) (yuv2rgb_factory_t *this);
119 
120  /*
121  * set color space conversion levels
122  * for all converters produced by this factory
123  */
125  int brightness, int contrast, int saturation, int colormatrix);
126 
127  /*
128  * free resources
129  */
130  void (*dispose) (yuv2rgb_factory_t *this);
131 };
132 
133 yuv2rgb_factory_t *yuv2rgb_factory_init (int mode, int swapped, uint8_t *colormap) XINE_PROTECTED XINE_MALLOC;
134 
135 
136 #endif /* XINE_YUV2RGB_H */
void(* set_csc_levels)(yuv2rgb_factory_t *this, int brightness, int contrast, int saturation, int colormatrix)
Definition: yuv2rgb.h:124
Definition: yuv2rgb.h:75
enable disable number of frames of telecine pattern sync required before mode change make frames evenly spaced for film mode(24 fps)" ) PARAM_ITEM( POST_PARAM_TYPE_BOOL
#define XINE_MALLOC
Definition: attributes.h:119
int(* next_slice)(yuv2rgb_t *this, uint8_t **dest)
Definition: yuv2rgb.h:88
void(* yuy22rgb_fun_t)(yuv2rgb_t *this, uint8_t *image, uint8_t *p)
Definition: yuv2rgb.h:45
yuy22rgb_fun_t yuy22rgb_fun
Definition: yuv2rgb.h:103
void(* dispose)(yuv2rgb_factory_t *this)
Definition: yuv2rgb.h:130
yuv2rgb_fun_t yuv2rgb_fun
Definition: yuv2rgb.h:98
yuv2rgb_single_pixel_fun_t yuv2rgb_single_pixel_fun
Definition: yuv2rgb.h:110
contrast
Definition: eq.c:162
uint32_t(* yuv2rgb_single_pixel_fun_t)(yuv2rgb_t *this, uint8_t y, uint8_t u, uint8_t v)
Definition: yuv2rgb.h:47
void(* dispose)(yuv2rgb_t *this)
Definition: yuv2rgb.h:93
#define XINE_PROTECTED
Definition: attributes.h:73
void(* yuv2rgb_fun_t)(yuv2rgb_t *this, uint8_t *image, uint8_t *py, uint8_t *pu, uint8_t *pv)
Definition: yuv2rgb.h:43
yuv2rgb_factory_t * yuv2rgb_factory_init(int mode, int swapped, uint8_t *colormap)
Definition: yuv2rgb.c:3330
int(* configure)(yuv2rgb_t *this, int source_width, int source_height, int y_stride, int uv_stride, int dest_width, int dest_height, int rgb_stride)
Definition: yuv2rgb.h:79
Definition: yuv2rgb.h:117