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

« back to all changes in this revision

Viewing changes to libvips/arithmetic/relational.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:
110
110
}
111
111
 
112
112
#define RLOOP( TYPE, ROP ) { \
113
 
        TYPE *left = (TYPE *) in[0]; \
114
 
        TYPE *right = (TYPE *) in[1]; \
115
 
        VipsPel *q = (VipsPel *) out; \
 
113
        TYPE * restrict left = (TYPE *) in[0]; \
 
114
        TYPE * restrict right = (TYPE *) in[1]; \
 
115
        VipsPel * restrict q = (VipsPel *) out; \
116
116
        \
117
117
        for( x = 0; x < sz; x++ ) \
118
118
                q[x] = (left[x] ROP right[x]) ? 255 : 0; \
119
119
}
120
120
 
121
121
#define CLOOP( TYPE, COP ) { \
122
 
        TYPE *left = (TYPE *) in[0]; \
123
 
        TYPE *right = (TYPE *) in[1]; \
124
 
        VipsPel *q = (VipsPel *) out; \
 
122
        TYPE * restrict left = (TYPE *) in[0]; \
 
123
        TYPE * restrict right = (TYPE *) in[1]; \
 
124
        VipsPel * restrict q = (VipsPel *) out; \
125
125
        \
126
126
        for( x = 0; x < sz; x++ ) { \
127
127
                q[x] = COP( left[0], left[1], right[0], right[1]) ? 255 : 0; \
200
200
#define D VIPS_FORMAT_DOUBLE
201
201
#define DX VIPS_FORMAT_DPCOMPLEX
202
202
 
203
 
static const VipsBandFormat vips_bandfmt_relational[10] = {
 
203
static const VipsBandFormat vips_relational_format_table[10] = {
204
204
/* UC  C   US  S   UI  I   F   X   D   DX */
205
205
   UC, UC, UC, UC, UC, UC, UC, UC, UC, UC
206
206
};
220
220
                _( "a relational operation on a pair of images" );
221
221
        object_class->build = vips_relational_build;
222
222
 
223
 
        vips_arithmetic_set_format_table( aclass, vips_bandfmt_relational );
224
 
 
225
223
        aclass->process_line = vips_relational_buffer;
226
224
 
 
225
        vips_arithmetic_set_format_table( aclass, 
 
226
                vips_relational_format_table ); 
 
227
 
227
228
        VIPS_ARG_ENUM( class, "relational", 200, 
228
229
                _( "Operation" ), 
229
230
                _( "relational to perform" ),
268
269
 * one-band image by joining n copies of the one-band image together, and then
269
270
 * the two n-band images are operated upon.
270
271
 *
271
 
 * The two input images are cast up to the smallest common type (see table 
 
272
 * The two input images are cast up to the smallest common format (see table 
272
273
 * Smallest common format in 
273
274
 * <link linkend="VIPS-arithmetic">arithmetic</link>).
274
275
 *
478
479
}
479
480
 
480
481
#define RLOOPC( TYPE, OP ) { \
481
 
        TYPE *p = (TYPE *) in[0]; \
482
 
        TYPE *c = (TYPE *) uconst->c_ready; \
 
482
        TYPE * restrict p = (TYPE *) in[0]; \
 
483
        TYPE * restrict c = (TYPE *) uconst->c_ready; \
483
484
        \
484
485
        for( i = 0, x = 0; x < width; x++ ) \
485
486
                for( b = 0; b < bands; b++, i++ ) \
487
488
}
488
489
 
489
490
#define CLOOPC( TYPE, OP ) { \
490
 
        TYPE *p = (TYPE *) in[0]; \
 
491
        TYPE * restrict p = (TYPE *) in[0]; \
491
492
        \
492
493
        for( i = 0, x = 0; x < width; x++ ) { \
493
 
                TYPE *c = (TYPE *) uconst->c_ready; \
 
494
                TYPE * restrict c = (TYPE *) uconst->c_ready; \
494
495
                \
495
496
                for( b = 0; b < bands; b++, i++ ) { \
496
497
                        out[i] = OP( p[0], p[1], c[0], c[1]) ? 255 : 0; \
557
558
                _( "relational operations against a constant" );
558
559
        object_class->build = vips_relational_const_build;
559
560
 
560
 
        vips_arithmetic_set_format_table( aclass, vips_bandfmt_relational );
561
 
 
562
561
        aclass->process_line = vips_relational_const_buffer;
563
562
 
 
563
        vips_arithmetic_set_format_table( aclass, 
 
564
                vips_relational_format_table ); 
 
565
 
564
566
        VIPS_ARG_ENUM( class, "relational", 200, 
565
567
                _( "Operation" ), 
566
568
                _( "relational to perform" ),