Changeset 822 for soft/giet_vm/applications/rosenfeld/nrc2/src/nrio1.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/nrio1.c
r805 r822 33 33 */ 34 34 35 /* ------------------------------------------------------------------------------- */ 36 IMAGE_EXPORT(void) display_bvector(byte *v,long nl,long nh, char *format, char *name) 37 /* ------------------------------------------------------------------------------- */ 38 { 39 long i; 40 41 if(name != NULL) printf("%s", name); 42 43 for(i=nl; i<=nh; i++) { 44 printf(format, v[i]); 45 } 46 printf("\n"); 47 } 48 /* ---------------------------------------------------------------------------------- */ 49 IMAGE_EXPORT(void) display_si8vector(sint8 *v,long nl,long nh, char *format, char *name) 50 /* ---------------------------------------------------------------------------------- */ 51 { 52 long i; 53 54 if(name != NULL) printf("%s", name); 55 56 for(i=nl; i<=nh; i++) { 57 printf(format, v[i]); 58 } 59 printf("\n"); 60 } 61 /* ---------------------------------------------------------------------------------- */ 62 IMAGE_EXPORT(void) display_ui8vector(uint8 *v,long nl,long nh, char *format, char *name) 63 /* ---------------------------------------------------------------------------------- */ 64 { 65 long i; 66 67 if(name != NULL) printf("%s", name); 68 69 for(i=nl; i<=nh; i++) { 70 printf(format, v[i]); 71 } 72 printf("\n"); 73 } 74 /* ------------------------------------------------------------------------------------ */ 75 IMAGE_EXPORT(void) display_si16vector(sint16 *v,long nl,long nh, char *format, char *name) 76 /* ------------------------------------------------------------------------------------ */ 77 { 78 long i; 79 80 if(name != NULL) printf("%s", name); 81 82 for(i=nl; i<=nh; i++) { 83 printf(format, v[i]); 84 } 85 printf("\n"); 86 } 87 /* ------------------------------------------------------------------------------------- */ 88 IMAGE_EXPORT(void) display_ui16vector(uint16 *v,long nl,long nh, char *format, char *name) 89 /* ------------------------------------------------------------------------------------- */ 90 { 91 long i; 92 93 if(name != NULL) printf("%s", name); 94 95 for(i=nl; i<=nh; i++) { 96 printf(format, v[i]); 97 } 98 printf("\n"); 99 } 100 /* ------------------------------------------------------------------------------------ */ 101 IMAGE_EXPORT(void) display_si32vector(sint32 *v,long nl,long nh, char *format, char *name) 102 /* ------------------------------------------------------------------------------------ */ 103 { 104 long i; 105 106 if(name != NULL) printf("%s", name); 107 108 for(i=nl; i<=nh; i++) { 109 printf(format, v[i]); 110 } 111 printf("\n"); 112 } 113 /* ------------------------------------------------------------------------------------ */ 114 IMAGE_EXPORT(void) display_ui32vector(uint32 *v,long nl,long nh, char *format, char *name) 115 /* ------------------------------------------------------------------------------------ */ 116 { 117 long i; 118 119 if(name != NULL) printf("%s", name); 120 121 for(i=nl; i<=nh; i++) { 122 printf(format, v[i]); 123 } 124 printf("\n"); 125 } 126 /* ------------------------------------------------------------------------------------ */ 127 IMAGE_EXPORT(void) display_si64vector(sint64 *v,long nl,long nh, char *format, char *name) 128 /* ------------------------------------------------------------------------------------ */ 129 { 130 long i; 131 132 if(name != NULL) printf("%s", name); 133 134 for(i=nl; i<=nh; i++) { 135 printf(format, v[i]); 136 } 137 printf("\n"); 138 } 139 /* ------------------------------------------------------------------------------------ */ 140 IMAGE_EXPORT(void) display_ui64vector(uint64 *v,long nl,long nh, char *format, char *name) 141 /* ------------------------------------------------------------------------------------ */ 142 { 143 long i; 144 145 if(name != NULL) printf("%s", name); 146 147 for(i=nl; i<=nh; i++) { 148 printf(format, v[i]); 149 } 150 printf("\n"); 151 } 152 /* ------------------------------------------------------------------------------------ */ 153 IMAGE_EXPORT(void) display_f32vector(float32 *v,long nl,long nh, char *format, char *name) 154 /* ------------------------------------------------------------------------------------ */ 155 { 156 long i; 157 158 if(name != NULL) printf("%s", name); 159 160 for(i=nl; i<=nh; i++) { 161 printf(format, v[i]); 162 } 163 printf("\n"); 164 } 165 /* ------------------------------------------------------------------------------------ */ 166 IMAGE_EXPORT(void) display_f64vector(float64 *v,long nl,long nh, char *format, char *name) 167 /* ------------------------------------------------------------------------------------ */ 168 { 169 long i; 170 171 if(name != NULL) printf("%s", name); 172 173 for(i=nl; i<=nh; i++) { 174 printf(format, v[i]); 175 } 176 printf("\n"); 177 } 178 /* ---------------------------------------------------------------------------------- */ 179 IMAGE_EXPORT(void) display_rgb8vector(rgb8 *v,long nl,long nh, char *format, char *name) 180 /* ---------------------------------------------------------------------------------- */ 181 { 182 long i; 183 184 if(name != NULL) printf("%s", name); 185 186 for(i=nl; i<=nh; i++) { 187 printf(format, v[i]); 188 } 189 printf("\n"); 190 } 191 /* ------------------------------------------------------------------------------------ */ 192 IMAGE_EXPORT(void) display_rgbx8vector(rgbx8 *v,long nl,long nh, char *format, char *name) 193 /* ------------------------------------------------------------------------------------ */ 194 { 195 long i; 196 197 if(name != NULL) printf("%s", name); 198 199 for(i=nl; i<=nh; i++) { 200 printf(format, v[i]); 201 } 202 printf("\n"); 203 } 35 #undef display_type_vector 36 #define display_type_vector(t) \ 37 void short_name(t,display_,vector)(t * v, int32_t nl, int32_t nh, char * format, char * name) \ 38 { \ 39 if (name != NULL) { \ 40 printf("%s", name); \ 41 } \ 42 for (int32_t i = nl; i <= nh; i++) { \ 43 printf(format, v[i]); \ 44 } \ 45 printf("\n"); \ 46 } 47 48 display_type_vector(int8_t); 49 display_type_vector(uint8_t); 50 display_type_vector(int16_t); 51 display_type_vector(uint16_t); 52 display_type_vector(int32_t); 53 display_type_vector(uint32_t); 54 display_type_vector(int64_t); 55 display_type_vector(uint64_t); 56 display_type_vector(float); 57 display_type_vector(double); 58 display_type_vector(rgb8); 59 display_type_vector(rgbx8); 60 204 61 205 62 /* … … 209 66 */ 210 67 211 /* -------------------------------------------------------------------------------------- */ 212 IMAGE_EXPORT(void) display_bvector_number(byte *v,long nl,long nh, char *format, char *name) 213 /* -------------------------------------------------------------------------------------- */ 214 { 215 long i; 216 217 if(name != NULL) printf("%s\n", name); 218 219 for(i=nl; i<=nh; i++) { 220 printf(format, i); 221 } 222 printf("\n"); 223 224 for(i=nl; i<=nh; i++) { 225 printf(format, v[i]); 226 } 227 printf("\n"); 228 } 229 /* ----------------------------------------------------------------------------------------- */ 230 IMAGE_EXPORT(void) display_si8vector_number(sint8 *v,long nl,long nh, char *format, char *name) 231 /* ----------------------------------------------------------------------------------------- */ 232 { 233 long i; 234 235 if(name != NULL) printf(name); 236 for(i=nl; i<=nh; i++) { 237 printf(format, i); 238 } 239 printf("\n"); 240 241 for(i=nl; i<=nh; i++) { 242 printf(format, v[i]); 243 } 244 printf("\n"); 245 } 246 /* ----------------------------------------------------------------------------------------- */ 247 IMAGE_EXPORT(void) display_ui8vector_number(uint8 *v,long nl,long nh, char *format, char *name) 248 /* ----------------------------------------------------------------------------------------- */ 249 { 250 long i; 251 252 if(name != NULL) printf(name); 253 for(i=nl; i<=nh; i++) { 254 printf(format, i); 255 } 256 printf("\n"); 257 258 for(i=nl; i<=nh; i++) { 259 printf(format, v[i]); 260 } 261 printf("\n"); 262 } 263 /* ------------------------------------------------------------------------------------------- */ 264 IMAGE_EXPORT(void) display_si16vector_number(sint16 *v,long nl,long nh, char *format, char *name) 265 /* ------------------------------------------------------------------------------------------- */ 266 { 267 long i; 268 269 if(name != NULL) printf(name); 270 for(i=nl; i<=nh; i++) { 271 printf(format, i); 272 } 273 printf("\n"); 274 275 for(i=nl; i<=nh; i++) { 276 printf(format, v[i]); 277 } 278 printf("\n"); 279 } 280 /* ------------------------------------------------------------------------------------------- */ 281 IMAGE_EXPORT(void) display_ui16vector_number(uint16 *v,long nl,long nh, char *format, char *name) 282 /* ------------------------------------------------------------------------------------------- */ 283 { 284 long i; 285 286 if(name != NULL) printf(name); 287 for(i=nl; i<=nh; i++) { 288 printf(format, i); 289 } 290 printf("\n"); 291 292 for(i=nl; i<=nh; i++) { 293 printf(format, v[i]); 294 } 295 printf("\n"); 296 } 297 /* ------------------------------------------------------------------------------------------- */ 298 IMAGE_EXPORT(void) display_si32vector_number(sint32 *v,long nl,long nh, char *format, char *name) 299 /* ------------------------------------------------------------------------------------------- */ 300 { 301 long i; 302 303 if(name != NULL) printf("%s\n", name); 304 305 for(i=nl; i<=nh; i++) { 306 printf(format, i); 307 } 308 printf("\n"); 309 310 for(i=nl; i<=nh; i++) { 311 printf(format, v[i]); 312 } 313 printf("\n"); 314 } 315 /* ------------------------------------------------------------------------------------------- */ 316 IMAGE_EXPORT(void) display_ui32vector_number(uint32 *v,long nl,long nh, char *format, char *name) 317 /* ------------------------------------------------------------------------------------------- */ 318 { 319 long i; 320 321 if(name != NULL) printf("%s\n", name); 322 323 for(i=nl; i<=nh; i++) { 324 printf(format, i); 325 printf(" "); 326 } 327 printf("\n"); 328 329 for(i=nl; i<=nh; i++) { 330 printf(format, v[i]); 331 printf(" "); 332 } 333 printf("\n"); 334 } 335 /* ------------------------------------------------------------------------------------------- */ 336 IMAGE_EXPORT(void) display_si64vector_number(sint64 *v,long nl,long nh, char *format, char *name) 337 /* ------------------------------------------------------------------------------------------- */ 338 { 339 long i; 340 341 if(name != NULL) printf("%s\n", name); 342 343 for(i=nl; i<=nh; i++) { 344 printf(format, i); 345 } 346 printf("\n"); 347 348 for(i=nl; i<=nh; i++) { 349 printf(format, v[i]); 350 } 351 printf("\n"); 352 } 353 /* ------------------------------------------------------------------------------------------- */ 354 IMAGE_EXPORT(void) display_ui64vector_number(uint64 *v,long nl,long nh, char *format, char *name) 355 /* ------------------------------------------------------------------------------------------- */ 356 { 357 long i; 358 359 if(name != NULL) printf("%s\n", name); 360 361 for(i=nl; i<=nh; i++) { 362 printf(format, i); 363 } 364 printf("\n"); 365 366 for(i=nl; i<=nh; i++) { 367 printf(format, v[i]); 368 } 369 printf("\n"); 370 } 371 /* ------------------------------------------------------------------------------------------- */ 372 IMAGE_EXPORT(void) display_f32vector_number(float32 *v,long nl,long nh, char *format, char *name) 373 /* ------------------------------------------------------------------------------------------- */ 374 { 375 long i; 376 377 if(name != NULL) printf("%s\n", name); 378 379 for(i=nl; i<=nh; i++) { 380 printf(format, i); 381 } 382 printf("\n"); 383 384 for(i=nl; i<=nh; i++) { 385 printf(format, v[i]); 386 } 387 printf("\n"); 388 } 389 /* ------------------------------------------------------------------------------------------- */ 390 IMAGE_EXPORT(void) display_f64vector_number(float64 *v,long nl,long nh, char *format, char *name) 391 /* ------------------------------------------------------------------------------------------- */ 392 { 393 long i; 394 395 if(name != NULL) printf("%s\n", name); 396 397 for(i=nl; i<=nh; i++) { 398 printf(format, i); 399 } 400 printf("\n"); 401 402 for(i=nl; i<=nh; i++) { 403 printf(format, v[i]); 404 } 405 printf("\n"); 406 } 407 /* ----------------------------------------------------------------------------------------- */ 408 IMAGE_EXPORT(void) display_rgb8vector_number(rgb8 *v,long nl,long nh, char *format, char *name) 409 /* ----------------------------------------------------------------------------------------- */ 410 { 411 long i; 412 413 if(name != NULL) printf("%s\n", name); 414 415 for(i=nl; i<=nh; i++) { 416 printf(format, i); 417 } 418 printf("\n"); 419 420 for(i=nl; i<=nh; i++) { 421 printf(format, v[i]); 422 } 423 printf("\n"); 424 } 425 /* ------------------------------------------------------------------------------------------- */ 426 IMAGE_EXPORT(void) display_rgbx8vector_number(rgbx8 *v,long nl,long nh, char *format, char *name) 427 /* ------------------------------------------------------------------------------------------- */ 428 { 429 long i; 430 431 if(name != NULL) printf("%s\n", name); 432 433 for(i=nl; i<=nh; i++) { 434 printf(format, i); 435 } 436 printf("\n"); 437 438 for(i=nl; i<=nh; i++) { 439 printf(format, v[i]); 440 } 441 printf("\n"); 442 } 68 #undef display_type_vector_number 69 #define display_type_vector_number(t) \ 70 void short_name(t,display_,vector_number)(t * v, int32_t nl, int32_t nh, char * format, char * name) \ 71 { \ 72 if (name != NULL) { \ 73 printf("%s\n", name); \ 74 } \ 75 for (int32_t i = nl; i <= nh; i++) { \ 76 printf(format, i); \ 77 } \ 78 printf("\n"); \ 79 for (int32_t i = nl; i <= nh; i++) { \ 80 printf(format, v[i]); \ 81 } \ 82 printf("\n"); \ 83 } 84 85 86 display_type_vector_number(int8_t); 87 display_type_vector_number(uint8_t); 88 display_type_vector_number(int16_t); 89 display_type_vector_number(uint16_t); 90 display_type_vector_number(int32_t); 91 display_type_vector_number(uint32_t); 92 display_type_vector_number(int64_t); 93 display_type_vector_number(uint64_t); 94 display_type_vector_number(float); 95 display_type_vector_number(double); 96 display_type_vector_number(rgb8); 97 display_type_vector_number(rgbx8); 98 99 443 100 /* 444 101 * ------------------------ … … 447 104 */ 448 105 449 /* ----------------------------------------------------------------------------------- */ 450 IMAGE_EXPORT(void) display_si8vector_T(sint8 *v,int i0, int i1, char *format, char *name) 451 /* ----------------------------------------------------------------------------------- */ 452 { 453 int i; 454 455 if(name != NULL) printf(name); 456 457 for(i=i0; i<=i1; i++) { 458 printf(format, v[i]); 459 printf("\n"); 460 } 461 } 462 /* ----------------------------------------------------------------------------------- */ 463 IMAGE_EXPORT(void) display_ui8vector_T(uint8 *v,int i0, int i1, char *format, char *name) 464 /* ----------------------------------------------------------------------------------- */ 465 { 466 int i; 467 468 if(name != NULL) printf(name); 469 470 for(i=i0; i<=i1; i++) { 471 printf(format, v[i]); 472 printf("\n"); 473 } 474 } 475 /* ------------------------------------------------------------------------------------- */ 476 IMAGE_EXPORT(void) display_si16vector_T(sint16 *v,int i0, int i1, char *format, char *name) 477 /* ------------------------------------------------------------------------------------- */ 478 { 479 int i; 480 481 if(name != NULL) printf(name); 482 483 for(i=i0; i<=i1; i++) { 484 printf(format, v[i]); 485 printf("\n"); 486 } 487 } 488 /* ------------------------------------------------------------------------------------- */ 489 IMAGE_EXPORT(void) display_ui16vector_T(uint16 *v,int i0, int i1, char *format, char *name) 490 /* ------------------------------------------------------------------------------------- */ 491 { 492 int i; 493 494 if(name != NULL) printf(name); 495 496 for(i=i0; i<=i1; i++) { 497 printf(format, v[i]); 498 printf("\n"); 499 } 500 } 501 /* ------------------------------------------------------------------------------------- */ 502 IMAGE_EXPORT(void) display_si32vector_T(sint32 *v,int i0, int i1, char *format, char *name) 503 /* ------------------------------------------------------------------------------------- */ 504 { 505 int i; 506 507 if(name != NULL) printf(name); 508 509 for(i=i0; i<=i1; i++) { 510 printf(format, v[i]); 511 printf("\n"); 512 } 513 } 514 /* ------------------------------------------------------------------------------------- */ 515 IMAGE_EXPORT(void) display_ui32vector_T(uint32 *v,int i0, int i1, char *format, char *name) 516 /* ------------------------------------------------------------------------------------- */ 517 { 518 int i; 519 520 if(name != NULL) printf(name); 521 522 for(i=i0; i<=i1; i++) { 523 printf(format, v[i]); 524 printf("\n"); 525 } 526 } 527 /* ------------------------------------------------------------------------------------- */ 528 IMAGE_EXPORT(void) display_si64vector_T(sint64 *v,int i0, int i1, char *format, char *name) 529 /* ------------------------------------------------------------------------------------- */ 530 { 531 int i; 532 533 if(name != NULL) printf(name); 534 535 for(i=i0; i<=i1; i++) { 536 printf(format, v[i]); 537 printf("\n"); 538 } 539 } 540 /* ------------------------------------------------------------------------------------- */ 541 IMAGE_EXPORT(void) display_ui64vector_T(uint64 *v,int i0, int i1, char *format, char *name) 542 /* ------------------------------------------------------------------------------------- */ 543 { 544 int i; 545 546 if(name != NULL) printf(name); 547 548 for(i=i0; i<=i1; i++) { 549 printf(format, v[i]); 550 printf("\n"); 551 } 552 } 553 /* ------------------------------------------------------------------------------------- */ 554 IMAGE_EXPORT(void) display_f32vector_T(float32 *v,int i0, int i1, char *format, char *name) 555 /* ------------------------------------------------------------------------------------- */ 556 { 557 int i; 558 559 if(name != NULL) printf(name); 560 561 for(i=i0; i<=i1; i++) { 562 printf(format, v[i]); 563 printf("\n"); 564 } 565 } 566 /* ------------------------------------------------------------------------------------- */ 567 IMAGE_EXPORT(void) display_f64vector_T(float64 *v,int i0, int i1, char *format, char *name) 568 /* ------------------------------------------------------------------------------------- */ 569 { 570 int i; 571 572 if(name != NULL) printf(name); 573 574 for(i=i0; i<=i1; i++) { 575 printf(format, v[i]); 576 printf("\n"); 577 } 578 } 579 /* ----------------------------------------------------------------------------------- */ 580 IMAGE_EXPORT(void) display_rgb8vector_T(rgb8 *v,int i0, int i1, char *format, char *name) 581 /* ----------------------------------------------------------------------------------- */ 582 { 583 int i; 584 585 if(name != NULL) printf(name); 586 587 for(i=i0; i<=i1; i++) { 588 printf(format, v[i]); 589 printf("\n"); 590 } 591 } 592 /* ------------------------------------------------------------------------------------- */ 593 IMAGE_EXPORT(void) display_rgbx8vector_T(rgbx8 *v,int i0, int i1, char *format, char *name) 594 /* ------------------------------------------------------------------------------------- */ 595 { 596 int i; 597 598 if(name != NULL) printf(name); 599 600 for(i=i0; i<=i1; i++) { 601 printf(format, v[i]); 602 printf("\n"); 603 } 604 } 106 107 #undef display_type_vector_T 108 #define display_type_vector_T(t) \ 109 void short_name(t,display_,vector_T)(t * v, int32_t i0, int32_t i1, char * format, char * name) \ 110 { \ 111 if (name != NULL) { \ 112 printf("%s", name); \ 113 } \ 114 for (int32_t i = i0; i <= i1; i++) { \ 115 printf(format, v[i]); \ 116 printf("\n"); \ 117 } \ 118 printf("\n"); \ 119 } 120 121 display_type_vector_T(int8_t); 122 display_type_vector_T(uint8_t); 123 display_type_vector_T(int16_t); 124 display_type_vector_T(uint16_t); 125 display_type_vector_T(int32_t); 126 display_type_vector_T(uint32_t); 127 display_type_vector_T(int64_t); 128 display_type_vector_T(uint64_t); 129 display_type_vector_T(float); 130 display_type_vector_T(double); 131 display_type_vector_T(rgb8); 132 display_type_vector_T(rgbx8); 133 605 134 606 135 /* … … 610 139 */ 611 140 612 /* ------------------------------------------------------------------------------------------ */ 613 IMAGE_EXPORT(void) display_si8vector_number_T(sint8 *v,int i0, int i1, char *format, char *name) 614 /* ------------------------------------------------------------------------------------------ */ 615 { 616 int i; 617 618 if(name != NULL) printf(name); 619 620 for(i=i0; i<=i1; i++) { 621 printf("%8d ", i); 622 printf(format, v[i]); 623 printf("\n"); 624 } 625 } 626 /* ------------------------------------------------------------------------------------------ */ 627 IMAGE_EXPORT(void) display_ui8vector_number_T(uint8 *v,int i0, int i1, char *format, char *name) 628 /* ------------------------------------------------------------------------------------------ */ 629 { 630 int i; 631 632 if(name != NULL) printf(name); 633 634 for(i=i0; i<=i1; i++) { 635 printf("%8d ", i); 636 printf(format, v[i]); 637 printf("\n"); 638 } 639 } 640 /* -------------------------------------------------------------------------------------------- */ 641 IMAGE_EXPORT(void) display_si16vector_number_T(sint16 *v,int i0, int i1, char *format, char *name) 642 /* -------------------------------------------------------------------------------------------- */ 643 { 644 int i; 645 646 if(name != NULL) printf(name); 647 648 for(i=i0; i<=i1; i++) { 649 printf("%8d ", i); 650 printf(format, v[i]); 651 printf("\n"); 652 } 653 } 654 /* -------------------------------------------------------------------------------------------- */ 655 IMAGE_EXPORT(void) display_ui16vector_number_T(uint16 *v,int i0, int i1, char *format, char *name) 656 /* -------------------------------------------------------------------------------------------- */ 657 { 658 int i; 659 660 if(name != NULL) printf(name); 661 662 for(i=i0; i<=i1; i++) { 663 printf("%8d ", i); 664 printf(format, v[i]); 665 printf("\n"); 666 } 667 } 668 /* -------------------------------------------------------------------------------------------- */ 669 IMAGE_EXPORT(void) display_si32vector_number_T(sint32 *v,int i0, int i1, char *format, char *name) 670 /* -------------------------------------------------------------------------------------------- */ 671 { 672 int i; 673 674 if(name != NULL) printf(name); 675 676 for(i=i0; i<=i1; i++) { 677 printf("%8d ", i); 678 printf(format, v[i]); 679 printf("\n"); 680 } 681 } 682 /* -------------------------------------------------------------------------------------------- */ 683 IMAGE_EXPORT(void) display_ui32vector_number_T(uint32 *v,int i0, int i1, char *format, char *name) 684 /* -------------------------------------------------------------------------------------------- */ 685 { 686 int i; 687 688 if(name != NULL) printf(name); 689 690 for(i=i0; i<=i1; i++) { 691 printf("%8d ", i); 692 printf(format, v[i]); 693 printf("\n"); 694 } 695 } 696 /* -------------------------------------------------------------------------------------------- */ 697 IMAGE_EXPORT(void) display_si64vector_number_T(sint64 *v,int i0, int i1, char *format, char *name) 698 /* -------------------------------------------------------------------------------------------- */ 699 { 700 int i; 701 702 if(name != NULL) printf(name); 703 704 for(i=i0; i<=i1; i++) { 705 printf("%8d ", i); 706 printf(format, v[i]); 707 printf("\n"); 708 } 709 } 710 /* -------------------------------------------------------------------------------------------- */ 711 IMAGE_EXPORT(void) display_ui64vector_number_T(uint64 *v,int i0, int i1, char *format, char *name) 712 /* -------------------------------------------------------------------------------------------- */ 713 { 714 int i; 715 716 if(name != NULL) printf(name); 717 718 for(i=i0; i<=i1; i++) { 719 printf("%8d ", i); 720 printf(format, v[i]); 721 printf("\n"); 722 } 723 } 724 /* -------------------------------------------------------------------------------------------- */ 725 IMAGE_EXPORT(void) display_f32vector_number_T(float32 *v,int i0, int i1, char *format, char *name) 726 /* -------------------------------------------------------------------------------------------- */ 727 { 728 int i; 729 730 if(name != NULL) printf(name); 731 732 for(i=i0; i<=i1; i++) { 733 printf("%8d ", i); 734 printf(format, v[i]); 735 printf("\n"); 736 } 737 } 738 /* -------------------------------------------------------------------------------------------- */ 739 IMAGE_EXPORT(void) display_f64vector_number_T(float64 *v,int i0, int i1, char *format, char *name) 740 /* -------------------------------------------------------------------------------------------- */ 741 { 742 int i; 743 744 if(name != NULL) printf(name); 745 746 for(i=i0; i<=i1; i++) { 747 printf("%8d ", i); 748 printf(format, v[i]); 749 printf("\n"); 750 } 751 } 752 /* ------------------------------------------------------------------------------------------ */ 753 IMAGE_EXPORT(void) display_rgb8vector_number_T(rgb8 *v,int i0, int i1, char *format, char *name) 754 /* ------------------------------------------------------------------------------------------ */ 755 { 756 int i; 757 758 if(name != NULL) printf(name); 759 760 for(i=i0; i<=i1; i++) { 761 printf("%8d ", i); 762 printf(format, v[i]); 763 printf("\n"); 764 } 765 } 766 /* -------------------------------------------------------------------------------------------- */ 767 IMAGE_EXPORT(void) display_rgbx8vector_number_T(rgbx8 *v,int i0, int i1, char *format, char *name) 768 /* -------------------------------------------------------------------------------------------- */ 769 { 770 int i; 771 772 if(name != NULL) printf(name); 773 774 for(i=i0; i<=i1; i++) { 775 printf("%8d ", i); 776 printf(format, v[i]); 777 printf("\n"); 778 } 779 } 141 142 #undef display_type_vector_number_T 143 #define display_type_vector_number_T(t) \ 144 void short_name(t,display_,vector_number_T)(t * v, int32_t i0, int32_t i1, char * format, char * name) \ 145 { \ 146 if (name != NULL) { \ 147 printf("%s", name); \ 148 } \ 149 for (int32_t i = i0; i <= i1; i++) { \ 150 printf("%8d ", i); \ 151 printf(format, v[i]); \ 152 printf("\n"); \ 153 } \ 154 printf("\n"); \ 155 } 156 157 display_type_vector_number_T(int8_t); 158 display_type_vector_number_T(uint8_t); 159 display_type_vector_number_T(int16_t); 160 display_type_vector_number_T(uint16_t); 161 display_type_vector_number_T(int32_t); 162 display_type_vector_number_T(uint32_t); 163 display_type_vector_number_T(int64_t); 164 display_type_vector_number_T(uint64_t); 165 display_type_vector_number_T(float); 166 display_type_vector_number_T(double); 167 display_type_vector_number_T(rgb8); 168 display_type_vector_number_T(rgbx8); 169 780 170 781 171 /* … … 785 175 */ 786 176 787 // ------------------------------------------------------------------------------- 788 void display_ui8vector_positive(uint8 *v, int j0, int j1, int iformat, char *name) 789 // ------------------------------------------------------------------------------- 790 { 791 int j; 792 char *format, *str; 793 794 select_display_positive_parameters(iformat, &format, &str); 795 796 if(name != NULL) printf(name); 797 798 for(j=j0; j<=j1; j++) { 799 if(v[j]) { 800 printf(format, v[j]); 801 } else { 802 printf("%s", str); 803 } 804 } 805 printf("\n"); 806 } 807 808 // --------------------------------------------------------------------------------- 809 void display_ui16vector_positive(uint16 *v, int j0, int j1, int iformat, char *name) 810 // --------------------------------------------------------------------------------- 811 { 812 int j; 813 char *format, *str; 814 815 select_display_positive_parameters(iformat, &format, &str); 816 817 if(name != NULL) printf(name); 818 819 for(j=j0; j<=j1; j++) { 820 if(v[j]) { 821 printf(format, v[j]); 822 } else { 823 printf("%s", str); 824 } 825 } 826 printf("\n"); 827 } 828 // --------------------------------------------------------------------------------- 829 void display_ui32vector_positive(uint32 *v, int j0, int j1, int iformat, char *name) 830 // --------------------------------------------------------------------------------- 831 { 832 int j; 833 char *format, *str; 834 835 select_display_positive_parameters(iformat, &format, &str); 836 837 if(name != NULL) printf(name); 838 839 for(j=j0; j<=j1; j++) { 840 if(v[j]) { 841 printf(format, v[j]); 842 } else { 843 printf("%s", str); 844 } 845 } 846 printf("\n"); 847 } 177 #undef display_type_vector_positive 178 #define display_type_vector_positive(t) \ 179 void short_name(t,display_,vector_positive)(t * v, int32_t j0, int32_t j1, int32_t iformat, char * name) \ 180 { \ 181 char * format; \ 182 char * str; \ 183 select_display_positive_parameters(iformat, &format, &str); \ 184 if (name != NULL) { \ 185 printf(name); \ 186 } \ 187 for (int32_t j = j0; j <= j1; j++) { \ 188 if (v[j] != 0) { \ 189 printf(format, v[j]); \ 190 } \ 191 else { \ 192 printf("%s", str); \ 193 } \ 194 } \ 195 printf("\n"); \ 196 } 197 198 199 display_type_vector_positive(int8_t); 200 display_type_vector_positive(uint8_t); 201 display_type_vector_positive(int16_t); 202 display_type_vector_positive(uint16_t); 203 display_type_vector_positive(int32_t); 204 display_type_vector_positive(uint32_t); 205 display_type_vector_positive(int64_t); 206 display_type_vector_positive(uint64_t); 207 display_type_vector_positive(float); 208 display_type_vector_positive(double); 209 210 // Local Variables: 211 // tab-width: 4 212 // c-basic-offset: 4 213 // c-file-offsets:((innamespace . 0)(inline-open . 0)) 214 // indent-tabs-mode: nil 215 // End: 216 217 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 218
Note: See TracChangeset
for help on using the changeset viewer.