This file is indexed.

/usr/include/libvisual-0.4/libvisual/lv_video.h is in libvisual-0.4-dev 0.4.0-10.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
/* Libvisual - The audio visualisation framework.
 * 
 * Copyright (C) 2004, 2005, 2006 Dennis Smit <ds@nerds-incorporated.org>
 *
 * Authors: Dennis Smit <ds@nerds-incorporated.org>
 *	    Duilio J. Protti <dprotti@users.sourceforge.net>
 *	    Chong Kai Xiong <descender@phreaker.net>
 *	    Jean-Christophe Hoelt <jeko@ios-software.com>
 *
 * $Id: lv_video.h,v 1.34.2.1 2006/03/04 12:32:48 descender Exp $
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

#ifndef _LV_VIDEO_H
#define _LV_VIDEO_H

#include <libvisual/lv_common.h>
#include <libvisual/lv_palette.h>
#include <libvisual/lv_rectangle.h>
#include <libvisual/lv_buffer.h>
#include <libvisual/lv_gl.h>

VISUAL_BEGIN_DECLS

#define VISUAL_VIDEO(obj)				(VISUAL_CHECK_CAST ((obj), VisVideo))
#define VISUAL_VIDEO_ATTRIBUTE_OPTIONS(obj)		(VISUAL_CHECK_CAST ((obj), VisVideoAttributeOptions))

#define VISUAL_VIDEO_ATTRIBUTE_OPTIONS_GL_ENTRY(options, attr, val)	\
	options.gl_attributes[attr].attribute = attr;			\
	options.gl_attributes[attr].value = val;			\
	options.gl_attributes[attr].mutated = TRUE;


/* NOTE: The depth find helper code in lv_actor depends on an arrangment from low to high */
/**
 * Enumerate that defines video depths for use within plugins, libvisual functions, etc.
 */
typedef enum {
	VISUAL_VIDEO_DEPTH_NONE		= 0,	/**< No video surface flag. */
	VISUAL_VIDEO_DEPTH_8BIT		= 1,	/**< 8 bits indexed surface flag. */
	VISUAL_VIDEO_DEPTH_16BIT	= 2,	/**< 16 bits 5-6-5 surface flag. */
	VISUAL_VIDEO_DEPTH_24BIT	= 4,	/**< 24 bits surface flag. */
	VISUAL_VIDEO_DEPTH_32BIT	= 8,	/**< 32 bits surface flag. */
	VISUAL_VIDEO_DEPTH_GL		= 16,	/**< openGL surface flag. */
	VISUAL_VIDEO_DEPTH_ENDLIST	= 32,	/**< Used to mark the end of the depth list. */
	VISUAL_VIDEO_DEPTH_ERROR	= -1,	/**< Used when there is an error. */
	VISUAL_VIDEO_DEPTH_ALL		= VISUAL_VIDEO_DEPTH_8BIT |  \
					  VISUAL_VIDEO_DEPTH_16BIT | \
					  VISUAL_VIDEO_DEPTH_24BIT | \
					  VISUAL_VIDEO_DEPTH_32BIT | \
					  VISUAL_VIDEO_DEPTH_GL /**< All graphical depths. */
} VisVideoDepth;

/**
 * Enumerate that defines video rotate types, used with the visual_video_rotate_*() functions.
 */
typedef enum {
	VISUAL_VIDEO_ROTATE_NONE	= 0,	/**< No rotating. */
	VISUAL_VIDEO_ROTATE_90		= 1,	/**< 90 degrees rotate. */
	VISUAL_VIDEO_ROTATE_180		= 2,	/**< 180 degrees rotate. */
	VISUAL_VIDEO_ROTATE_270		= 3	/**< 270 degrees rotate. */
} VisVideoRotateDegrees;

/**
 * Enumerate that defines the video mirror types, used with the visual_video_mirror_*() functions.
 */
typedef enum {
	VISUAL_VIDEO_MIRROR_NONE	= 0,	/**< No mirroring. */
	VISUAL_VIDEO_MIRROR_X		= 1,	/**< Mirror on the X ax. */
	VISUAL_VIDEO_MIRROR_Y		= 2	/**< Mirror on the Y ax. */
} VisVideoMirrorOrient;

/**
 * Enumerate that defines the different methods of scaling within VisVideo.
 */
typedef enum {
	VISUAL_VIDEO_SCALE_NEAREST  = 0,    /**< Nearest neighbour. */
	VISUAL_VIDEO_SCALE_BILINEAR = 1	    /**< Bilinearly interpolated. */
} VisVideoScaleMethod;

/**
 * Enumerate that defines the different blitting methods for a VisVideo.
 */
typedef enum {
	VISUAL_VIDEO_COMPOSITE_TYPE_NONE = 0,		/**< No composite set, use default. */
	VISUAL_VIDEO_COMPOSITE_TYPE_SRC,		/**< Source alpha channel. */
	VISUAL_VIDEO_COMPOSITE_TYPE_COLORKEY,		/**< Colorkey alpha. */
	VISUAL_VIDEO_COMPOSITE_TYPE_SURFACE,		/**< One alpha channel for the complete surface. */
	VISUAL_VIDEO_COMPOSITE_TYPE_SURFACECOLORKEY,	/**< Use surface alpha on colorkey. */
	VISUAL_VIDEO_COMPOSITE_TYPE_CUSTOM		/**< Custom composite function (looks up on the source VisVideo. */
} VisVideoCompositeType;


typedef struct _VisVideo VisVideo;
typedef struct _VisVideoAttributeOptions VisVideoAttributeOptions;

/* VisVideo custom composite method */

/**
 * A custom composite function needs this signature. Custom composite functions can be
 * used to overload the normal libvisual overlay functions, these are used by the different
 * blit methods. The following template should be used for custom composite functions:
 *
 * int custom_composite (VisVideo *dest, VisVideo *src)
 * {
 *         int i
 *         uint8_t *destbuf = dest->pixels;
 *         uint8_t *srcbuf = src->pixels;
 * 
 *         for (i = 0; i < src->height; i++) {
 *                 for (j = 0; j < src->width; j++) {
 *	                   
 *	                   
 *	                   destbuf += dest->bpp;
 *	                   srcbuf += src->bpp;
 *                 }
 *
 *                 destbuf += dest->pitch - (dest->width * dest->bpp);
 *                 srcbuf += src->pitch - (src->width * src->bpp);
 *         }
 * }
 *
 * It's very important that the function is pitch (rowstride, bytes per line) aware, also
 * for width and height, it's compulsory to look at the source, and not the dest. Also be aware
 * that the custom composite function is correct for the depth you're using, if you want to add
 * depth awareness to the function, you could do this by checking dest->depth.
 *
 * @see visual_video_blit_overlay_rectangle_custom
 * @see visual_video_blit_overlay_rectangle_scale_custom
 * @see visual_video_blit_overlay_custom
 *
 * @arg dest a pointer to the dest visvideo source.
 * @arg src A pointer to the source VisVideo source.
 *
 * @return VISUAL_OK on succes -VISUAL_ERROR_GENERAL on error.
 */
typedef int (*VisVideoCustomCompositeFunc)(VisVideo *dest, VisVideo *src);

/**
 * Data structure that contains all the information about a screen surface.
 * Contains all the information regarding a screen surface like the current depth it's in,
 * width, height, bpp, the size in bytes it's pixel buffer is and the screen pitch.
 *
 * It also contains a pointer to the pixels and an optional pointer to the palette.
 *
 * Elements within the structure should be set using the VisVideo system it's methods.
 */
struct _VisVideo {
	VisObject			 object;	/**< The VisObject data. */

	VisVideoDepth			 depth;		/**< Surface it's depth. */
	int				 width;		/**< Surface it's width. */
	int				 height;	/**< Surface it's height. */
	int				 bpp;		/**< Surface it's bytes per pixel. */
	int				 pitch;		/**< Surface it's pitch value. Value contains
							 * the number of bytes per line. */
	VisBuffer			*buffer;	/**< The video buffer. */
	void				**pixel_rows;	/**< Pixel row start pointer table. */
	VisPalette			*pal;		/**< Optional pointer to the palette. */

	/* Sub region */
	VisVideo			*parent;	/**< The surface it's parent, ONLY when it is a subregion. */
	VisRectangle			 rect;		/**< The rectangle over the parent surface. */

	/* Composite control */
	VisVideoCompositeType		 compositetype;	/**< The surface it's composite type. */
	VisVideoCustomCompositeFunc	 compfunc;	/**< The surface it's custom composite function. */
	VisColor			 colorkey;	/**< The surface it's alpha colorkey. */
	uint8_t				 density;	/**< The surface it's global alpha density. */
};

struct _VisVideoAttributeOptions {
	VisObject			 object;

	int				 depth;

	VisGLAttributeEntry		 gl_attributes[VISUAL_GL_ATTRIBUTE_LAST];
};

/* prototypes */
VisVideo *visual_video_new (void);
int visual_video_init (VisVideo *video);
VisVideo *visual_video_new_with_buffer (int width, int height, VisVideoDepth depth);
int visual_video_free_buffer (VisVideo *video);
int visual_video_allocate_buffer (VisVideo *video);
int visual_video_have_allocated_buffer (VisVideo *video);
int visual_video_clone (VisVideo *dest, VisVideo *src);
int visual_video_compare (VisVideo *src1, VisVideo *src2);
int visual_video_compare_ignore_pitch (VisVideo *src1, VisVideo *src2);

int visual_video_set_palette (VisVideo *video, VisPalette *pal);
int visual_video_set_buffer (VisVideo *video, void *buffer);
int visual_video_set_dimension (VisVideo *video, int width, int height);
int visual_video_set_pitch (VisVideo *video, int pitch);
int visual_video_set_depth (VisVideo *video, VisVideoDepth depth);
int visual_video_set_attributes (VisVideo *video, int width, int height, int pitch, VisVideoDepth depth);

int visual_video_get_size (VisVideo *video);

void *visual_video_get_pixels (VisVideo *video);
VisBuffer *visual_video_get_buffer (VisVideo *video);

int visual_video_depth_is_supported (int depthflag, VisVideoDepth depth);
VisVideoDepth visual_video_depth_get_next (int depthflag, VisVideoDepth depth);
VisVideoDepth visual_video_depth_get_prev (int depthflag, VisVideoDepth depth);
VisVideoDepth visual_video_depth_get_lowest (int depthflag);
VisVideoDepth visual_video_depth_get_highest (int depthflag);
VisVideoDepth visual_video_depth_get_highest_nogl (int depthflag);
int visual_video_depth_is_sane (VisVideoDepth depth);
int visual_video_depth_value_from_enum (VisVideoDepth depth);
VisVideoDepth visual_video_depth_enum_from_value (int depthvalue);

int visual_video_bpp_from_depth (VisVideoDepth depth);

int visual_video_get_boundary (VisVideo *video, VisRectangle *rect);

int visual_video_region_sub (VisVideo *dest, VisVideo *src, VisRectangle *rect);
int visual_video_region_sub_by_values (VisVideo *dest, VisVideo *src, int x, int y, int width, int height);
int visual_video_region_sub_all (VisVideo *dest, VisVideo *src);
int visual_video_region_sub_with_boundary (VisVideo *dest, VisRectangle *drect, VisVideo *src, VisRectangle *srect);

int visual_video_composite_set_type (VisVideo *video, VisVideoCompositeType type);
int visual_video_composite_set_colorkey (VisVideo *video, VisColor *color);
int visual_video_composite_set_surface (VisVideo *video, uint8_t alpha);
VisVideoCustomCompositeFunc visual_video_composite_get_function (VisVideo *dest, VisVideo *src, int alpha);
int visual_video_composite_set_function (VisVideo *video, VisVideoCustomCompositeFunc compfunc);

int visual_video_blit_overlay_rectangle (VisVideo *dest, VisRectangle *drect, VisVideo *src, VisRectangle *srect, int alpha);
int visual_video_blit_overlay_rectangle_custom (VisVideo *dest, VisRectangle *drect, VisVideo *src, VisRectangle *srect,
		VisVideoCustomCompositeFunc compfunc);
int visual_video_blit_overlay_rectangle_scale (VisVideo *dest, VisRectangle *drect, VisVideo *src, VisRectangle *srect,
		int alpha, VisVideoScaleMethod scale_method);
int visual_video_blit_overlay_rectangle_scale_custom (VisVideo *dest, VisRectangle *drect, VisVideo *src, VisRectangle *srect,
		VisVideoScaleMethod scale_method, VisVideoCustomCompositeFunc compfunc);
int visual_video_blit_overlay (VisVideo *dest, VisVideo *src, int x, int y, int alpha);
int visual_video_blit_overlay_custom (VisVideo *dest, VisVideo *src, int x, int y, VisVideoCustomCompositeFunc compfunc);

int visual_video_fill_alpha_color (VisVideo *video, VisColor *color, uint8_t density);
int visual_video_fill_alpha (VisVideo *video, uint8_t density);
int visual_video_fill_alpha_rectangle (VisVideo *video, uint8_t density, VisRectangle *rect);
int visual_video_fill_color (VisVideo *video, VisColor *color);
int visual_video_fill_color_rectangle (VisVideo *video, VisColor *color, VisRectangle *rect);

int visual_video_color_bgr_to_rgb (VisVideo *dest, VisVideo *src);

int visual_video_rotate (VisVideo *dest, VisVideo *src, VisVideoRotateDegrees degrees);
VisVideo *visual_video_rotate_new (VisVideo *src, VisVideoRotateDegrees degrees);

int visual_video_mirror (VisVideo *dest, VisVideo *src, VisVideoMirrorOrient orient);
VisVideo *visual_video_mirror_new (VisVideo *src, VisVideoMirrorOrient orient);

int visual_video_depth_transform (VisVideo *viddest, VisVideo *vidsrc);

VisVideo *visual_video_zoom_new (VisVideo *src, VisVideoScaleMethod scale_method, float zoom_factor);
int visual_video_zoom_double (VisVideo *dest, VisVideo *src);

int visual_video_scale (VisVideo *dest, VisVideo *src, VisVideoScaleMethod scale_method);
VisVideo *visual_video_scale_new (VisVideo *src, int width, int height, VisVideoScaleMethod scale_method);
int visual_video_scale_depth (VisVideo *dest, VisVideo *src, VisVideoScaleMethod scale_method);
VisVideo *visual_video_scale_depth_new (VisVideo *src, int width, int height, VisVideoDepth depth,
		VisVideoScaleMethod scale_method);

/* Optimized versions of performance sensitive routines */
/* mmx from lv_video_simd.c */ /* FIXME can we do this nicer ? */
int _lv_blit_overlay_alphasrc_mmx (VisVideo *dest, VisVideo *src);
int _lv_scale_bilinear_32_mmx (VisVideo *dest, VisVideo *src);

VISUAL_END_DECLS

#endif /* _LV_VIDEO_H */