Changeset 822 for soft/giet_vm/applications/rosenfeld/nrc2/src/nrbool1.c
- Timestamp:
- Jun 1, 2016, 10:25:43 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/rosenfeld/nrc2/src/nrbool1.c
r772 r822 17 17 #include <math.h> // fabs 18 18 19 #include "nrc_os_config.h" 19 20 #include "mypredef.h" 20 21 #include "nrtype.h" … … 31 32 */ 32 33 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 } 34 #undef not_type_vector 35 #define not_type_vector(t) \ 36 void short_name(t,not_,vector)(t * X, int32_t ncl, int32_t nch, t * Y) \ 37 { \ 38 for (int32_t j = ncl; j <= nch; j++) { \ 39 Y[j] = ~X[j]; \ 40 } \ 41 } 42 43 not_type_vector(int8_t); 44 not_type_vector(uint8_t); 45 not_type_vector(int16_t); 46 not_type_vector(uint16_t); 47 not_type_vector(int32_t); 48 not_type_vector(uint32_t); 49 not_type_vector(int64_t); 50 not_type_vector(uint64_t); 51 52 123 53 /* ----------------------------------------------------------------- */ 124 IMAGE_EXPORT(void) not_rgb8vector(rgb8 *X, long ncl, long nch, rgb8 *Y)54 void not_rgb8vector(rgb8 * X, int32_t ncl, int32_t nch, rgb8 * Y) 125 55 /* ----------------------------------------------------------------- */ 126 56 { 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 } 57 for (int32_t j = ncl; j <= nch; j++) { 58 RGB8_NOT(X[j], Y[j]); 59 } 60 } 61 136 62 /* -------------------------------------------------------------------- */ 137 IMAGE_EXPORT(void) not_rgbx8vector(rgbx8 *X, long ncl, long nch, rgbx8 *Y)63 void not_rgbx8vector(rgbx8 * X, int32_t ncl, int32_t nch, rgbx8 * Y) 138 64 /* -------------------------------------------------------------------- */ 139 65 { 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 } 66 for (int32_t j = ncl; j <= nch; j++) { 67 RGBX8_NOT(X[j], Y[j]); 68 } 69 } 70 149 71 /* 150 72 * ----------- … … 153 75 */ 154 76 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 } 77 #undef or_type_vector 78 #define or_type_vector(t) \ 79 void short_name(t,or_,vector)(t * X, int32_t ncl, int32_t nch, t * Y, t * Z) \ 80 { \ 81 for (int32_t j = ncl; j <= nch; j++) { \ 82 Z[j] = X[j] | Y[j]; \ 83 } \ 84 } 85 86 or_type_vector(int8_t); 87 or_type_vector(uint8_t); 88 or_type_vector(int16_t); 89 or_type_vector(uint16_t); 90 or_type_vector(int32_t); 91 or_type_vector(uint32_t); 92 or_type_vector(int64_t); 93 or_type_vector(uint64_t); 94 95 245 96 /* ------------------------------------------------------------------------- */ 246 IMAGE_EXPORT(void) or_rgb8vector(rgb8 *X, long ncl, long nch, rgb8 *Y, rgb8 *Z)97 void or_rgb8vector(rgb8 * X, int32_t ncl, int32_t nch, rgb8 * Y, rgb8 * Z) 247 98 /* ------------------------------------------------------------------------- */ 248 99 { 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; 100 for (int32_t j = ncl; j <= nch; j++) { 101 RGB8_OR(X[j], Y[j], Z[j]); 257 102 } 258 103 } 259 104 /* ----------------------------------------------------------------------------- */ 260 IMAGE_EXPORT(void) or_rgbx8vector(rgbx8 *X, long ncl, long nch, rgbx8 *Y, rgbx8 *Z)105 void or_rgbx8vector(rgbx8 * X, int32_t ncl, int32_t nch, rgbx8 * Y, rgbx8 * Z) 261 106 /* ----------------------------------------------------------------------------- */ 262 107 { 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 } 108 for (int32_t j = ncl; j <= nch; j++) { 109 RGBX8_OR(X[j], Y[j], Z[j]); 110 } 111 } 112 113 114 #undef orc_type_vector 115 #define orc_type_vector(t) \ 116 void short_name(t,orc_,vector)(t * X, int32_t ncl, int32_t nch, t y, t * Z) \ 117 { \ 118 for (int32_t j = ncl; j <= nch; j++) { \ 119 Z[j] = X[j] | y; \ 120 } \ 121 } 122 123 orc_type_vector(int8_t); 124 orc_type_vector(uint8_t); 125 orc_type_vector(int16_t); 126 orc_type_vector(uint16_t); 127 orc_type_vector(int32_t); 128 orc_type_vector(uint32_t); 129 orc_type_vector(int64_t); 130 orc_type_vector(uint64_t); 131 132 363 133 /* ------------------------------------------------------------------------- */ 364 IMAGE_EXPORT(void) orc_rgb8vector(rgb8 *X, long ncl, long nch, rgb8 y, rgb8 *Z)134 void orc_rgb8vector(rgb8 * X, int32_t ncl, int32_t nch, rgb8 y, rgb8 * Z) 365 135 /* ------------------------------------------------------------------------- */ 366 136 { 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 } 137 for (int32_t j = ncl; j <= nch; j++) { 138 RGB8_OR(X[j], y, Z[j]); 139 } 140 } 141 376 142 /* ----------------------------------------------------------------------------- */ 377 IMAGE_EXPORT(void) orc_rgbx8vector(rgbx8 *X, long ncl, long nch, rgbx8 y, rgbx8 *Z)143 void orc_rgbx8vector(rgbx8 * X, int32_t ncl, int32_t nch, rgbx8 y, rgbx8 * Z) 378 144 /* ----------------------------------------------------------------------------- */ 379 145 { 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 } 146 for (int32_t j = ncl; j <= nch; j++) { 147 RGBX8_OR(X[j], y, Z[j]); 148 } 149 } 150 151 389 152 /* 390 153 * ----------- … … 392 155 * ----------- 393 156 */ 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 } 157 158 #undef xor_type_vector 159 #define xor_type_vector(t) \ 160 void short_name(t,xor_,vector)(t * X, int32_t ncl, int32_t nch, t * Y, t * Z) \ 161 { \ 162 for (int32_t j = ncl; j <= nch; j++) { \ 163 Z[j] = X[j] ^ Y[j]; \ 164 } \ 165 } 166 167 xor_type_vector(int8_t); 168 xor_type_vector(uint8_t); 169 xor_type_vector(int16_t); 170 xor_type_vector(uint16_t); 171 xor_type_vector(int32_t); 172 xor_type_vector(uint32_t); 173 xor_type_vector(int64_t); 174 xor_type_vector(uint64_t); 175 176 177 /* -------------------------------------------------------------------------- */ 178 void xor_rgb8vector(rgb8 * X, int32_t ncl, int32_t nch, rgb8 * Y, rgb8 * Z) 179 /* -------------------------------------------------------------------------- */ 180 { 181 for (int32_t j = ncl; j <= nch; j++) { 182 RGB8_XOR(X[j], Y[j], Z[j]); 183 } 184 } 185 186 /* ------------------------------------------------------------------------------ */ 187 void xor_rgbx8vector(rgbx8 * X, int32_t ncl, int32_t nch, rgbx8 * Y, rgbx8 * Z) 188 /* ------------------------------------------------------------------------------ */ 189 { 190 for (int32_t j = ncl; j <= nch; j++) { 191 RGBX8_XOR(X[j], Y[j], Z[j]); 192 } 193 } 194 195 196 #undef xorc_type_vector 197 #define xorc_type_vector(t) \ 198 void short_name(t,xorc_,vector)(t * X, int32_t ncl, int32_t nch, t y, t * Z) \ 199 { \ 200 for (int32_t j = ncl; j <= nch; j++) { \ 201 Z[j] = X[j] ^ y; \ 202 } \ 203 } 204 205 xorc_type_vector(int8_t); 206 xorc_type_vector(uint8_t); 207 xorc_type_vector(int16_t); 208 xorc_type_vector(uint16_t); 209 xorc_type_vector(int32_t); 210 xorc_type_vector(uint32_t); 211 xorc_type_vector(int64_t); 212 xorc_type_vector(uint64_t); 213 214 215 /* -------------------------------------------------------------------------- */ 216 void xorc_rgb8vector(rgb8 * X, int32_t ncl, int32_t nch, rgb8 y, rgb8 * Z) 217 /* -------------------------------------------------------------------------- */ 218 { 219 for (int32_t j = ncl; j <= nch; j++) { 220 RGB8_XOR(X[j], y, Z[j]); 221 } 222 } 223 224 /* ------------------------------------------------------------------------------ */ 225 void xorc_rgbx8vector(rgbx8 * X, int32_t ncl, int32_t nch, rgbx8 y, rgbx8 * Z) 226 /* ------------------------------------------------------------------------------ */ 227 { 228 for (int32_t j = ncl; j <= nch; j++) { 229 RGBX8_XOR(X[j], y, Z[j]); 230 } 231 } 232 233 628 234 /* 629 235 * ----------- … … 631 237 * ----------- 632 238 */ 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 } 239 240 241 #undef and_type_vector 242 #define and_type_vector(t) \ 243 void short_name(t,and_,vector)(t * X, int32_t ncl, int32_t nch, t * Y, t * Z) \ 244 { \ 245 for (int32_t j = ncl; j <= nch; j++) { \ 246 Z[j] = X[j] & Y[j]; \ 247 } \ 248 } 249 250 and_type_vector(int8_t); 251 and_type_vector(uint8_t); 252 and_type_vector(int16_t); 253 and_type_vector(uint16_t); 254 and_type_vector(int32_t); 255 and_type_vector(uint32_t); 256 and_type_vector(int64_t); 257 and_type_vector(uint64_t); 258 259 260 /* -------------------------------------------------------------------------- */ 261 void and_rgb8vector(rgb8 * X, int32_t ncl, int32_t nch, rgb8 * Y, rgb8 * Z) 262 /* -------------------------------------------------------------------------- */ 263 { 264 for (int32_t j = ncl; j <= nch; j++) { 265 RGB8_AND(X[j], Y[j], Z[j]); 266 } 267 } 268 269 /* ------------------------------------------------------------------------------ */ 270 void and_rgbx8vector(rgbx8 * X, int32_t ncl, int32_t nch, rgbx8 * Y, rgbx8 * Z) 271 /* ------------------------------------------------------------------------------ */ 272 { 273 for (int32_t j = ncl; j <= nch; j++) { 274 RGBX8_AND(X[j], Y[j], Z[j]); 275 } 276 } 277 278 279 #undef andc_type_vector 280 #define andc_type_vector(t) \ 281 void short_name(t,andc_,vector)(t * X, int32_t ncl, int32_t nch, t y, t * Z) \ 282 { \ 283 for (int32_t j = ncl; j <= nch; j++) { \ 284 Z[j] = X[j] ^ y; \ 285 } \ 286 } 287 288 andc_type_vector(int8_t); 289 andc_type_vector(uint8_t); 290 andc_type_vector(int16_t); 291 andc_type_vector(uint16_t); 292 andc_type_vector(int32_t); 293 andc_type_vector(uint32_t); 294 andc_type_vector(int64_t); 295 andc_type_vector(uint64_t); 296 297 298 /* -------------------------------------------------------------------------- */ 299 void andc_rgb8vector(rgb8 * X, int32_t ncl, int32_t nch, rgb8 y, rgb8 * Z) 300 /* -------------------------------------------------------------------------- */ 301 { 302 for (int32_t j = ncl; j <= nch; j++) { 303 RGB8_AND(X[j], y, Z[j]); 304 } 305 } 306 307 /* ------------------------------------------------------------------------------ */ 308 void andc_rgbx8vector(rgbx8 * X, int32_t ncl, int32_t nch, rgbx8 y, rgbx8 * Z) 309 /* ------------------------------------------------------------------------------ */ 310 { 311 for (int32_t j = ncl; j <= nch; j++) { 312 RGBX8_AND(X[j], y, Z[j]); 313 } 314 } 315 316 317 // Local Variables: 318 // tab-width: 4 319 // c-basic-offset: 4 320 // c-file-offsets:((innamespace . 0)(inline-open . 0)) 321 // indent-tabs-mode: nil 322 // End: 323 324 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 325
Note: See TracChangeset
for help on using the changeset viewer.