1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020
|
/* Function dispatch tables for arithmetic.
*
* J. Cupitt, 8/4/93.
*/
/*
This file is part of VIPS.
VIPS is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
/*
These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#include <stdio.h>
#include <vips/vips.h>
/* One image in, one out.
*/
static im_arg_desc one_in_one_out[] = {
IM_INPUT_IMAGE( "in" ),
IM_OUTPUT_IMAGE( "out" )
};
/* Two images in, one out.
*/
static im_arg_desc two_in_one_out[] = {
IM_INPUT_IMAGE( "in1" ),
IM_INPUT_IMAGE( "in2" ),
IM_OUTPUT_IMAGE( "out" )
};
/* Call im_sRGB2XYZ via arg vector.
*/
static int
sRGB2XYZ_vec( im_object *argv )
{
return( im_sRGB2XYZ( argv[0], argv[1] ) );
}
/* Description of im_sRGB2XYZ.
*/
static im_function sRGB2XYZ_desc = {
"im_sRGB2XYZ", /* Name */
"convert sRGB to XYZ", /* Description */
IM_FN_PIO, /* Flags */
sRGB2XYZ_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Call im_XYZ2sRGB via arg vector.
*/
static int
XYZ2sRGB_vec( im_object *argv )
{
return( im_XYZ2sRGB( argv[0], argv[1] ) );
}
/* Description of im_XYZ2sRGB.
*/
static im_function XYZ2sRGB_desc = {
"im_XYZ2sRGB", /* Name */
"convert XYZ to sRGB", /* Description */
IM_FN_PIO, /* Flags */
XYZ2sRGB_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Call im_LCh2Lab via arg vector.
*/
static int
LCh2Lab_vec( im_object *argv )
{
return( im_LCh2Lab( argv[0], argv[1] ) );
}
/* Description of im_LCh2Lab.
*/
static im_function LCh2Lab_desc = {
"im_LCh2Lab", /* Name */
"convert LCh to Lab", /* Description */
IM_FN_PIO, /* Flags */
LCh2Lab_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Call im_LabQ2XYZ via arg vector.
*/
static int
LabQ2XYZ_vec( im_object *argv )
{
return( im_LabQ2XYZ( argv[0], argv[1] ) );
}
/* Description of im_LabQ2XYZ.
*/
static im_function LabQ2XYZ_desc = {
"im_LabQ2XYZ", /* Name */
"convert LabQ to XYZ", /* Description */
IM_FN_PIO, /* Flags */
LabQ2XYZ_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Call im_LCh2UCS via arg vector.
*/
static int
LCh2UCS_vec( im_object *argv )
{
return( im_LCh2UCS( argv[0], argv[1] ) );
}
/* Description of im_LCh2UCS.
*/
static im_function LCh2UCS_desc = {
"im_LCh2UCS", /* Name */
"convert LCh to UCS", /* Description */
IM_FN_PIO, /* Flags */
LCh2UCS_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Call im_Lab2LCh via arg vector.
*/
static int
Lab2LCh_vec( im_object *argv )
{
return( im_Lab2LCh( argv[0], argv[1] ) );
}
/* Description of im_Lab2LCh.
*/
static im_function Lab2LCh_desc = {
"im_Lab2LCh", /* Name */
"convert Lab to LCh", /* Description */
IM_FN_PIO, /* Flags */
Lab2LCh_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Call im_Lab2LabQ() via arg vector.
*/
static int
Lab2LabQ_vec( im_object *argv )
{
return( im_Lab2LabQ( argv[0], argv[1] ) );
}
/* Description of im_Lab2LabQ.
*/
static im_function Lab2LabQ_desc = {
"im_Lab2LabQ", /* Name */
"convert Lab to LabQ", /* Description */
IM_FN_PIO, /* Flags */
Lab2LabQ_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Call im_Lab2XYZ() via arg vector.
*/
static int
Lab2XYZ_vec( im_object *argv )
{
return( im_Lab2XYZ( argv[0], argv[1] ) );
}
/* Description of im_Lab2XYZ.
*/
static im_function Lab2XYZ_desc = {
"im_Lab2XYZ", /* Name */
"convert D65 Lab to XYZ", /* Description */
IM_FN_PIO, /* Flags */
Lab2XYZ_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
static int
icc_present_vec( im_object *argv )
{
int *present = ((int *) argv[0]);
*present = im_icc_present();
return( 0 );
}
static im_arg_desc icc_present_args[] = {
IM_OUTPUT_INT( "present" )
};
/* Description of im_icc_present.
*/
static im_function icc_present_desc = {
"im_icc_present", /* Name */
"test for presence of ICC library", /* Description */
0, /* Flags */
icc_present_vec, /* Dispatch function */
IM_NUMBER( icc_present_args ), /* Size of arg list */
icc_present_args /* Arg list */
};
static int
icc_transform_vec( im_object *argv )
{
int intent = *((int *) argv[4]);
return( im_icc_transform( argv[0], argv[1],
argv[2], argv[3], intent ) );
}
static im_arg_desc icc_transform_args[] = {
IM_INPUT_IMAGE( "in" ),
IM_OUTPUT_IMAGE( "out" ),
IM_INPUT_STRING( "input_profile" ),
IM_INPUT_STRING( "output_profile" ),
IM_INPUT_INT( "intent" )
};
/* Description of im_icc_transform.
*/
static im_function icc_transform_desc = {
"im_icc_transform", /* Name */
"convert between two device images with a pair of ICC profiles",
/* Description */
IM_FN_PIO, /* Flags */
icc_transform_vec, /* Dispatch function */
IM_NUMBER( icc_transform_args ), /* Size of arg list */
icc_transform_args /* Arg list */
};
static int
icc_import_embedded_vec( im_object *argv )
{
int intent = *((int *) argv[2]);
return( im_icc_import_embedded( argv[0], argv[1], intent ) );
}
static im_arg_desc icc_import_embedded_args[] = {
IM_INPUT_IMAGE( "in" ),
IM_OUTPUT_IMAGE( "out" ),
IM_INPUT_INT( "intent" )
};
/* Description of im_icc_import_embedded.
*/
static im_function icc_import_embedded_desc = {
"im_icc_import_embedded", /* Name */
"convert a device image to float LAB using the embedded profile",
/* Description */
IM_FN_PIO, /* Flags */
icc_import_embedded_vec, /* Dispatch function */
IM_NUMBER( icc_import_embedded_args ), /* Size of arg list */
icc_import_embedded_args /* Arg list */
};
static int
icc_import_vec( im_object *argv )
{
int intent = *((int *) argv[3]);
return( im_icc_import( argv[0], argv[1],
argv[2], intent ) );
}
static im_arg_desc icc_import_args[] = {
IM_INPUT_IMAGE( "in" ),
IM_OUTPUT_IMAGE( "out" ),
IM_INPUT_STRING( "input_profile" ),
IM_INPUT_INT( "intent" )
};
/* Description of im_icc_import.
*/
static im_function icc_import_desc = {
"im_icc_import", /* Name */
"convert a device image to float LAB with an ICC profile",
/* Description */
IM_FN_PIO, /* Flags */
icc_import_vec, /* Dispatch function */
IM_NUMBER( icc_import_args ), /* Size of arg list */
icc_import_args /* Arg list */
};
static int
icc_export_depth_vec( im_object *argv )
{
int intent = *((int *) argv[4]);
int depth = *((int *) argv[2]);
return( im_icc_export_depth( argv[0], argv[1],
depth, argv[3], intent ) );
}
static im_arg_desc icc_export_depth_args[] = {
IM_INPUT_IMAGE( "in" ),
IM_OUTPUT_IMAGE( "out" ),
IM_INPUT_INT( "depth" ),
IM_INPUT_STRING( "output_profile" ),
IM_INPUT_INT( "intent" )
};
/* Description of im_icc_export_depth.
*/
static im_function icc_export_depth_desc = {
"im_icc_export_depth", /* Name */
"convert a float LAB to device space with an ICC profile",
/* Description */
IM_FN_PIO, /* Flags */
icc_export_depth_vec, /* Dispatch function */
IM_NUMBER( icc_export_depth_args ), /* Size of arg list */
icc_export_depth_args /* Arg list */
};
static int
icc_ac2rc_vec( im_object *argv )
{
return( im_icc_ac2rc( argv[0], argv[1], argv[2] ) );
}
static im_arg_desc icc_ac2rc_args[] = {
IM_INPUT_IMAGE( "in" ),
IM_OUTPUT_IMAGE( "out" ),
IM_INPUT_STRING( "profile" )
};
/* Description of im_icc_ac2rc.
*/
static im_function icc_ac2rc_desc = {
"im_icc_ac2rc", /* Name */
"convert LAB from AC to RC using an ICC profile",
/* Description */
IM_FN_PIO, /* Flags */
icc_ac2rc_vec, /* Dispatch function */
IM_NUMBER( icc_ac2rc_args ), /* Size of arg list */
icc_ac2rc_args /* Arg list */
};
static int
Lab2XYZ_temp_vec( im_object *argv )
{
double X0 = *((double *) argv[2]);
double Y0 = *((double *) argv[3]);
double Z0 = *((double *) argv[4]);
return( im_Lab2XYZ_temp( argv[0], argv[1], X0, Y0, Z0 ) );
}
static im_arg_desc temp_args[] = {
IM_INPUT_IMAGE( "in" ),
IM_OUTPUT_IMAGE( "out" ),
IM_INPUT_DOUBLE( "X0" ),
IM_INPUT_DOUBLE( "Y0" ),
IM_INPUT_DOUBLE( "Z0" )
};
/* Description of im_Lab2XYZ_temp.
*/
static im_function Lab2XYZ_temp_desc = {
"im_Lab2XYZ_temp", /* Name */
"convert Lab to XYZ, with a specified colour temperature",
/* Description */
IM_FN_PIO, /* Flags */
Lab2XYZ_temp_vec, /* Dispatch function */
IM_NUMBER( temp_args ), /* Size of arg list */
temp_args /* Arg list */
};
/* Call im_Lab2UCS() via arg vector.
*/
static int
Lab2UCS_vec( im_object *argv )
{
return( im_Lab2UCS( argv[0], argv[1] ) );
}
/* Description of im_Lab2UCS.
*/
static im_function Lab2UCS_desc = {
"im_Lab2UCS", /* Name */
"convert Lab to UCS", /* Description */
IM_FN_PIO, /* Flags */
Lab2UCS_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Call im_LabQ2Lab() via arg vector.
*/
static int
LabQ2Lab_vec( im_object *argv )
{
return( im_LabQ2Lab( argv[0], argv[1] ) );
}
/* Description of im_LabQ2Lab.
*/
static im_function LabQ2Lab_desc = {
"im_LabQ2Lab", /* Name */
"convert LabQ to Lab", /* Description */
IM_FN_PIO, /* Flags */
LabQ2Lab_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Call im_rad2float() via arg vector.
*/
static int
rad2float_vec( im_object *argv )
{
return( im_rad2float( argv[0], argv[1] ) );
}
/* Description of im_rad2float.
*/
static im_function rad2float_desc = {
"im_rad2float", /* Name */
"convert Radiance packed to float", /* Description */
IM_FN_PIO, /* Flags */
rad2float_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Call im_float2rad() via arg vector.
*/
static int
float2rad_vec( im_object *argv )
{
return( im_float2rad( argv[0], argv[1] ) );
}
/* Description of im_float2rad
*/
static im_function float2rad_desc = {
"im_float2rad", /* Name */
"convert float to Radiance packed", /* Description */
IM_FN_PIO, /* Flags */
float2rad_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Call im_LabQ2LabS() via arg vector.
*/
static int
LabQ2LabS_vec( im_object *argv )
{
return( im_LabQ2LabS( argv[0], argv[1] ) );
}
/* Description of im_LabQ2LabS.
*/
static im_function LabQ2LabS_desc = {
"im_LabQ2LabS", /* Name */
"convert LabQ to LabS", /* Description */
IM_FN_PIO, /* Flags */
LabQ2LabS_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Call im_Lab2LabS() via arg vector.
*/
static int
Lab2LabS_vec( im_object *argv )
{
return( im_Lab2LabS( argv[0], argv[1] ) );
}
/* Description of im_Lab2LabS.
*/
static im_function Lab2LabS_desc = {
"im_Lab2LabS", /* Name */
"convert Lab to LabS", /* Description */
IM_FN_PIO, /* Flags */
Lab2LabS_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Call im_LabS2Lab() via arg vector.
*/
static int
LabS2Lab_vec( im_object *argv )
{
return( im_LabS2Lab( argv[0], argv[1] ) );
}
/* Description of im_LabS2Lab.
*/
static im_function LabS2Lab_desc = {
"im_LabS2Lab", /* Name */
"convert LabS to Lab", /* Description */
IM_FN_PIO, /* Flags */
LabS2Lab_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Call im_LabS2LabQ() via arg vector.
*/
static int
LabS2LabQ_vec( im_object *argv )
{
return( im_LabS2LabQ( argv[0], argv[1] ) );
}
/* Description of im_LabS2LabQ.
*/
static im_function LabS2LabQ_desc = {
"im_LabS2LabQ", /* Name */
"convert LabS to LabQ", /* Description */
IM_FN_PIO, /* Flags */
LabS2LabQ_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Call im_UCS2XYZ() via arg vector.
*/
static int
UCS2XYZ_vec( im_object *argv )
{
return( im_UCS2XYZ( argv[0], argv[1] ) );
}
/* Description of im_UCS2XYZ.
*/
static im_function UCS2XYZ_desc = {
"im_UCS2XYZ", /* Name */
"convert UCS to XYZ", /* Description */
IM_FN_PIO, /* Flags */
UCS2XYZ_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Call im_UCS2LCh() via arg vector.
*/
static int
UCS2LCh_vec( im_object *argv )
{
return( im_UCS2LCh( argv[0], argv[1] ) );
}
/* Description of im_UCS2LCh.
*/
static im_function UCS2LCh_desc = {
"im_UCS2LCh", /* Name */
"convert UCS to LCh", /* Description */
IM_FN_PIO, /* Flags */
UCS2LCh_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Call im_UCS2Lab() via arg vector.
*/
static int
UCS2Lab_vec( im_object *argv )
{
return( im_UCS2Lab( argv[0], argv[1] ) );
}
/* Description of im_UCS2Lab.
*/
static im_function UCS2Lab_desc = {
"im_UCS2Lab", /* Name */
"convert UCS to Lab", /* Description */
IM_FN_PIO, /* Flags */
UCS2Lab_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Call im_Yxy2XYZ via arg vector.
*/
static int
Yxy2XYZ_vec( im_object *argv )
{
return( im_Yxy2XYZ( argv[0], argv[1] ) );
}
/* Description of im_Yxy2XYZ.
*/
static im_function Yxy2XYZ_desc = {
"im_Yxy2XYZ", /* Name */
"convert Yxy to XYZ", /* Description */
IM_FN_PIO, /* Flags */
Yxy2XYZ_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Call im_XYZ2Yxy via arg vector.
*/
static int
XYZ2Yxy_vec( im_object *argv )
{
return( im_XYZ2Yxy( argv[0], argv[1] ) );
}
/* Description of im_XYZ2Yxy.
*/
static im_function XYZ2Yxy_desc = {
"im_XYZ2Yxy", /* Name */
"convert XYZ to Yxy", /* Description */
IM_FN_PIO, /* Flags */
XYZ2Yxy_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Call im_XYZ2Lab via arg vector.
*/
static int
XYZ2Lab_vec( im_object *argv )
{
return( im_XYZ2Lab( argv[0], argv[1] ) );
}
/* Description of im_XYZ2Lab.
*/
static im_function XYZ2Lab_desc = {
"im_XYZ2Lab", /* Name */
"convert D65 XYZ to Lab", /* Description */
IM_FN_PIO, /* Flags */
XYZ2Lab_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
static int
XYZ2Lab_temp_vec( im_object *argv )
{
double X0 = *((double *) argv[2]);
double Y0 = *((double *) argv[3]);
double Z0 = *((double *) argv[4]);
return( im_XYZ2Lab_temp( argv[0], argv[1], X0, Y0, Z0 ) );
}
/* Description of im_XYZ2Lab_temp.
*/
static im_function XYZ2Lab_temp_desc = {
"im_XYZ2Lab_temp", /* Name */
"convert XYZ to Lab, with a specified colour temperature",
/* Description */
IM_FN_PIO, /* Flags */
XYZ2Lab_temp_vec, /* Dispatch function */
IM_NUMBER( temp_args ), /* Size of arg list */
temp_args /* Arg list */
};
/* Call im_XYZ2UCS() via arg vector.
*/
static int
XYZ2UCS_vec( im_object *argv )
{
return( im_XYZ2UCS( argv[0], argv[1] ) );
}
/* Description of im_XYZ2UCS.
*/
static im_function XYZ2UCS_desc = {
"im_XYZ2UCS", /* Name */
"convert XYZ to UCS", /* Description */
IM_FN_PIO, /* Flags */
XYZ2UCS_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Args to XYZ2disp and disp2XYZ.
*/
static im_arg_desc XYZ2disp_args[] = {
IM_INPUT_IMAGE( "in" ),
IM_OUTPUT_IMAGE( "out" ),
IM_INPUT_DISPLAY( "disp" )
};
/* Call im_XYZ2disp() via arg vector.
*/
static int
XYZ2disp_vec( im_object *argv )
{
return( im_XYZ2disp( argv[0], argv[1], argv[2] ) );
}
/* Description of im_XYZ2disp.
*/
static im_function XYZ2disp_desc = {
"im_XYZ2disp", /* Name */
"convert XYZ to displayble", /* Description */
IM_FN_PIO, /* Flags */
XYZ2disp_vec, /* Dispatch function */
IM_NUMBER( XYZ2disp_args ), /* Size of arg list */
XYZ2disp_args /* Arg list */
};
/* Call im_Lab2disp() via arg vector.
*/
static int
Lab2disp_vec( im_object *argv )
{
return( im_Lab2disp( argv[0], argv[1], argv[2] ) );
}
/* Description of im_Lab2disp.
*/
static im_function Lab2disp_desc = {
"im_Lab2disp", /* Name */
"convert Lab to displayable", /* Description */
IM_FN_PIO, /* Flags */
Lab2disp_vec, /* Dispatch function */
IM_NUMBER( XYZ2disp_args ), /* Size of arg list */
XYZ2disp_args /* Arg list */
};
/* Call im_LabQ2disp() via arg vector.
*/
static int
LabQ2disp_vec( im_object *argv )
{
return( im_LabQ2disp( argv[0], argv[1], argv[2] ) );
}
/* Description of im_LabQ2disp.
*/
static im_function LabQ2disp_desc = {
"im_LabQ2disp", /* Name */
"convert LabQ to displayable", /* Description */
IM_FN_PIO, /* Flags */
LabQ2disp_vec, /* Dispatch function */
IM_NUMBER( XYZ2disp_args ), /* Size of arg list */
XYZ2disp_args /* Arg list */
};
/* Call im_dE00_fromLab() via arg vector.
*/
static int
dE00_fromLab_vec( im_object *argv )
{
return( im_dE00_fromLab( argv[0], argv[1], argv[2] ) );
}
/* Description of im_dE00_fromLab.
*/
static im_function dE00_fromLab_desc = {
"im_dE00_fromLab", /* Name */
"calculate delta-E CIE2000 for two Lab images",
IM_FN_PIO, /* Flags */
dE00_fromLab_vec, /* Dispatch function */
IM_NUMBER( two_in_one_out ), /* Size of arg list */
two_in_one_out /* Arg list */
};
/* Call im_dECMC_fromLab() via arg vector.
*/
static int
dECMC_fromLab_vec( im_object *argv )
{
return( im_dECMC_fromLab( argv[0], argv[1], argv[2] ) );
}
/* Description of im_dECMC_fromLab.
*/
static im_function dECMC_fromLab_desc = {
"im_dECMC_fromLab", /* Name */
"calculate delta-E CMC(1:1) for two Lab images",
IM_FN_PIO, /* Flags */
dECMC_fromLab_vec, /* Dispatch function */
IM_NUMBER( two_in_one_out ), /* Size of arg list */
two_in_one_out /* Arg list */
};
/* Call im_dE_fromXYZ() via arg vector.
*/
static int
dE_fromXYZ_vec( im_object *argv )
{
return( im_dE_fromXYZ( argv[0], argv[1], argv[2] ) );
}
/* Description of im_dE_fromXYZ.
*/
static im_function dE_fromXYZ_desc = {
"im_dE_fromXYZ", /* Name */
"calculate delta-E for two XYZ images",
IM_FN_PIO, /* Flags */
dE_fromXYZ_vec, /* Dispatch function */
IM_NUMBER( two_in_one_out ), /* Size of arg list */
two_in_one_out /* Arg list */
};
/* Call im_dE_fromLab() via arg vector.
*/
static int
dE_fromLab_vec( im_object *argv )
{
return( im_dE_fromLab( argv[0], argv[1], argv[2] ) );
}
/* Description of im_dE_fromLab.
*/
static im_function dE_fromLab_desc = {
"im_dE_fromLab", /* Name */
"calculate delta-E for two Lab images",
IM_FN_PIO, /* Flags */
dE_fromLab_vec, /* Dispatch function */
IM_NUMBER( two_in_one_out ), /* Size of arg list */
two_in_one_out /* Arg list */
};
/* Two images in, one out.
*/
static im_arg_desc dE_fromdisp_args[] = {
IM_INPUT_IMAGE( "in1" ),
IM_INPUT_IMAGE( "in2" ),
IM_OUTPUT_IMAGE( "out" ),
IM_INPUT_DISPLAY( "disp" )
};
/* Call im_dE_fromdisp() via arg vector.
*/
static int
dE_fromdisp_vec( im_object *argv )
{
return( im_dE_fromdisp( argv[0], argv[1], argv[2], argv[3] ) );
}
/* Description of im_dE_fromdisp.
*/
static im_function dE_fromdisp_desc = {
"im_dE_fromdisp", /* Name */
"calculate delta-E for two displayable images",
IM_FN_PIO, /* Flags */
dE_fromdisp_vec, /* Dispatch function */
IM_NUMBER( dE_fromdisp_args ), /* Size of arg list */
dE_fromdisp_args /* Arg list */
};
/* Call im_dECMC_fromdisp() via arg vector.
*/
static int
dECMC_fromdisp_vec( im_object *argv )
{
return( im_dECMC_fromdisp( argv[0], argv[1], argv[2], argv[3] ) );
}
/* Description of im_dECMC_fromdisp.
*/
static im_function dECMC_fromdisp_desc = {
"im_dECMC_fromdisp", /* Name */
"calculate delta-E CMC(1:1) for two displayable images",
IM_FN_PIO, /* Flags */
dECMC_fromdisp_vec, /* Dispatch function */
IM_NUMBER( dE_fromdisp_args ), /* Size of arg list */
dE_fromdisp_args /* Arg list */
};
/* Call im_disp2XYZ() via arg vector.
*/
static int
disp2XYZ_vec( im_object *argv )
{
return( im_disp2XYZ( argv[0], argv[1], argv[2] ) );
}
/* Description of im_disp2XYZ.
*/
static im_function disp2XYZ_desc = {
"im_disp2XYZ", /* Name */
"convert displayable to XYZ", /* Description */
IM_FN_PIO, /* Flags */
disp2XYZ_vec, /* Dispatch function */
IM_NUMBER( XYZ2disp_args ), /* Size of arg list */
XYZ2disp_args /* Arg list */
};
/* Call im_disp2Lab() via arg vector.
*/
static int
disp2Lab_vec( im_object *argv )
{
return( im_disp2Lab( argv[0], argv[1], argv[2] ) );
}
/* Description of im_disp2Lab.
*/
static im_function disp2Lab_desc = {
"im_disp2Lab", /* Name */
"convert displayable to Lab", /* Description */
IM_FN_PIO, /* Flags */
disp2Lab_vec, /* Dispatch function */
IM_NUMBER( XYZ2disp_args ), /* Size of arg list */
XYZ2disp_args /* Arg list */
};
static im_arg_desc morph_args[] = {
IM_INPUT_IMAGE( "in" ),
IM_OUTPUT_IMAGE( "out" ),
IM_INPUT_DMASK( "greyscale" ),
IM_INPUT_DOUBLE( "L_offset" ),
IM_INPUT_DOUBLE( "L_scale" ),
IM_INPUT_DOUBLE( "a_scale" ),
IM_INPUT_DOUBLE( "b_scale" )
};
static int
morph_vec( im_object *argv )
{
im_mask_object *mo = argv[2];
double L_offset = *((double *) argv[3]);
double L_scale = *((double *) argv[4]);
double a_scale = *((double *) argv[5]);
double b_scale = *((double *) argv[6]);
return( im_lab_morph( argv[0], argv[1],
mo->mask, L_offset, L_scale, a_scale, b_scale ) );
}
static im_function morph_desc = {
"im_lab_morph", /* Name */
"morph colourspace of a LAB image",
IM_FN_PIO | IM_FN_PTOP, /* Flags */
morph_vec, /* Dispatch function */
IM_NUMBER( morph_args ), /* Size of arg list */
morph_args /* Arg list */
};
/* Package up all these functions.
*/
static im_function *colour_list[] = {
&LCh2Lab_desc,
&LCh2UCS_desc,
&Lab2LCh_desc,
&Lab2LabQ_desc,
&Lab2LabS_desc,
&Lab2UCS_desc,
&Lab2XYZ_desc,
&Lab2XYZ_temp_desc,
&Lab2disp_desc,
&LabQ2LabS_desc,
&LabQ2Lab_desc,
&LabQ2XYZ_desc,
&LabQ2disp_desc,
&LabS2LabQ_desc,
&LabS2Lab_desc,
&UCS2LCh_desc,
&UCS2Lab_desc,
&UCS2XYZ_desc,
&XYZ2Lab_desc,
&XYZ2Lab_temp_desc,
&XYZ2UCS_desc,
&XYZ2Yxy_desc,
&XYZ2disp_desc,
&XYZ2sRGB_desc,
&Yxy2XYZ_desc,
&dE00_fromLab_desc,
&dECMC_fromLab_desc,
&dECMC_fromdisp_desc,
&dE_fromLab_desc,
&dE_fromXYZ_desc,
&dE_fromdisp_desc,
&disp2Lab_desc,
&disp2XYZ_desc,
&float2rad_desc,
&icc_ac2rc_desc,
&icc_export_depth_desc,
&icc_import_desc,
&icc_import_embedded_desc,
&icc_present_desc,
&icc_transform_desc,
&morph_desc,
&rad2float_desc,
&sRGB2XYZ_desc
};
/* Package of functions.
*/
im_package im__colour = {
"colour",
IM_NUMBER( colour_list ),
colour_list
};
|