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_transform2D_h
00026 #define __it_transform2D_h
00027
00028 #include <it/types.h>
00029 #include <it/mat.h>
00030
00031
00032
00033
00034
00035
00036 typedef struct _it_transform2D_ {
00037 it_extends (it_object_t);
00038
00039 Mat (*transform) (struct _it_transform2D_ * transform, Mat image);
00040 Mat (*itransform) (struct _it_transform2D_ * transform, Mat image);
00041
00042
00043
00044 void (*get_output_size) (struct _it_transform2D_ * transform,
00045 idx_t * width, idx_t * height);
00046
00047
00048 void (*set_size) (struct _it_transform2D_ * transform, idx_t width,
00049 idx_t height);
00050
00051
00052 void (*get_size) (struct _it_transform2D_ * transform, idx_t * width,
00053 idx_t * height);
00054
00055 } it_transform2D_t;
00056
00057 #define IT_TRANSFORM2D(x) IT_CAST(it_transform2D_t, x)
00058
00059 static inline it_instanciate (it_transform2D_t) {
00060 it_construct (it_object_t);
00061 it_set_magic (it_this, it_transform2D_t);
00062 return (it_this);
00063 }
00064 #define it_transform2D(t, image) __it_transform2D(IT_TRANSFORM2D(t), (Mat) image)
00065 static inline Mat __it_transform2D (it_transform2D_t * t, Mat image) {
00066 return (t->transform (t, image));
00067 }
00068
00069 #define it_itransform2D(t, image) __it_itransform2D(IT_TRANSFORM2D(t), (Mat) image)
00070 static inline Mat __it_itransform2D (it_transform2D_t * t, Mat image) {
00071 return (t->itransform (t, image));
00072 }
00073
00074 #define it_transform2D_get_output_size(t, w, h) \
00075 __it_transform2D_get_output_size(IT_TRANSFORM2D(t, w, h))
00076 static inline void __it_transform2D_get_output_size (it_transform2D_t * t,
00077 idx_t * w, idx_t * h) {
00078 t->get_output_size (t, w, h);
00079 }
00080
00081 #define it_transform2D_set_size(t, w, h) \
00082 __it_transform2D_set_size(IT_TRANSFORM2D(t), w, h)
00083 static inline void __it_transform2D_set_size (it_transform2D_t * t,
00084 idx_t w, idx_t h) {
00085 t->set_size (t, w, h);
00086 }
00087
00088 #define it_transform2D_get_size(t, w, h) \
00089 __it_transform_get_size(IT_TRANSFORM2D(t), l)
00090 static inline void __it_transform2D_get_size (it_transform2D_t * t,
00091 idx_t * w, idx_t * h) {
00092 t->get_size (t, w, h);
00093 }
00094
00095 #define it_transform2D_clear_size(t) it_transform2D_set_size(t, 0, 0)
00096
00097
00098
00099
00100 #endif