Back to index

easystroke  0.5.5.1
stroke.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2009, Thomas Jaeger <ThJaeger@gmail.com>
00003  *
00004  * Permission to use, copy, modify, and/or distribute this software for any
00005  * purpose with or without fee is hereby granted, provided that the above
00006  * copyright notice and this permission notice appear in all copies.
00007  *
00008  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
00009  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
00010  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
00011  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
00012  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
00013  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
00014  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
00015  */
00016 #ifndef __STROKE_H__
00017 #define __STROKE_H__
00018 
00019 #ifdef  __cplusplus
00020 extern "C" {
00021 #endif
00022 
00023 struct _stroke_t;
00024 
00025 typedef struct _stroke_t stroke_t;
00026 
00027 stroke_t *stroke_alloc(int n);
00028 void stroke_add_point(stroke_t *stroke, double x, double y);
00029 void stroke_finish(stroke_t *stroke);
00030 void stroke_free(stroke_t *stroke);
00031 
00032 int stroke_get_size(const stroke_t *stroke);
00033 void stroke_get_point(const stroke_t *stroke, int n, double *x, double *y);
00034 double stroke_get_time(const stroke_t *stroke, int n);
00035 double stroke_get_angle(const stroke_t *stroke, int n);
00036 double stroke_angle_difference(const stroke_t *a, const stroke_t *b, int i, int j);
00037 
00038 double stroke_compare(const stroke_t *a, const stroke_t *b, int *path_x, int *path_y);
00039 
00040 extern const double stroke_infinity;
00041 
00042 #ifdef  __cplusplus
00043 }
00044 #endif
00045 #endif