comparison libvo/gl_common.c @ 26837:e564a1f2f762

update doxygen comments
author reimar
date Sat, 24 May 2008 11:25:57 +0000
parents ba086caf1230
children a6ef642cdd86
comparison
equal deleted inserted replaced
26836:ba086caf1230 26837:e564a1f2f762
893 893
894 //! size of gamma map use to avoid slow exp function in gen_yuv2rgb_map 894 //! size of gamma map use to avoid slow exp function in gen_yuv2rgb_map
895 #define GMAP_SIZE (1024) 895 #define GMAP_SIZE (1024)
896 /** 896 /**
897 * \brief generate a 3D YUV -> RGB map 897 * \brief generate a 3D YUV -> RGB map
898 * \param params struct containing parameters like brightness, gamma, ...
898 * \param map where to store map. Must provide space for (size + 2)^3 elements 899 * \param map where to store map. Must provide space for (size + 2)^3 elements
899 * \param size size of the map, excluding border 900 * \param size size of the map, excluding border
900 * \param brightness desired brightness adjustment for conversion
901 * \param contrast desired contrast adjustment for conversion
902 * \param uvcos desired hue/saturation adjustment for conversion
903 * \param uvsin desired hue/saturation adjustment for conversion
904 * \param rgamma desired red gamma adjustment for conversion
905 * \param ggamma desired green gamma adjustment for conversion
906 * \param bgamma desired blue gamma adjustment for conversion
907 */ 901 */
908 static void gen_yuv2rgb_map(gl_conversion_params_t *params, unsigned char *map, int size) { 902 static void gen_yuv2rgb_map(gl_conversion_params_t *params, unsigned char *map, int size) {
909 int i, j, k; 903 int i, j, k;
910 float step = 1.0 / size; 904 float step = 1.0 / size;
911 float y, u, v; 905 float y, u, v;
952 #define LOOKUP_RES 512 946 #define LOOKUP_RES 512
953 //! resolution for 3D yuv->rgb conversion lookup table 947 //! resolution for 3D yuv->rgb conversion lookup table
954 #define LOOKUP_3DRES 32 948 #define LOOKUP_3DRES 32
955 /** 949 /**
956 * \brief creates and initializes helper textures needed for yuv conversion 950 * \brief creates and initializes helper textures needed for yuv conversion
951 * \param params struct containing parameters like brightness, gamma, ...
957 * \param texu contains next free texture unit number 952 * \param texu contains next free texture unit number
958 * \param texs texture unit ids for the conversion are stored in this array 953 * \param texs texture unit ids for the conversion are stored in this array
959 * \param brightness desired brightness adjustment for conversion
960 * \param contrast desired contrast adjustment for conversion
961 * \param uvcos desired hue/saturation adjustment for conversion
962 * \param uvsin desired hue/saturation adjustment for conversion
963 * \param rgamma desired red gamma adjustment for conversion
964 * \param ggamma desired green gamma adjustment for conversion
965 * \param bgamma desired blue gamma adjustment for conversion
966 */ 954 */
967 static void create_conv_textures(gl_conversion_params_t *params, int *texu, char *texs) { 955 static void create_conv_textures(gl_conversion_params_t *params, int *texu, char *texs) {
968 unsigned char *lookup_data = NULL; 956 unsigned char *lookup_data = NULL;
969 int conv = YUV_CONVERSION(params->type); 957 int conv = YUV_CONVERSION(params->type);
970 switch (conv) { 958 switch (conv) {
1026 * \param in_tex texture unit the scaler should read from 1014 * \param in_tex texture unit the scaler should read from
1027 * \param out_comp component of the yuv variable the scaler stores the result in 1015 * \param out_comp component of the yuv variable the scaler stores the result in
1028 * \param rect if rectangular (pixel) adressing should be used for in_tex 1016 * \param rect if rectangular (pixel) adressing should be used for in_tex
1029 * \param texw width of the in_tex texture 1017 * \param texw width of the in_tex texture
1030 * \param texh height of the in_tex texture 1018 * \param texh height of the in_tex texture
1019 * \param strength strength of filter effect if the scaler does some kind of filtering
1031 */ 1020 */
1032 static void add_scaler(int scaler, char **prog_pos, int *remain, char *texs, 1021 static void add_scaler(int scaler, char **prog_pos, int *remain, char *texs,
1033 char in_tex, char out_comp, int rect, int texw, int texh, 1022 char in_tex, char out_comp, int rect, int texw, int texh,
1034 double strength) { 1023 double strength) {
1035 const char *ttype = rect ? "RECT" : "2D"; 1024 const char *ttype = rect ? "RECT" : "2D";
1152 1141
1153 #define MAX_PROGSZ (1024*1024) 1142 #define MAX_PROGSZ (1024*1024)
1154 1143
1155 /** 1144 /**
1156 * \brief setup a fragment program that will do YUV->RGB conversion 1145 * \brief setup a fragment program that will do YUV->RGB conversion
1157 * \param brightness brightness adjustment offset 1146 * \param parms struct containing parameters like conversion and scaler type,
1158 * \param contrast contrast adjustment factor 1147 * brightness, ...
1159 * \param uvcos used for saturation and hue adjustment
1160 * \param uvsin used for saturation and hue adjustment
1161 * \param lookup use fragment program that uses texture unit 4 to
1162 * do additional conversion via lookup.
1163 */ 1148 */
1164 static void glSetupYUVFragprog(gl_conversion_params_t *params) { 1149 static void glSetupYUVFragprog(gl_conversion_params_t *params) {
1165 int type = params->type; 1150 int type = params->type;
1166 int texw = params->texw; 1151 int texw = params->texw;
1167 int texh = params->texh; 1152 int texh = params->texh;
1261 } 1246 }
1262 } 1247 }
1263 1248
1264 /** 1249 /**
1265 * \brief setup YUV->RGB conversion 1250 * \brief setup YUV->RGB conversion
1266 * \param target texture target for Y, U and V textures (e.g. GL_TEXTURE_2D) 1251 * \param parms struct containing parameters like conversion and scaler type,
1267 * \param type YUV conversion type 1252 * brightness, ...
1268 * \param brightness brightness adjustment offset
1269 * \param contrast contrast adjustment factor
1270 * \param hue hue adjustment angle
1271 * \param saturation saturation adjustment factor
1272 * \param rgamma gamma value for red channel
1273 * \param ggamma gamma value for green channel
1274 * \param bgamma gamma value for blue channel
1275 * \ingroup glconversion 1253 * \ingroup glconversion
1276 */ 1254 */
1277 void glSetupYUVConversion(gl_conversion_params_t *params) { 1255 void glSetupYUVConversion(gl_conversion_params_t *params) {
1278 float uvcos = params->saturation * cos(params->hue); 1256 float uvcos = params->saturation * cos(params->hue);
1279 float uvsin = params->saturation * sin(params->hue); 1257 float uvsin = params->saturation * sin(params->hue);