1 /* base class for all correlation operations 2 */ 3 4 /* 5 6 Copyright (C) 1991-2005 The National Gallery 7 8 This library is free software; you can redistribute it and/or 9 modify it under the terms of the GNU Lesser General Public 10 License as published by the Free Software Foundation; either 11 version 2.1 of the License, or (at your option) any later version. 12 13 This library is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 Lesser General Public License for more details. 17 18 You should have received a copy of the GNU Lesser General Public 19 License along with this library; if not, write to the Free Software 20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 21 02110-1301 USA 22 23 */ 24 25 /* 26 27 These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk 28 29 */ 30 31 #ifndef VIPS_PCORRELATION_H 32 #define VIPS_PCORRELATION_H 33 34 #ifdef __cplusplus 35 extern "C" { 36 #endif /*__cplusplus*/ 37 38 #include <vips/vector.h> 39 40 #define VIPS_TYPE_CORRELATION (vips_correlation_get_type()) 41 #define VIPS_CORRELATION( obj ) \ 42 (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ 43 VIPS_TYPE_CORRELATION, VipsCorrelation )) 44 #define VIPS_CORRELATION_CLASS( klass ) \ 45 (G_TYPE_CHECK_CLASS_CAST( (klass), \ 46 VIPS_TYPE_CORRELATION, VipsCorrelationClass)) 47 #define VIPS_IS_CORRELATION( obj ) \ 48 (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_CORRELATION )) 49 #define VIPS_IS_CORRELATION_CLASS( klass ) \ 50 (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_CORRELATION )) 51 #define VIPS_CORRELATION_GET_CLASS( obj ) \ 52 (G_TYPE_INSTANCE_GET_CLASS( (obj), \ 53 VIPS_TYPE_CORRELATION, VipsCorrelationClass )) 54 55 typedef struct { 56 VipsOperation parent_instance; 57 58 /* Params. 59 */ 60 VipsImage *in; 61 VipsImage *ref; 62 VipsImage *out; 63 64 /* The two input images, upcast to the smallest common format. ref is 65 * a memory buffer. 66 */ 67 VipsImage *in_ready; 68 VipsImage *ref_ready; 69 70 } VipsCorrelation; 71 72 typedef struct { 73 VipsOperationClass parent_class; 74 75 /* For each upcast input format, what output format. 76 */ 77 const VipsBandFormat *format_table; 78 79 /* Run just before generate. The subclass can fill in some stuff. 80 */ 81 int (*pre_generate)( VipsCorrelation * ); 82 83 void (*correlation)( VipsCorrelation *, 84 VipsRegion *in, VipsRegion *out ); 85 86 } VipsCorrelationClass; 87 88 GType vips_correlation_get_type( void ); 89 90 #ifdef __cplusplus 91 } 92 #endif /*__cplusplus*/ 93 94 #endif /*VIPS_PCORRELATION_H*/ 95 96 97