00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __it_transform_h
00026 #define __it_transform_h
00027
00028 #include <it/types.h>
00029 #include <it/mat.h>
00030
00031
00032
00033
00034
00035
00036
00037 typedef struct _it_transform_ {
00038 it_extends (it_object_t);
00039
00040 Vec (*transform) (struct _it_transform_ * transform, Vec v);
00041 Vec (*itransform) (struct _it_transform_ * transform, Vec V);
00042
00043
00044
00045 void (*get_output_size) (struct _it_transform_ * transform,
00046 idx_t * input_size);
00047
00048
00049 void (*set_size) (struct _it_transform_ * transform, idx_t length);
00050
00051
00052 void (*get_size) (struct _it_transform_ * transform, idx_t * length);
00053
00054 } it_transform_t;
00055
00056 #define IT_TRANSFORM(x) IT_CAST(it_transform_t, x)
00057
00058 static inline it_instanciate (it_transform_t) {
00059 it_construct (it_object_t);
00060 it_set_magic (it_this, it_transform_t);
00061 return (it_this);
00062 }
00063 #define it_transform(t, v) __it_transform(IT_TRANSFORM(t), (Vec) v)
00064 static inline Vec __it_transform (it_transform_t * t, Vec v) {
00065 return (t->transform (t, v));
00066 }
00067
00068 #define it_itransform(t, V) __it_itransform(IT_TRANSFORM(t), (Vec) V)
00069 static inline Vec __it_itransform (it_transform_t * t, Vec V) {
00070 return (t->itransform (t, V));
00071 }
00072
00073 #define it_transform_get_output_size(t, l) \
00074 __it_transform_get_output_size(IT_TRANSFORM(t), l)
00075 static inline void __it_transform_get_output_size (it_transform_t * t,
00076 idx_t * l) {
00077 t->get_output_size (t, l);
00078 }
00079
00080 #define it_transform_set_size(t, l) __it_transform_set_size(IT_TRANSFORM(t), l)
00081 static inline void __it_transform_set_size (it_transform_t * t, idx_t l) {
00082 t->set_size (t, l);
00083 }
00084
00085 #define it_transform_get_size(t, l) __it_transform_get_size(IT_TRANSFORM(t), l)
00086 static inline void __it_transform_get_size (it_transform_t * t, idx_t * l) {
00087 t->get_size (t, l);
00088 }
00089
00090 #define it_transform_clear_size(t) it_transform_set_size(t, 0)
00091
00092
00093
00094 #endif