3 * sushivision copyright (C) 2006-2007 Monty <monty@xiph.org>
5 * sushivision 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, or (at your option)
10 * sushivision 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.
15 * You should have received a copy of the GNU General Public License
16 * along with sushivision; see the file COPYING. If not, write to the
17 * Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
25 typedef struct sv_scale sv_scale_t
;
26 typedef struct sv_panel sv_panel_t
;
27 typedef struct sv_dim sv_dim_t
;
28 typedef struct _sv_obj sv_obj_t
;
29 typedef struct _sv_scale_internal sv_scale_internal_t
;
30 typedef struct _sv_dim_internal sv_dim_internal_t
;
31 typedef union _sv_dim_subtype sv_dim_subtype_t
;
32 typedef struct _sv_panel_internal sv_panel_internal_t
;
33 typedef union _sv_panel_subtype sv_panel_subtype_t
;
35 int sv_submain(int argc
, char *argv
[]);
37 int sv_save(char *filename
);
38 int sv_load(char *filename
);
40 /* toplevel ******************************************************/
41 extern int sv_init(void);
42 extern int sv_go(void);
43 extern int sv_join(void);
45 /* scales ********************************************************/
53 sv_scale_internal_t
*private;
57 sv_scale_t
*sv_scale_new (char *name
,
60 sv_scale_t
*sv_scale_copy (sv_scale_t
*s
);
62 void sv_scale_free (sv_scale_t
*s
);
64 /* dimensions ****************************************************/
66 #define SV_DIM_NO_X 0x100
67 #define SV_DIM_NO_Y 0x200
68 #define SV_DIM_ZEROINDEX 0x1
69 #define SV_DIM_MONOTONIC 0x2
71 enum sv_dim_type
{ SV_DIM_CONTINUOUS
,
79 enum sv_dim_type type
;
87 int (*callback
)(sv_dim_t
*);
88 sv_dim_subtype_t
*subtype
;
89 sv_dim_internal_t
*private;
92 sv_dim_t
*sv_dim_new (char *decl
);
94 sv_dim_t
*sv_dim (char *name
);
96 int sv_dim_set_scale (sv_scale_t
*scale
);
98 int sv_dim_make_scale (char *format
);
100 int sv_dim_set_value (double val
);
102 int sv_dim_set_bracket (double lo
,
105 int sv_dim_callback_value (int (*callback
)(sv_dim_t
*, void*),
106 void *callback_data
);
108 /* objectives ****************************************************/
110 int sv_obj_new (char *decl
,
111 void (*function
)(double *,double *),
115 int sv_obj (char *name
);
117 int sv_obj_set_scale (sv_scale_t
*scale
);
119 int sv_obj_make_scale (char *format
);
121 /* panels ********************************************************/
123 enum sv_panel_type
{ SV_PANEL_1D
,
126 enum sv_background
{ SV_BG_WHITE
,
130 #define SV_PANEL_FLIP 0x4
145 enum sv_panel_type type
;
148 sv_dim_list_t
*dimension_list
;
150 sv_obj_list_t
*objective_list
;
154 sv_panel_subtype_t
*subtype
;
155 sv_panel_internal_t
*private;
158 sv_panel_t
*sv_panel_new_1d (int number
,
165 sv_panel_t
*sv_panel_new_xy (int number
,
173 sv_panel_t
*sv_panel_new_2d (int number
,
179 int sv_panel_callback_recompute (sv_panel_t
*p
,
180 int (*callback
)(sv_panel_t
*p
,void *data
),
183 int sv_panel_set_resample (sv_panel_t
*p
,
187 int sv_panel_set_background (sv_panel_t
*p
,
188 enum sv_background bg
);
190 int sv_panel_set_axis (sv_panel_t
*p
,
194 int sv_panel_get_resample (sv_panel_t
*p
,
198 int sv_panel_get_background (sv_panel_t
*p
,
199 enum sv_background
*bg
);
201 sv_dim_t
*sv_panel_get_axis (sv_panel_t
*p
, char axis
);