Constness changes
[melted] / src / framework / mlt_geometry.h
1 /*
2 * mlt_geometry.h -- provides the geometry API
3 * Copyright (C) 2004-2005 Ushodaya Enterprises Limited
4 * Author: Charles Yates <charles.yates@pandora.be>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21 #ifndef _MLT_GEOMETRY_H
22 #define _MLT_GEOMETRY_H
23
24 #include "mlt_types.h"
25
26 struct mlt_geometry_item_s
27 {
28 /* Will be 1 when this is a key frame */
29 int key;
30 /* The actual frame this corresponds to */
31 int frame;
32 /* Distort */
33 int distort;
34 /* x,y are upper left */
35 float x, y, w, h, mix;
36 /* Indicates which values are fixed */
37 int f[ 5 ];
38 };
39
40 struct mlt_geometry_s
41 {
42 void *local;
43 };
44
45 /* Create a new geometry structure */
46 extern mlt_geometry mlt_geometry_init( );
47 /* Parse the geometry specification for a given length and normalised width/height (-1 for default) */
48 extern int mlt_geometry_parse( mlt_geometry self, char *data, int length, int nw, int nh );
49 /* Conditionally refresh the geometry if it's modified */
50 extern int mlt_geometry_refresh( mlt_geometry self, char *data, int length, int nw, int nh );
51 /* Get and set the length */
52 extern int mlt_geometry_get_length( mlt_geometry self );
53 extern void mlt_geometry_set_length( mlt_geometry self, int length );
54 /* Parse an item - doesn't affect the geometry itself but uses current information for evaluation */
55 /* (item->frame should be specified if not included in the data itself) */
56 extern int mlt_geometry_parse_item( mlt_geometry self, mlt_geometry_item item, char *data );
57 /* Fetch a geometry item for an absolute position */
58 extern int mlt_geometry_fetch( mlt_geometry self, mlt_geometry_item item, float position );
59 /* Specify a geometry item at an absolute position */
60 extern int mlt_geometry_insert( mlt_geometry self, mlt_geometry_item item );
61 /* Remove the key at the specified position */
62 extern int mlt_geometry_remove( mlt_geometry self, int position );
63 /* Get the key at the position or the next following */
64 extern int mlt_geometry_next_key( mlt_geometry self, mlt_geometry_item item, int position );
65 extern int mlt_geometry_prev_key( mlt_geometry self, mlt_geometry_item item, int position );
66 /* Serialise the current geometry */
67 extern char *mlt_geometry_serialise_cut( mlt_geometry self, int in, int out );
68 extern char *mlt_geometry_serialise( mlt_geometry self );
69 /* Close the geometry */
70 extern void mlt_geometry_close( mlt_geometry self );
71
72 #endif
73