1 | /* ----------------- */ |
---|
2 | /* --- nrbool1.c --- */ |
---|
3 | /* ----------------- */ |
---|
4 | |
---|
5 | /* |
---|
6 | * Copyright (c) 2000-2014, Lionel Lacassagne, All rights reserved |
---|
7 | * Univ Paris Sud XI, CNRS |
---|
8 | * |
---|
9 | * Distributed under the Boost Software License, Version 1.0 |
---|
10 | * see accompanying file LICENSE.txt or copy it at |
---|
11 | * http://www.boost.org/LICENSE_1_0.txt |
---|
12 | */ |
---|
13 | |
---|
14 | #include <stdio.h> |
---|
15 | #include <stddef.h> |
---|
16 | #include <stdlib.h> |
---|
17 | #include <math.h> // fabs |
---|
18 | |
---|
19 | #include "mypredef.h" |
---|
20 | #include "nrtype.h" |
---|
21 | #include "nrdef.h" |
---|
22 | #include "nrmacro.h" |
---|
23 | #include "nrkernel.h" |
---|
24 | |
---|
25 | #include "nrbool1.h" |
---|
26 | |
---|
27 | /* |
---|
28 | * ----------- |
---|
29 | * --- Not --- |
---|
30 | * ----------- |
---|
31 | */ |
---|
32 | |
---|
33 | /* -------------------------------------------------------------- */ |
---|
34 | IMAGE_EXPORT(void) not_bvector(byte *X, long ncl, long nch, byte *Y) |
---|
35 | /* -------------------------------------------------------------- */ |
---|
36 | { |
---|
37 | long j; |
---|
38 | |
---|
39 | for(j=ncl; j<=nch; j++) { |
---|
40 | Y[j] = ~X[j]; |
---|
41 | } |
---|
42 | } |
---|
43 | /* ------------------------------------------------------------------ */ |
---|
44 | IMAGE_EXPORT(void) not_si8vector(sint8 *X, long ncl, long nch, sint8 *Y) |
---|
45 | /* ------------------------------------------------------------------ */ |
---|
46 | { |
---|
47 | long j; |
---|
48 | |
---|
49 | for(j=ncl; j<=nch; j++) { |
---|
50 | Y[j] = ~X[j]; |
---|
51 | } |
---|
52 | } |
---|
53 | /* ------------------------------------------------------------------ */ |
---|
54 | IMAGE_EXPORT(void) not_ui8vector(uint8 *X, long ncl, long nch, uint8 *Y) |
---|
55 | /* ------------------------------------------------------------------ */ |
---|
56 | { |
---|
57 | long j; |
---|
58 | |
---|
59 | for(j=ncl; j<=nch; j++) { |
---|
60 | Y[j] = ~X[j]; |
---|
61 | } |
---|
62 | } |
---|
63 | /* --------------------------------------------------------------------- */ |
---|
64 | IMAGE_EXPORT(void) not_si16vector(sint16 *X, long ncl, long nch, sint16 *Y) |
---|
65 | /* --------------------------------------------------------------------- */ |
---|
66 | { |
---|
67 | long j; |
---|
68 | |
---|
69 | for(j=ncl; j<=nch; j++) { |
---|
70 | Y[j] = ~X[j]; |
---|
71 | } |
---|
72 | } |
---|
73 | /* --------------------------------------------------------------------- */ |
---|
74 | IMAGE_EXPORT(void) not_ui16vector(uint16 *X, long ncl, long nch, uint16 *Y) |
---|
75 | /* --------------------------------------------------------------------- */ |
---|
76 | { |
---|
77 | long j; |
---|
78 | |
---|
79 | for(j=ncl; j<=nch; j++) { |
---|
80 | Y[j] = ~X[j]; |
---|
81 | } |
---|
82 | } |
---|
83 | /* --------------------------------------------------------------------- */ |
---|
84 | IMAGE_EXPORT(void) not_si32vector(sint32 *X, long ncl, long nch, sint32 *Y) |
---|
85 | /* --------------------------------------------------------------------- */ |
---|
86 | { |
---|
87 | long j; |
---|
88 | |
---|
89 | for(j=ncl; j<=nch; j++) { |
---|
90 | Y[j] = ~X[j]; |
---|
91 | } |
---|
92 | } |
---|
93 | /* --------------------------------------------------------------------- */ |
---|
94 | IMAGE_EXPORT(void) not_ui32vector(uint32 *X, long ncl, long nch, uint32 *Y) |
---|
95 | /* --------------------------------------------------------------------- */ |
---|
96 | { |
---|
97 | long j; |
---|
98 | |
---|
99 | for(j=ncl; j<=nch; j++) { |
---|
100 | Y[j] = ~X[j]; |
---|
101 | } |
---|
102 | } |
---|
103 | /* --------------------------------------------------------------------- */ |
---|
104 | IMAGE_EXPORT(void) not_si64vector(sint64 *X, long ncl, long nch, sint64 *Y) |
---|
105 | /* --------------------------------------------------------------------- */ |
---|
106 | { |
---|
107 | long j; |
---|
108 | |
---|
109 | for(j=ncl; j<=nch; j++) { |
---|
110 | Y[j] = ~X[j]; |
---|
111 | } |
---|
112 | } |
---|
113 | /* --------------------------------------------------------------------- */ |
---|
114 | IMAGE_EXPORT(void) not_ui64vector(uint64 *X, long ncl, long nch, uint64 *Y) |
---|
115 | /* --------------------------------------------------------------------- */ |
---|
116 | { |
---|
117 | long j; |
---|
118 | |
---|
119 | for(j=ncl; j<=nch; j++) { |
---|
120 | Y[j] = ~X[j]; |
---|
121 | } |
---|
122 | } |
---|
123 | /* ----------------------------------------------------------------- */ |
---|
124 | IMAGE_EXPORT(void) not_rgb8vector(rgb8 *X, long ncl, long nch, rgb8 *Y) |
---|
125 | /* ----------------------------------------------------------------- */ |
---|
126 | { |
---|
127 | long j; |
---|
128 | rgb8 x, y; |
---|
129 | |
---|
130 | for(j=ncl; j<=nch; j++) { |
---|
131 | x = X[j]; |
---|
132 | RGB8_NOT(x,y); |
---|
133 | Y[j] = y; |
---|
134 | } |
---|
135 | } |
---|
136 | /* -------------------------------------------------------------------- */ |
---|
137 | IMAGE_EXPORT(void) not_rgbx8vector(rgbx8 *X, long ncl, long nch, rgbx8 *Y) |
---|
138 | /* -------------------------------------------------------------------- */ |
---|
139 | { |
---|
140 | long j; |
---|
141 | rgbx8 x, y; |
---|
142 | |
---|
143 | for(j=ncl; j<=nch; j++) { |
---|
144 | x = X[j]; |
---|
145 | RGBX8_NOT(x,y); |
---|
146 | Y[j] = y; |
---|
147 | } |
---|
148 | } |
---|
149 | /* |
---|
150 | * ----------- |
---|
151 | * --- Or --- |
---|
152 | * ----------- |
---|
153 | */ |
---|
154 | |
---|
155 | /* ---------------------------------------------------------------------- */ |
---|
156 | IMAGE_EXPORT(void) or_bvector(byte *X, long ncl, long nch, byte *Y, byte *Z) |
---|
157 | /* ---------------------------------------------------------------------- */ |
---|
158 | { |
---|
159 | long j; |
---|
160 | |
---|
161 | for(j=ncl; j<=nch; j++) { |
---|
162 | Z[j] = X[j] | Y[j]; |
---|
163 | } |
---|
164 | } |
---|
165 | /* --------------------------------------------------------------------------- */ |
---|
166 | IMAGE_EXPORT(void) or_si8vector(sint8 *X, long ncl, long nch, sint8 *Y, sint8 *Z) |
---|
167 | /* --------------------------------------------------------------------------- */ |
---|
168 | { |
---|
169 | long j; |
---|
170 | |
---|
171 | for(j=ncl; j<=nch; j++) { |
---|
172 | Z[j] = X[j] | Y[j]; |
---|
173 | } |
---|
174 | } |
---|
175 | /* --------------------------------------------------------------------------- */ |
---|
176 | IMAGE_EXPORT(void) or_ui8vector(uint8 *X, long ncl, long nch, uint8 *Y, uint8 *Z) |
---|
177 | /* --------------------------------------------------------------------------- */ |
---|
178 | { |
---|
179 | long j; |
---|
180 | |
---|
181 | for(j=ncl; j<=nch; j++) { |
---|
182 | Z[j] = X[j] | Y[j]; |
---|
183 | } |
---|
184 | } |
---|
185 | /* ------------------------------------------------------------------------------- */ |
---|
186 | IMAGE_EXPORT(void) or_si16vector(sint16 *X, long ncl, long nch, sint16 *Y, sint16 *Z) |
---|
187 | /* ------------------------------------------------------------------------------- */ |
---|
188 | { |
---|
189 | long j; |
---|
190 | |
---|
191 | for(j=ncl; j<=nch; j++) { |
---|
192 | Z[j] = X[j] | Y[j]; |
---|
193 | } |
---|
194 | } |
---|
195 | /* ------------------------------------------------------------------------------- */ |
---|
196 | IMAGE_EXPORT(void) or_ui16vector(uint16 *X, long ncl, long nch, uint16 *Y, uint16 *Z) |
---|
197 | /* ------------------------------------------------------------------------------- */ |
---|
198 | { |
---|
199 | long j; |
---|
200 | |
---|
201 | for(j=ncl; j<=nch; j++) { |
---|
202 | Z[j] = X[j] | Y[j]; |
---|
203 | } |
---|
204 | } |
---|
205 | /* ------------------------------------------------------------------------------- */ |
---|
206 | IMAGE_EXPORT(void) or_si32vector(sint32 *X, long ncl, long nch, sint32 *Y, sint32 *Z) |
---|
207 | /* ------------------------------------------------------------------------------- */ |
---|
208 | { |
---|
209 | long j; |
---|
210 | |
---|
211 | for(j=ncl; j<=nch; j++) { |
---|
212 | Z[j] = X[j] | Y[j]; |
---|
213 | } |
---|
214 | } |
---|
215 | /* ------------------------------------------------------------------------------- */ |
---|
216 | IMAGE_EXPORT(void) or_ui32vector(uint32 *X, long ncl, long nch, uint32 *Y, uint32 *Z) |
---|
217 | /* ------------------------------------------------------------------------------- */ |
---|
218 | { |
---|
219 | long j; |
---|
220 | |
---|
221 | for(j=ncl; j<=nch; j++) { |
---|
222 | Z[j] = X[j] | Y[j]; |
---|
223 | } |
---|
224 | } |
---|
225 | /* ------------------------------------------------------------------------------- */ |
---|
226 | IMAGE_EXPORT(void) or_si64vector(sint64 *X, long ncl, long nch, sint64 *Y, sint64 *Z) |
---|
227 | /* ------------------------------------------------------------------------------- */ |
---|
228 | { |
---|
229 | long j; |
---|
230 | |
---|
231 | for(j=ncl; j<=nch; j++) { |
---|
232 | Z[j] = X[j] | Y[j]; |
---|
233 | } |
---|
234 | } |
---|
235 | /* ------------------------------------------------------------------------------- */ |
---|
236 | IMAGE_EXPORT(void) or_ui64vector(uint64 *X, long ncl, long nch, uint64 *Y, uint64 *Z) |
---|
237 | /* ------------------------------------------------------------------------------- */ |
---|
238 | { |
---|
239 | long j; |
---|
240 | |
---|
241 | for(j=ncl; j<=nch; j++) { |
---|
242 | Z[j] = X[j] | Y[j]; |
---|
243 | } |
---|
244 | } |
---|
245 | /* ------------------------------------------------------------------------- */ |
---|
246 | IMAGE_EXPORT(void) or_rgb8vector(rgb8 *X, long ncl, long nch, rgb8 *Y, rgb8 *Z) |
---|
247 | /* ------------------------------------------------------------------------- */ |
---|
248 | { |
---|
249 | long j; |
---|
250 | rgb8 x, y, z; |
---|
251 | |
---|
252 | for(j=ncl; j<=nch; j++) { |
---|
253 | x = X[j]; |
---|
254 | y = Y[j]; |
---|
255 | RGB8_OR(x,y,z); |
---|
256 | Z[j] = z; |
---|
257 | } |
---|
258 | } |
---|
259 | /* ----------------------------------------------------------------------------- */ |
---|
260 | IMAGE_EXPORT(void) or_rgbx8vector(rgbx8 *X, long ncl, long nch, rgbx8 *Y, rgbx8 *Z) |
---|
261 | /* ----------------------------------------------------------------------------- */ |
---|
262 | { |
---|
263 | long j; |
---|
264 | rgbx8 x, y, z; |
---|
265 | |
---|
266 | for(j=ncl; j<=nch; j++) { |
---|
267 | x = X[j]; |
---|
268 | y = Y[j]; |
---|
269 | RGBX8_OR(x,y,z); |
---|
270 | Z[j] = z; |
---|
271 | } |
---|
272 | } |
---|
273 | /* ---------------------------------------------------------------------- */ |
---|
274 | IMAGE_EXPORT(void) orc_bvector(byte *X, long ncl, long nch, byte y, byte *Z) |
---|
275 | /* ---------------------------------------------------------------------- */ |
---|
276 | { |
---|
277 | long j; |
---|
278 | |
---|
279 | for(j=ncl; j<=nch; j++) { |
---|
280 | Z[j] = X[j] | y; |
---|
281 | } |
---|
282 | } |
---|
283 | /* --------------------------------------------------------------------------- */ |
---|
284 | IMAGE_EXPORT(void) orc_si8vector(sint8 *X, long ncl, long nch, sint8 y, sint8 *Z) |
---|
285 | /* --------------------------------------------------------------------------- */ |
---|
286 | { |
---|
287 | long j; |
---|
288 | |
---|
289 | for(j=ncl; j<=nch; j++) { |
---|
290 | Z[j] = X[j] | y; |
---|
291 | } |
---|
292 | } |
---|
293 | /* --------------------------------------------------------------------------- */ |
---|
294 | IMAGE_EXPORT(void) orc_ui8vector(uint8 *X, long ncl, long nch, uint8 y, uint8 *Z) |
---|
295 | /* --------------------------------------------------------------------------- */ |
---|
296 | { |
---|
297 | long j; |
---|
298 | |
---|
299 | for(j=ncl; j<=nch; j++) { |
---|
300 | Z[j] = X[j] | y; |
---|
301 | } |
---|
302 | } |
---|
303 | /* ------------------------------------------------------------------------------- */ |
---|
304 | IMAGE_EXPORT(void) orc_si16vector(sint16 *X, long ncl, long nch, sint16 y, sint16 *Z) |
---|
305 | /* ------------------------------------------------------------------------------- */ |
---|
306 | { |
---|
307 | long j; |
---|
308 | |
---|
309 | for(j=ncl; j<=nch; j++) { |
---|
310 | Z[j] = X[j] | y; |
---|
311 | } |
---|
312 | } |
---|
313 | /* ------------------------------------------------------------------------------- */ |
---|
314 | IMAGE_EXPORT(void) orc_ui16vector(uint16 *X, long ncl, long nch, uint16 y, uint16 *Z) |
---|
315 | /* ------------------------------------------------------------------------------- */ |
---|
316 | { |
---|
317 | long j; |
---|
318 | |
---|
319 | for(j=ncl; j<=nch; j++) { |
---|
320 | Z[j] = X[j] | y; |
---|
321 | } |
---|
322 | } |
---|
323 | /* ------------------------------------------------------------------------------- */ |
---|
324 | IMAGE_EXPORT(void) orc_si32vector(sint32 *X, long ncl, long nch, sint32 y, sint32 *Z) |
---|
325 | /* ------------------------------------------------------------------------------- */ |
---|
326 | { |
---|
327 | long j; |
---|
328 | |
---|
329 | for(j=ncl; j<=nch; j++) { |
---|
330 | Z[j] = X[j] | y; |
---|
331 | } |
---|
332 | } |
---|
333 | /* ------------------------------------------------------------------------------- */ |
---|
334 | IMAGE_EXPORT(void) orc_ui32vector(uint32 *X, long ncl, long nch, uint32 y, uint32 *Z) |
---|
335 | /* ------------------------------------------------------------------------------- */ |
---|
336 | { |
---|
337 | long j; |
---|
338 | |
---|
339 | for(j=ncl; j<=nch; j++) { |
---|
340 | Z[j] = X[j] | y; |
---|
341 | } |
---|
342 | } |
---|
343 | /* ------------------------------------------------------------------------------- */ |
---|
344 | IMAGE_EXPORT(void) orc_si64vector(sint64 *X, long ncl, long nch, sint64 y, sint64 *Z) |
---|
345 | /* ------------------------------------------------------------------------------- */ |
---|
346 | { |
---|
347 | long j; |
---|
348 | |
---|
349 | for(j=ncl; j<=nch; j++) { |
---|
350 | Z[j] = X[j] | y; |
---|
351 | } |
---|
352 | } |
---|
353 | /* ------------------------------------------------------------------------------- */ |
---|
354 | IMAGE_EXPORT(void) orc_ui64vector(uint64 *X, long ncl, long nch, uint64 y, uint64 *Z) |
---|
355 | /* ------------------------------------------------------------------------------- */ |
---|
356 | { |
---|
357 | long j; |
---|
358 | |
---|
359 | for(j=ncl; j<=nch; j++) { |
---|
360 | Z[j] = X[j] | y; |
---|
361 | } |
---|
362 | } |
---|
363 | /* ------------------------------------------------------------------------- */ |
---|
364 | IMAGE_EXPORT(void) orc_rgb8vector(rgb8 *X, long ncl, long nch, rgb8 y, rgb8 *Z) |
---|
365 | /* ------------------------------------------------------------------------- */ |
---|
366 | { |
---|
367 | long j; |
---|
368 | rgb8 x, z; |
---|
369 | |
---|
370 | for(j=ncl; j<=nch; j++) { |
---|
371 | x = X[j]; |
---|
372 | RGB8_OR(x,y,z); |
---|
373 | Z[j] = z; |
---|
374 | } |
---|
375 | } |
---|
376 | /* ----------------------------------------------------------------------------- */ |
---|
377 | IMAGE_EXPORT(void) orc_rgbx8vector(rgbx8 *X, long ncl, long nch, rgbx8 y, rgbx8 *Z) |
---|
378 | /* ----------------------------------------------------------------------------- */ |
---|
379 | { |
---|
380 | long j; |
---|
381 | rgbx8 x, z; |
---|
382 | |
---|
383 | for(j=ncl; j<=nch; j++) { |
---|
384 | x = X[j]; |
---|
385 | RGBX8_OR(x,y,z); |
---|
386 | Z[j] = z; |
---|
387 | } |
---|
388 | } |
---|
389 | /* |
---|
390 | * ----------- |
---|
391 | * --- XOR --- |
---|
392 | * ----------- |
---|
393 | */ |
---|
394 | /* ----------------------------------------------------------------------- */ |
---|
395 | IMAGE_EXPORT(void) xor_bvector(byte *X, long ncl, long nch, byte *Y, byte *Z) |
---|
396 | /* ----------------------------------------------------------------------- */ |
---|
397 | { |
---|
398 | long j; |
---|
399 | |
---|
400 | for(j=ncl; j<=nch; j++) { |
---|
401 | Z[j] = X[j] ^ Y[j]; |
---|
402 | } |
---|
403 | } |
---|
404 | /* ---------------------------------------------------------------------------- */ |
---|
405 | IMAGE_EXPORT(void) xor_si8vector(sint8 *X, long ncl, long nch, sint8 *Y, sint8 *Z) |
---|
406 | /* ---------------------------------------------------------------------------- */ |
---|
407 | { |
---|
408 | long j; |
---|
409 | |
---|
410 | for(j=ncl; j<=nch; j++) { |
---|
411 | Z[j] = X[j] ^ Y[j]; |
---|
412 | } |
---|
413 | } |
---|
414 | /* ---------------------------------------------------------------------------- */ |
---|
415 | IMAGE_EXPORT(void) xor_ui8vector(uint8 *X, long ncl, long nch, uint8 *Y, uint8 *Z) |
---|
416 | /* ---------------------------------------------------------------------------- */ |
---|
417 | { |
---|
418 | long j; |
---|
419 | |
---|
420 | for(j=ncl; j<=nch; j++) { |
---|
421 | Z[j] = X[j] ^ Y[j]; |
---|
422 | } |
---|
423 | } |
---|
424 | /* -------------------------------------------------------------------------------- */ |
---|
425 | IMAGE_EXPORT(void) xor_si16vector(sint16 *X, long ncl, long nch, sint16 *Y, sint16 *Z) |
---|
426 | /* -------------------------------------------------------------------------------- */ |
---|
427 | { |
---|
428 | long j; |
---|
429 | |
---|
430 | for(j=ncl; j<=nch; j++) { |
---|
431 | Z[j] = X[j] ^ Y[j]; |
---|
432 | } |
---|
433 | } |
---|
434 | /* -------------------------------------------------------------------------------- */ |
---|
435 | IMAGE_EXPORT(void) xor_ui16vector(uint16 *X, long ncl, long nch, uint16 *Y, uint16 *Z) |
---|
436 | /* -------------------------------------------------------------------------------- */ |
---|
437 | { |
---|
438 | long j; |
---|
439 | |
---|
440 | for(j=ncl; j<=nch; j++) { |
---|
441 | Z[j] = X[j] ^ Y[j]; |
---|
442 | } |
---|
443 | } |
---|
444 | /* -------------------------------------------------------------------------------- */ |
---|
445 | IMAGE_EXPORT(void) xor_si32vector(sint32 *X, long ncl, long nch, sint32 *Y, sint32 *Z) |
---|
446 | /* -------------------------------------------------------------------------------- */ |
---|
447 | { |
---|
448 | long j; |
---|
449 | |
---|
450 | for(j=ncl; j<=nch; j++) { |
---|
451 | Z[j] = X[j] ^ Y[j]; |
---|
452 | } |
---|
453 | } |
---|
454 | /* -------------------------------------------------------------------------------- */ |
---|
455 | IMAGE_EXPORT(void) xor_ui32vector(uint32 *X, long ncl, long nch, uint32 *Y, uint32 *Z) |
---|
456 | /* -------------------------------------------------------------------------------- */ |
---|
457 | { |
---|
458 | long j; |
---|
459 | |
---|
460 | for(j=ncl; j<=nch; j++) { |
---|
461 | Z[j] = X[j] ^ Y[j]; |
---|
462 | } |
---|
463 | } |
---|
464 | /* -------------------------------------------------------------------------------- */ |
---|
465 | IMAGE_EXPORT(void) xor_si64vector(sint64 *X, long ncl, long nch, sint64 *Y, sint64 *Z) |
---|
466 | /* -------------------------------------------------------------------------------- */ |
---|
467 | { |
---|
468 | long j; |
---|
469 | |
---|
470 | for(j=ncl; j<=nch; j++) { |
---|
471 | Z[j] = X[j] ^ Y[j]; |
---|
472 | } |
---|
473 | } |
---|
474 | /* -------------------------------------------------------------------------------- */ |
---|
475 | IMAGE_EXPORT(void) xor_ui64vector(uint64 *X, long ncl, long nch, uint64 *Y, uint64 *Z) |
---|
476 | /* -------------------------------------------------------------------------------- */ |
---|
477 | { |
---|
478 | long j; |
---|
479 | |
---|
480 | for(j=ncl; j<=nch; j++) { |
---|
481 | Z[j] = X[j] ^ Y[j]; |
---|
482 | } |
---|
483 | } |
---|
484 | /* -------------------------------------------------------------------------- */ |
---|
485 | IMAGE_EXPORT(void) xor_rgb8vector(rgb8 *X, long ncl, long nch, rgb8 *Y, rgb8 *Z) |
---|
486 | /* -------------------------------------------------------------------------- */ |
---|
487 | { |
---|
488 | long j; |
---|
489 | rgb8 x, y, z; |
---|
490 | |
---|
491 | for(j=ncl; j<=nch; j++) { |
---|
492 | x = X[j]; |
---|
493 | y = Y[j]; |
---|
494 | RGB8_XOR(x,y,z); |
---|
495 | Z[j] = z; |
---|
496 | } |
---|
497 | } |
---|
498 | /* ------------------------------------------------------------------------------ */ |
---|
499 | IMAGE_EXPORT(void) xor_rgbx8vector(rgbx8 *X, long ncl, long nch, rgbx8 *Y, rgbx8 *Z) |
---|
500 | /* ------------------------------------------------------------------------------ */ |
---|
501 | { |
---|
502 | long j; |
---|
503 | rgbx8 x, y, z; |
---|
504 | |
---|
505 | for(j=ncl; j<=nch; j++) { |
---|
506 | x = X[j]; |
---|
507 | y = Y[j]; |
---|
508 | RGBX8_XOR(x,y,z); |
---|
509 | Z[j] = z; |
---|
510 | } |
---|
511 | } |
---|
512 | /* ----------------------------------------------------------------------- */ |
---|
513 | IMAGE_EXPORT(void) xorc_bvector(byte *X, long ncl, long nch, byte y, byte *Z) |
---|
514 | /* ----------------------------------------------------------------------- */ |
---|
515 | { |
---|
516 | long j; |
---|
517 | |
---|
518 | for(j=ncl; j<=nch; j++) { |
---|
519 | Z[j] = X[j] ^ y; |
---|
520 | } |
---|
521 | } |
---|
522 | /* ---------------------------------------------------------------------------- */ |
---|
523 | IMAGE_EXPORT(void) xorc_si8vector(sint8 *X, long ncl, long nch, sint8 y, sint8 *Z) |
---|
524 | /* ---------------------------------------------------------------------------- */ |
---|
525 | { |
---|
526 | long j; |
---|
527 | |
---|
528 | for(j=ncl; j<=nch; j++) { |
---|
529 | Z[j] = X[j] ^ y; |
---|
530 | } |
---|
531 | } |
---|
532 | /* ---------------------------------------------------------------------------- */ |
---|
533 | IMAGE_EXPORT(void) xorc_ui8vector(uint8 *X, long ncl, long nch, uint8 y, uint8 *Z) |
---|
534 | /* ---------------------------------------------------------------------------- */ |
---|
535 | { |
---|
536 | long j; |
---|
537 | |
---|
538 | for(j=ncl; j<=nch; j++) { |
---|
539 | Z[j] = X[j] ^ y; |
---|
540 | } |
---|
541 | } |
---|
542 | /* -------------------------------------------------------------------------------- */ |
---|
543 | IMAGE_EXPORT(void) xorc_si16vector(sint16 *X, long ncl, long nch, sint16 y, sint16 *Z) |
---|
544 | /* -------------------------------------------------------------------------------- */ |
---|
545 | { |
---|
546 | long j; |
---|
547 | |
---|
548 | for(j=ncl; j<=nch; j++) { |
---|
549 | Z[j] = X[j] ^ y; |
---|
550 | } |
---|
551 | } |
---|
552 | /* -------------------------------------------------------------------------------- */ |
---|
553 | IMAGE_EXPORT(void) xorc_ui16vector(uint16 *X, long ncl, long nch, uint16 y, uint16 *Z) |
---|
554 | /* -------------------------------------------------------------------------------- */ |
---|
555 | { |
---|
556 | long j; |
---|
557 | |
---|
558 | for(j=ncl; j<=nch; j++) { |
---|
559 | Z[j] = X[j] ^ y; |
---|
560 | } |
---|
561 | } |
---|
562 | /* -------------------------------------------------------------------------------- */ |
---|
563 | IMAGE_EXPORT(void) xorc_si32vector(sint32 *X, long ncl, long nch, sint32 y, sint32 *Z) |
---|
564 | /* -------------------------------------------------------------------------------- */ |
---|
565 | { |
---|
566 | long j; |
---|
567 | |
---|
568 | for(j=ncl; j<=nch; j++) { |
---|
569 | Z[j] = X[j] ^ y; |
---|
570 | } |
---|
571 | } |
---|
572 | /* -------------------------------------------------------------------------------- */ |
---|
573 | IMAGE_EXPORT(void) xorc_ui32vector(uint32 *X, long ncl, long nch, uint32 y, uint32 *Z) |
---|
574 | /* -------------------------------------------------------------------------------- */ |
---|
575 | { |
---|
576 | long j; |
---|
577 | |
---|
578 | for(j=ncl; j<=nch; j++) { |
---|
579 | Z[j] = X[j] ^ y; |
---|
580 | } |
---|
581 | } |
---|
582 | /* -------------------------------------------------------------------------------- */ |
---|
583 | IMAGE_EXPORT(void) xorc_si64vector(sint64 *X, long ncl, long nch, sint64 y, sint64 *Z) |
---|
584 | /* -------------------------------------------------------------------------------- */ |
---|
585 | { |
---|
586 | long j; |
---|
587 | |
---|
588 | for(j=ncl; j<=nch; j++) { |
---|
589 | Z[j] = X[j] ^ y; |
---|
590 | } |
---|
591 | } |
---|
592 | /* -------------------------------------------------------------------------------- */ |
---|
593 | IMAGE_EXPORT(void) xorc_ui64vector(uint64 *X, long ncl, long nch, uint64 y, uint64 *Z) |
---|
594 | /* -------------------------------------------------------------------------------- */ |
---|
595 | { |
---|
596 | long j; |
---|
597 | |
---|
598 | for(j=ncl; j<=nch; j++) { |
---|
599 | Z[j] = X[j] ^ y; |
---|
600 | } |
---|
601 | } |
---|
602 | /* -------------------------------------------------------------------------- */ |
---|
603 | IMAGE_EXPORT(void) xorc_rgb8vector(rgb8 *X, long ncl, long nch, rgb8 y, rgb8 *Z) |
---|
604 | /* -------------------------------------------------------------------------- */ |
---|
605 | { |
---|
606 | long j; |
---|
607 | rgb8 x, z; |
---|
608 | |
---|
609 | for(j=ncl; j<=nch; j++) { |
---|
610 | x = X[j]; |
---|
611 | RGB8_XOR(x,y,z); |
---|
612 | Z[j] = z; |
---|
613 | } |
---|
614 | } |
---|
615 | /* ------------------------------------------------------------------------------ */ |
---|
616 | IMAGE_EXPORT(void) xorc_rgbx8vector(rgbx8 *X, long ncl, long nch, rgbx8 y, rgbx8 *Z) |
---|
617 | /* ------------------------------------------------------------------------------ */ |
---|
618 | { |
---|
619 | long j; |
---|
620 | rgbx8 x, z; |
---|
621 | |
---|
622 | for(j=ncl; j<=nch; j++) { |
---|
623 | x = X[j]; |
---|
624 | RGBX8_XOR(x,y,z); |
---|
625 | Z[j] = z; |
---|
626 | } |
---|
627 | } |
---|
628 | /* |
---|
629 | * ----------- |
---|
630 | * --- AND --- |
---|
631 | * ----------- |
---|
632 | */ |
---|
633 | /* ----------------------------------------------------------------------- */ |
---|
634 | IMAGE_EXPORT(void) and_bvector(byte *X, long ncl, long nch, byte *Y, byte *Z) |
---|
635 | /* ----------------------------------------------------------------------- */ |
---|
636 | { |
---|
637 | long j; |
---|
638 | |
---|
639 | for(j=ncl; j<=nch; j++) { |
---|
640 | Z[j] = X[j] & Y[j]; |
---|
641 | } |
---|
642 | } |
---|
643 | /* ---------------------------------------------------------------------------- */ |
---|
644 | IMAGE_EXPORT(void) and_si8vector(sint8 *X, long ncl, long nch, sint8 *Y, sint8 *Z) |
---|
645 | /* ---------------------------------------------------------------------------- */ |
---|
646 | { |
---|
647 | long j; |
---|
648 | |
---|
649 | for(j=ncl; j<=nch; j++) { |
---|
650 | Z[j] = X[j] & Y[j]; |
---|
651 | } |
---|
652 | } |
---|
653 | /* ---------------------------------------------------------------------------- */ |
---|
654 | IMAGE_EXPORT(void) and_ui8vector(uint8 *X, long ncl, long nch, uint8 *Y, uint8 *Z) |
---|
655 | /* ---------------------------------------------------------------------------- */ |
---|
656 | { |
---|
657 | long j; |
---|
658 | |
---|
659 | for(j=ncl; j<=nch; j++) { |
---|
660 | Z[j] = X[j] & Y[j]; |
---|
661 | } |
---|
662 | } |
---|
663 | /* -------------------------------------------------------------------------------- */ |
---|
664 | IMAGE_EXPORT(void) and_si16vector(sint16 *X, long ncl, long nch, sint16 *Y, sint16 *Z) |
---|
665 | /* -------------------------------------------------------------------------------- */ |
---|
666 | { |
---|
667 | long j; |
---|
668 | |
---|
669 | for(j=ncl; j<=nch; j++) { |
---|
670 | Z[j] = X[j] & Y[j]; |
---|
671 | } |
---|
672 | } |
---|
673 | /* -------------------------------------------------------------------------------- */ |
---|
674 | IMAGE_EXPORT(void) and_ui16vector(uint16 *X, long ncl, long nch, uint16 *Y, uint16 *Z) |
---|
675 | /* -------------------------------------------------------------------------------- */ |
---|
676 | { |
---|
677 | long j; |
---|
678 | |
---|
679 | for(j=ncl; j<=nch; j++) { |
---|
680 | Z[j] = X[j] & Y[j]; |
---|
681 | } |
---|
682 | } |
---|
683 | /* -------------------------------------------------------------------------------- */ |
---|
684 | IMAGE_EXPORT(void) and_si32vector(sint32 *X, long ncl, long nch, sint32 *Y, sint32 *Z) |
---|
685 | /* -------------------------------------------------------------------------------- */ |
---|
686 | { |
---|
687 | long j; |
---|
688 | |
---|
689 | for(j=ncl; j<=nch; j++) { |
---|
690 | Z[j] = X[j] & Y[j]; |
---|
691 | } |
---|
692 | } |
---|
693 | /* -------------------------------------------------------------------------------- */ |
---|
694 | IMAGE_EXPORT(void) and_ui32vector(uint32 *X, long ncl, long nch, uint32 *Y, uint32 *Z) |
---|
695 | /* -------------------------------------------------------------------------------- */ |
---|
696 | { |
---|
697 | long j; |
---|
698 | |
---|
699 | for(j=ncl; j<=nch; j++) { |
---|
700 | Z[j] = X[j] & Y[j]; |
---|
701 | } |
---|
702 | } |
---|
703 | /* -------------------------------------------------------------------------------- */ |
---|
704 | IMAGE_EXPORT(void) and_si64vector(sint64 *X, long ncl, long nch, sint64 *Y, sint64 *Z) |
---|
705 | /* -------------------------------------------------------------------------------- */ |
---|
706 | { |
---|
707 | long j; |
---|
708 | |
---|
709 | for(j=ncl; j<=nch; j++) { |
---|
710 | Z[j] = X[j] & Y[j]; |
---|
711 | } |
---|
712 | } |
---|
713 | /* -------------------------------------------------------------------------------- */ |
---|
714 | IMAGE_EXPORT(void) and_ui64vector(uint64 *X, long ncl, long nch, uint64 *Y, uint64 *Z) |
---|
715 | /* -------------------------------------------------------------------------------- */ |
---|
716 | { |
---|
717 | long j; |
---|
718 | |
---|
719 | for(j=ncl; j<=nch; j++) { |
---|
720 | Z[j] = X[j] & Y[j]; |
---|
721 | } |
---|
722 | } |
---|
723 | /* -------------------------------------------------------------------------- */ |
---|
724 | IMAGE_EXPORT(void) and_rgb8vector(rgb8 *X, long ncl, long nch, rgb8 *Y, rgb8 *Z) |
---|
725 | /* -------------------------------------------------------------------------- */ |
---|
726 | { |
---|
727 | long j; |
---|
728 | rgb8 x, y, z; |
---|
729 | |
---|
730 | for(j=ncl; j<=nch; j++) { |
---|
731 | x = X[j]; |
---|
732 | y = Y[j]; |
---|
733 | RGB8_AND(x,y,z); |
---|
734 | Z[j] = z; |
---|
735 | } |
---|
736 | } |
---|
737 | /* ------------------------------------------------------------------------------ */ |
---|
738 | IMAGE_EXPORT(void) and_rgbx8vector(rgbx8 *X, long ncl, long nch, rgbx8 *Y, rgbx8 *Z) |
---|
739 | /* ------------------------------------------------------------------------------ */ |
---|
740 | { |
---|
741 | long j; |
---|
742 | rgbx8 x, y, z; |
---|
743 | |
---|
744 | for(j=ncl; j<=nch; j++) { |
---|
745 | x = X[j]; |
---|
746 | y = Y[j]; |
---|
747 | RGBX8_AND(x,y,z); |
---|
748 | Z[j] = z; |
---|
749 | } |
---|
750 | } |
---|
751 | /* ----------------------------------------------------------------------- */ |
---|
752 | IMAGE_EXPORT(void) andc_bvector(byte *X, long ncl, long nch, byte y, byte *Z) |
---|
753 | /* ----------------------------------------------------------------------- */ |
---|
754 | { |
---|
755 | long j; |
---|
756 | |
---|
757 | for(j=ncl; j<=nch; j++) { |
---|
758 | Z[j] = X[j] & y; |
---|
759 | } |
---|
760 | } |
---|
761 | /* ---------------------------------------------------------------------------- */ |
---|
762 | IMAGE_EXPORT(void) andc_si8vector(sint8 *X, long ncl, long nch, sint8 y, sint8 *Z) |
---|
763 | /* ---------------------------------------------------------------------------- */ |
---|
764 | { |
---|
765 | long j; |
---|
766 | |
---|
767 | for(j=ncl; j<=nch; j++) { |
---|
768 | Z[j] = X[j] & y; |
---|
769 | } |
---|
770 | } |
---|
771 | /* ---------------------------------------------------------------------------- */ |
---|
772 | IMAGE_EXPORT(void) andc_ui8vector(uint8 *X, long ncl, long nch, uint8 y, uint8 *Z) |
---|
773 | /* ---------------------------------------------------------------------------- */ |
---|
774 | { |
---|
775 | long j; |
---|
776 | |
---|
777 | for(j=ncl; j<=nch; j++) { |
---|
778 | Z[j] = X[j] & y; |
---|
779 | } |
---|
780 | } |
---|
781 | /* -------------------------------------------------------------------------------- */ |
---|
782 | IMAGE_EXPORT(void) andc_si16vector(sint16 *X, long ncl, long nch, sint16 y, sint16 *Z) |
---|
783 | /* -------------------------------------------------------------------------------- */ |
---|
784 | { |
---|
785 | long j; |
---|
786 | |
---|
787 | for(j=ncl; j<=nch; j++) { |
---|
788 | Z[j] = X[j] & y; |
---|
789 | } |
---|
790 | } |
---|
791 | /* -------------------------------------------------------------------------------- */ |
---|
792 | IMAGE_EXPORT(void) andc_ui16vector(uint16 *X, long ncl, long nch, uint16 y, uint16 *Z) |
---|
793 | /* -------------------------------------------------------------------------------- */ |
---|
794 | { |
---|
795 | long j; |
---|
796 | |
---|
797 | for(j=ncl; j<=nch; j++) { |
---|
798 | Z[j] = X[j] & y; |
---|
799 | } |
---|
800 | } |
---|
801 | /* -------------------------------------------------------------------------------- */ |
---|
802 | IMAGE_EXPORT(void) andc_si32vector(sint32 *X, long ncl, long nch, sint32 y, sint32 *Z) |
---|
803 | /* -------------------------------------------------------------------------------- */ |
---|
804 | { |
---|
805 | long j; |
---|
806 | |
---|
807 | for(j=ncl; j<=nch; j++) { |
---|
808 | Z[j] = X[j] & y; |
---|
809 | } |
---|
810 | } |
---|
811 | /* -------------------------------------------------------------------------------- */ |
---|
812 | IMAGE_EXPORT(void) andc_ui32vector(uint32 *X, long ncl, long nch, uint32 y, uint32 *Z) |
---|
813 | /* -------------------------------------------------------------------------------- */ |
---|
814 | { |
---|
815 | long j; |
---|
816 | |
---|
817 | for(j=ncl; j<=nch; j++) { |
---|
818 | Z[j] = X[j] & y; |
---|
819 | } |
---|
820 | } |
---|
821 | /* -------------------------------------------------------------------------------- */ |
---|
822 | IMAGE_EXPORT(void) andc_si64vector(sint64 *X, long ncl, long nch, sint64 y, sint64 *Z) |
---|
823 | /* -------------------------------------------------------------------------------- */ |
---|
824 | { |
---|
825 | long j; |
---|
826 | |
---|
827 | for(j=ncl; j<=nch; j++) { |
---|
828 | Z[j] = X[j] & y; |
---|
829 | } |
---|
830 | } |
---|
831 | /* -------------------------------------------------------------------------------- */ |
---|
832 | IMAGE_EXPORT(void) andc_ui64vector(uint64 *X, long ncl, long nch, uint64 y, uint64 *Z) |
---|
833 | /* -------------------------------------------------------------------------------- */ |
---|
834 | { |
---|
835 | long j; |
---|
836 | |
---|
837 | for(j=ncl; j<=nch; j++) { |
---|
838 | Z[j] = X[j] & y; |
---|
839 | } |
---|
840 | } |
---|
841 | /* -------------------------------------------------------------------------- */ |
---|
842 | IMAGE_EXPORT(void) andc_rgb8vector(rgb8 *X, long ncl, long nch, rgb8 y, rgb8 *Z) |
---|
843 | /* -------------------------------------------------------------------------- */ |
---|
844 | { |
---|
845 | long j; |
---|
846 | rgb8 x, z; |
---|
847 | |
---|
848 | for(j=ncl; j<=nch; j++) { |
---|
849 | x = X[j]; |
---|
850 | RGB8_AND(x,y,z); |
---|
851 | Z[j] = z; |
---|
852 | } |
---|
853 | } |
---|
854 | /* ------------------------------------------------------------------------------ */ |
---|
855 | IMAGE_EXPORT(void) andc_rgbx8vector(rgbx8 *X, long ncl, long nch, rgbx8 y, rgbx8 *Z) |
---|
856 | /* ------------------------------------------------------------------------------ */ |
---|
857 | { |
---|
858 | long j; |
---|
859 | rgbx8 x, z; |
---|
860 | |
---|
861 | for(j=ncl; j<=nch; j++) { |
---|
862 | x = X[j]; |
---|
863 | RGBX8_AND(x,y,z); |
---|
864 | Z[j] = z; |
---|
865 | } |
---|
866 | } |
---|