~ubuntu-branches/ubuntu/trusty/vips/trusty

« back to all changes in this revision

Viewing changes to libvips/arithmetic/boolean.c

  • Committer: Package Import Robot
  • Author(s): Jay Berkenbilt
  • Date: 2014-03-29 12:29:29 UTC
  • mfrom: (1.1.21) (30.1.16 sid)
  • Revision ID: package-import@ubuntu.com-20140329122929-fvxnaann32ex0gzk
Tags: 7.38.5-2
Enable dh-autoreconf. (Closes: #742872)

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
}
109
109
 
110
110
#define LOOP( TYPE, OP ) { \
111
 
        TYPE *left = (TYPE *) in[0]; \
112
 
        TYPE *right = (TYPE *) in[1]; \
113
 
        TYPE *q = (TYPE *) out; \
 
111
        TYPE * restrict left = (TYPE *) in[0]; \
 
112
        TYPE * restrict right = (TYPE *) in[1]; \
 
113
        TYPE * restrict q = (TYPE *) out; \
114
114
        \
115
115
        for( x = 0; x < sz; x++ ) \
116
116
                q[x] = left[x] OP right[x]; \
117
117
}
118
118
 
119
119
#define FLOOP( TYPE, OP ) { \
120
 
        TYPE *left = (TYPE *) in[0]; \
121
 
        TYPE *right = (TYPE *) in[1]; \
122
 
        int *q = (int *) out; \
 
120
        TYPE * restrict left = (TYPE *) in[0]; \
 
121
        TYPE * restrict right = (TYPE *) in[1]; \
 
122
        int * restrict q = (int *) out; \
123
123
        \
124
124
        for( x = 0; x < sz; x++ ) \
125
125
                q[x] = ((int) left[x]) OP ((int) right[x]); \
191
191
 
192
192
/* Type conversions for boolean. 
193
193
 */
194
 
static const VipsBandFormat vips_bandfmt_boolean[10] = {
 
194
static const VipsBandFormat vips_boolean_format_table[10] = {
195
195
/* UC  C   US  S   UI  I   F   X   D   DX */
196
196
   UC, C,  US, S,  UI, I,  I,  I,  I,  I,
197
197
};
210
210
        object_class->description = _( "boolean operation on two images" );
211
211
        object_class->build = vips_boolean_build;
212
212
 
213
 
        vips_arithmetic_set_format_table( aclass, vips_bandfmt_boolean );
214
 
 
215
213
        aclass->process_line = vips_boolean_buffer;
216
214
 
 
215
        vips_arithmetic_set_format_table( aclass, vips_boolean_format_table ); 
 
216
 
217
217
        VIPS_ARG_ENUM( class, "boolean", 200, 
218
218
                _( "Operation" ), 
219
219
                _( "boolean to perform" ),
258
258
 * one-band image by joining n copies of the one-band image together, and then
259
259
 * the two n-band images are operated upon.
260
260
 *
261
 
 * The two input images are cast up to the smallest common type (see table 
 
261
 * The two input images are cast up to the smallest common format (see table 
262
262
 * Smallest common format in 
263
263
 * <link linkend="VIPS-arithmetic">arithmetic</link>).
264
264
 *
513
513
                _( "boolean operations against a constant" );
514
514
        object_class->build = vips_boolean_const_build;
515
515
 
516
 
        vips_arithmetic_set_format_table( aclass, vips_bandfmt_boolean );
517
 
 
518
516
        aclass->process_line = vips_boolean_const_buffer;
519
517
 
 
518
        vips_arithmetic_set_format_table( aclass, vips_boolean_format_table ); 
 
519
 
520
520
        VIPS_ARG_ENUM( class, "boolean", 200, 
521
521
                _( "Operation" ), 
522
522
                _( "boolean to perform" ),