1/*****************************************************************************/ 2// Copyright 2006-2007 Adobe Systems Incorporated 3// All Rights Reserved. 4// 5// NOTICE: Adobe permits you to use, modify, and distribute this file in 6// accordance with the terms of the Adobe license agreement accompanying it. 7/*****************************************************************************/ 8 9/* $Id: //mondo/dng_sdk_1_4/dng_sdk/source/dng_bottlenecks.h#1 $ */ 10/* $DateTime: 2012/05/30 13:28:51 $ */ 11/* $Change: 832332 $ */ 12/* $Author: tknoll $ */ 13 14/** \file 15 * Indirection mechanism for performance-critical routines that might be replaced 16 * with hand-optimized or hardware-specific implementations. 17 */ 18 19/*****************************************************************************/ 20 21#ifndef __dng_bottlenecks__ 22#define __dng_bottlenecks__ 23 24/*****************************************************************************/ 25 26#include "dng_classes.h" 27#include "dng_types.h" 28 29/*****************************************************************************/ 30 31typedef void (ZeroBytesProc) 32 (void *dPtr, 33 uint32 count); 34 35typedef void (CopyBytesProc) 36 (const void *sPtr, 37 void *dPtr, 38 uint32 count); 39 40/*****************************************************************************/ 41 42typedef void (SwapBytes16Proc) 43 (uint16 *dPtr, 44 uint32 count); 45 46typedef void (SwapBytes32Proc) 47 (uint32 *dPtr, 48 uint32 count); 49 50/*****************************************************************************/ 51 52typedef void (SetArea8Proc) 53 (uint8 *dPtr, 54 uint8 value, 55 uint32 rows, 56 uint32 cols, 57 uint32 planes, 58 int32 rowStep, 59 int32 colStep, 60 int32 planeStep); 61 62typedef void (SetArea16Proc) 63 (uint16 *dPtr, 64 uint16 value, 65 uint32 rows, 66 uint32 cols, 67 uint32 planes, 68 int32 rowStep, 69 int32 colStep, 70 int32 planeStep); 71 72typedef void (SetArea32Proc) 73 (uint32 *dPtr, 74 uint32 value, 75 uint32 rows, 76 uint32 cols, 77 uint32 planes, 78 int32 rowStep, 79 int32 colStep, 80 int32 planeStep); 81 82/*****************************************************************************/ 83 84typedef void (CopyArea8Proc) 85 (const uint8 *sPtr, 86 uint8 *dPtr, 87 uint32 rows, 88 uint32 cols, 89 uint32 planes, 90 int32 sRowStep, 91 int32 sColStep, 92 int32 sPlaneStep, 93 int32 dRowStep, 94 int32 dColStep, 95 int32 dPlaneStep); 96 97typedef void (CopyArea16Proc) 98 (const uint16 *sPtr, 99 uint16 *dPtr, 100 uint32 rows, 101 uint32 cols, 102 uint32 planes, 103 int32 sRowStep, 104 int32 sColStep, 105 int32 sPlaneStep, 106 int32 dRowStep, 107 int32 dColStep, 108 int32 dPlaneStep); 109 110typedef void (CopyArea32Proc) 111 (const uint32 *sPtr, 112 uint32 *dPtr, 113 uint32 rows, 114 uint32 cols, 115 uint32 planes, 116 int32 sRowStep, 117 int32 sColStep, 118 int32 sPlaneStep, 119 int32 dRowStep, 120 int32 dColStep, 121 int32 dPlaneStep); 122 123typedef void (CopyArea8_16Proc) 124 (const uint8 *sPtr, 125 uint16 *dPtr, 126 uint32 rows, 127 uint32 cols, 128 uint32 planes, 129 int32 sRowStep, 130 int32 sColStep, 131 int32 sPlaneStep, 132 int32 dRowStep, 133 int32 dColStep, 134 int32 dPlaneStep); 135 136typedef void (CopyArea8_S16Proc) 137 (const uint8 *sPtr, 138 int16 *dPtr, 139 uint32 rows, 140 uint32 cols, 141 uint32 planes, 142 int32 sRowStep, 143 int32 sColStep, 144 int32 sPlaneStep, 145 int32 dRowStep, 146 int32 dColStep, 147 int32 dPlaneStep); 148 149typedef void (CopyArea8_32Proc) 150 (const uint8 *sPtr, 151 uint32 *dPtr, 152 uint32 rows, 153 uint32 cols, 154 uint32 planes, 155 int32 sRowStep, 156 int32 sColStep, 157 int32 sPlaneStep, 158 int32 dRowStep, 159 int32 dColStep, 160 int32 dPlaneStep); 161 162typedef void (CopyArea16_S16Proc) 163 (const uint16 *sPtr, 164 int16 *dPtr, 165 uint32 rows, 166 uint32 cols, 167 uint32 planes, 168 int32 sRowStep, 169 int32 sColStep, 170 int32 sPlaneStep, 171 int32 dRowStep, 172 int32 dColStep, 173 int32 dPlaneStep); 174 175typedef void (CopyArea16_32Proc) 176 (const uint16 *sPtr, 177 uint32 *dPtr, 178 uint32 rows, 179 uint32 cols, 180 uint32 planes, 181 int32 sRowStep, 182 int32 sColStep, 183 int32 sPlaneStep, 184 int32 dRowStep, 185 int32 dColStep, 186 int32 dPlaneStep); 187 188typedef void (CopyArea8_R32Proc) 189 (const uint8 *sPtr, 190 real32 *dPtr, 191 uint32 rows, 192 uint32 cols, 193 uint32 planes, 194 int32 sRowStep, 195 int32 sColStep, 196 int32 sPlaneStep, 197 int32 dRowStep, 198 int32 dColStep, 199 int32 dPlaneStep, 200 uint32 pixelRange); 201 202typedef void (CopyArea16_R32Proc) 203 (const uint16 *sPtr, 204 real32 *dPtr, 205 uint32 rows, 206 uint32 cols, 207 uint32 planes, 208 int32 sRowStep, 209 int32 sColStep, 210 int32 sPlaneStep, 211 int32 dRowStep, 212 int32 dColStep, 213 int32 dPlaneStep, 214 uint32 pixelRange); 215 216typedef void (CopyAreaS16_R32Proc) 217 (const int16 *sPtr, 218 real32 *dPtr, 219 uint32 rows, 220 uint32 cols, 221 uint32 planes, 222 int32 sRowStep, 223 int32 sColStep, 224 int32 sPlaneStep, 225 int32 dRowStep, 226 int32 dColStep, 227 int32 dPlaneStep, 228 uint32 pixelRange); 229 230typedef void (CopyAreaR32_8Proc) 231 (const real32 *sPtr, 232 uint8 *dPtr, 233 uint32 rows, 234 uint32 cols, 235 uint32 planes, 236 int32 sRowStep, 237 int32 sColStep, 238 int32 sPlaneStep, 239 int32 dRowStep, 240 int32 dColStep, 241 int32 dPlaneStep, 242 uint32 pixelRange); 243 244typedef void (CopyAreaR32_16Proc) 245 (const real32 *sPtr, 246 uint16 *dPtr, 247 uint32 rows, 248 uint32 cols, 249 uint32 planes, 250 int32 sRowStep, 251 int32 sColStep, 252 int32 sPlaneStep, 253 int32 dRowStep, 254 int32 dColStep, 255 int32 dPlaneStep, 256 uint32 pixelRange); 257 258typedef void (CopyAreaR32_S16Proc) 259 (const real32 *sPtr, 260 int16 *dPtr, 261 uint32 rows, 262 uint32 cols, 263 uint32 planes, 264 int32 sRowStep, 265 int32 sColStep, 266 int32 sPlaneStep, 267 int32 dRowStep, 268 int32 dColStep, 269 int32 dPlaneStep, 270 uint32 pixelRange); 271 272/*****************************************************************************/ 273 274typedef void (RepeatArea8Proc) 275 (const uint8 *sPtr, 276 uint8 *dPtr, 277 uint32 rows, 278 uint32 cols, 279 uint32 planes, 280 int32 rowStep, 281 int32 colStep, 282 int32 planeStep, 283 uint32 repeatV, 284 uint32 repeatH, 285 uint32 phaseV, 286 uint32 phaseH); 287 288typedef void (RepeatArea16Proc) 289 (const uint16 *sPtr, 290 uint16 *dPtr, 291 uint32 rows, 292 uint32 cols, 293 uint32 planes, 294 int32 rowStep, 295 int32 colStep, 296 int32 planeStep, 297 uint32 repeatV, 298 uint32 repeatH, 299 uint32 phaseV, 300 uint32 phaseH); 301 302typedef void (RepeatArea32Proc) 303 (const uint32 *sPtr, 304 uint32 *dPtr, 305 uint32 rows, 306 uint32 cols, 307 uint32 planes, 308 int32 rowStep, 309 int32 colStep, 310 int32 planeStep, 311 uint32 repeatV, 312 uint32 repeatH, 313 uint32 phaseV, 314 uint32 phaseH); 315 316/*****************************************************************************/ 317 318typedef void (ShiftRight16Proc) 319 (uint16 *dPtr, 320 uint32 rows, 321 uint32 cols, 322 uint32 planes, 323 int32 rowStep, 324 int32 colStep, 325 int32 planeStep, 326 uint32 shift); 327 328/*****************************************************************************/ 329 330typedef void (BilinearRow16Proc) 331 (const uint16 *sPtr, 332 uint16 *dPtr, 333 uint32 cols, 334 uint32 patPhase, 335 uint32 patCount, 336 const uint32 * kernCounts, 337 const int32 * const * kernOffsets, 338 const uint16 * const * kernWeights, 339 uint32 sShift); 340 341typedef void (BilinearRow32Proc) 342 (const real32 *sPtr, 343 real32 *dPtr, 344 uint32 cols, 345 uint32 patPhase, 346 uint32 patCount, 347 const uint32 * kernCounts, 348 const int32 * const * kernOffsets, 349 const real32 * const * kernWeights, 350 uint32 sShift); 351 352/*****************************************************************************/ 353 354typedef void (BaselineABCtoRGBProc) 355 (const real32 *sPtrA, 356 const real32 *sPtrB, 357 const real32 *sPtrC, 358 real32 *dPtrR, 359 real32 *dPtrG, 360 real32 *dPtrB, 361 uint32 count, 362 const dng_vector &cameraWhite, 363 const dng_matrix &cameraToRGB); 364 365typedef void (BaselineABCDtoRGBProc) 366 (const real32 *sPtrA, 367 const real32 *sPtrB, 368 const real32 *sPtrC, 369 const real32 *sPtrD, 370 real32 *dPtrR, 371 real32 *dPtrG, 372 real32 *dPtrB, 373 uint32 count, 374 const dng_vector &cameraWhite, 375 const dng_matrix &cameraToRGB); 376 377/*****************************************************************************/ 378 379typedef void (BaselineHueSatMapProc) 380 (const real32 *sPtrR, 381 const real32 *sPtrG, 382 const real32 *sPtrB, 383 real32 *dPtrR, 384 real32 *dPtrG, 385 real32 *dPtrB, 386 uint32 count, 387 const dng_hue_sat_map &lut, 388 const dng_1d_table *encodeTable, 389 const dng_1d_table *decodeTable); 390 391/*****************************************************************************/ 392 393typedef void (BaselineGrayToRGBProc) 394 (const real32 *sPtrR, 395 const real32 *sPtrG, 396 const real32 *sPtrB, 397 real32 *dPtrG, 398 uint32 count, 399 const dng_matrix &matrix); 400 401typedef void (BaselineRGBtoRGBProc) 402 (const real32 *sPtrR, 403 const real32 *sPtrG, 404 const real32 *sPtrB, 405 real32 *dPtrR, 406 real32 *dPtrG, 407 real32 *dPtrB, 408 uint32 count, 409 const dng_matrix &matrix); 410 411/*****************************************************************************/ 412 413typedef void (Baseline1DTableProc) 414 (const real32 *sPtr, 415 real32 *dPtr, 416 uint32 count, 417 const dng_1d_table &table); 418 419/*****************************************************************************/ 420 421typedef void (BaselineRGBToneProc) 422 (const real32 *sPtrR, 423 const real32 *sPtrG, 424 const real32 *sPtrB, 425 real32 *dPtrR, 426 real32 *dPtrG, 427 real32 *dPtrB, 428 uint32 count, 429 const dng_1d_table &table); 430 431/*****************************************************************************/ 432 433typedef void (ResampleDown16Proc) 434 (const uint16 *sPtr, 435 uint16 *dPtr, 436 uint32 sCount, 437 int32 sRowStep, 438 const int16 *wPtr, 439 uint32 wCount, 440 uint32 pixelRange); 441 442typedef void (ResampleDown32Proc) 443 (const real32 *sPtr, 444 real32 *dPtr, 445 uint32 sCount, 446 int32 sRowStep, 447 const real32 *wPtr, 448 uint32 wCount); 449 450/*****************************************************************************/ 451 452typedef void (ResampleAcross16Proc) 453 (const uint16 *sPtr, 454 uint16 *dPtr, 455 uint32 dCount, 456 const int32 *coord, 457 const int16 *wPtr, 458 uint32 wCount, 459 uint32 wStep, 460 uint32 pixelRange); 461 462typedef void (ResampleAcross32Proc) 463 (const real32 *sPtr, 464 real32 *dPtr, 465 uint32 dCount, 466 const int32 *coord, 467 const real32 *wPtr, 468 uint32 wCount, 469 uint32 wStep); 470 471/*****************************************************************************/ 472 473typedef bool (EqualBytesProc) 474 (const void *sPtr, 475 const void *dPtr, 476 uint32 count); 477 478typedef bool (EqualArea8Proc) 479 (const uint8 *sPtr, 480 const uint8 *dPtr, 481 uint32 rows, 482 uint32 cols, 483 uint32 planes, 484 int32 sRowStep, 485 int32 sColStep, 486 int32 sPlaneStep, 487 int32 dRowStep, 488 int32 dColStep, 489 int32 dPlaneStep); 490 491typedef bool (EqualArea16Proc) 492 (const uint16 *sPtr, 493 const uint16 *dPtr, 494 uint32 rows, 495 uint32 cols, 496 uint32 planes, 497 int32 sRowStep, 498 int32 sColStep, 499 int32 sPlaneStep, 500 int32 dRowStep, 501 int32 dColStep, 502 int32 dPlaneStep); 503 504typedef bool (EqualArea32Proc) 505 (const uint32 *sPtr, 506 const uint32 *dPtr, 507 uint32 rows, 508 uint32 cols, 509 uint32 planes, 510 int32 sRowStep, 511 int32 sColStep, 512 int32 sPlaneStep, 513 int32 dRowStep, 514 int32 dColStep, 515 int32 dPlaneStep); 516 517/*****************************************************************************/ 518 519typedef void (VignetteMask16Proc) 520 (uint16 *mPtr, 521 uint32 rows, 522 uint32 cols, 523 int32 rowStep, 524 int64 offsetH, 525 int64 offsetV, 526 int64 stepH, 527 int64 stepV, 528 uint32 tBits, 529 const uint16 *table); 530 531typedef void (Vignette16Proc) 532 (int16 *sPtr, 533 const uint16 *mPtr, 534 uint32 rows, 535 uint32 cols, 536 uint32 planes, 537 int32 sRowStep, 538 int32 sPlaneStep, 539 int32 mRowStep, 540 uint32 mBits); 541 542/*****************************************************************************/ 543 544typedef void (Vignette32Proc) 545 (real32 *sPtr, 546 const uint16 *mPtr, 547 uint32 rows, 548 uint32 cols, 549 uint32 planes, 550 int32 sRowStep, 551 int32 sPlaneStep, 552 int32 mRowStep, 553 uint32 mBits); 554 555/*****************************************************************************/ 556 557typedef void (MapArea16Proc) 558 (uint16 *dPtr, 559 uint32 count0, 560 uint32 count1, 561 uint32 count2, 562 int32 step0, 563 int32 step1, 564 int32 step2, 565 const uint16 *map); 566 567/*****************************************************************************/ 568 569struct dng_suite 570 { 571 ZeroBytesProc *ZeroBytes; 572 CopyBytesProc *CopyBytes; 573 SwapBytes16Proc *SwapBytes16; 574 SwapBytes32Proc *SwapBytes32; 575 SetArea8Proc *SetArea8; 576 SetArea16Proc *SetArea16; 577 SetArea32Proc *SetArea32; 578 CopyArea8Proc *CopyArea8; 579 CopyArea16Proc *CopyArea16; 580 CopyArea32Proc *CopyArea32; 581 CopyArea8_16Proc *CopyArea8_16; 582 CopyArea8_S16Proc *CopyArea8_S16; 583 CopyArea8_32Proc *CopyArea8_32; 584 CopyArea16_S16Proc *CopyArea16_S16; 585 CopyArea16_32Proc *CopyArea16_32; 586 CopyArea8_R32Proc *CopyArea8_R32; 587 CopyArea16_R32Proc *CopyArea16_R32; 588 CopyAreaS16_R32Proc *CopyAreaS16_R32; 589 CopyAreaR32_8Proc *CopyAreaR32_8; 590 CopyAreaR32_16Proc *CopyAreaR32_16; 591 CopyAreaR32_S16Proc *CopyAreaR32_S16; 592 RepeatArea8Proc *RepeatArea8; 593 RepeatArea16Proc *RepeatArea16; 594 RepeatArea32Proc *RepeatArea32; 595 ShiftRight16Proc *ShiftRight16; 596 BilinearRow16Proc *BilinearRow16; 597 BilinearRow32Proc *BilinearRow32; 598 BaselineABCtoRGBProc *BaselineABCtoRGB; 599 BaselineABCDtoRGBProc *BaselineABCDtoRGB; 600 BaselineHueSatMapProc *BaselineHueSatMap; 601 BaselineGrayToRGBProc *BaselineRGBtoGray; 602 BaselineRGBtoRGBProc *BaselineRGBtoRGB; 603 Baseline1DTableProc *Baseline1DTable; 604 BaselineRGBToneProc *BaselineRGBTone; 605 ResampleDown16Proc *ResampleDown16; 606 ResampleDown32Proc *ResampleDown32; 607 ResampleAcross16Proc *ResampleAcross16; 608 ResampleAcross32Proc *ResampleAcross32; 609 EqualBytesProc *EqualBytes; 610 EqualArea8Proc *EqualArea8; 611 EqualArea16Proc *EqualArea16; 612 EqualArea32Proc *EqualArea32; 613 VignetteMask16Proc *VignetteMask16; 614 Vignette16Proc *Vignette16; 615 Vignette32Proc *Vignette32; 616 MapArea16Proc *MapArea16; 617 }; 618 619/*****************************************************************************/ 620 621extern dng_suite gDNGSuite; 622 623/*****************************************************************************/ 624 625inline void DoZeroBytes (void *dPtr, 626 uint32 count) 627 { 628 629 (gDNGSuite.ZeroBytes) (dPtr, 630 count); 631 632 } 633 634inline void DoCopyBytes (const void *sPtr, 635 void *dPtr, 636 uint32 count) 637 { 638 639 (gDNGSuite.CopyBytes) (sPtr, 640 dPtr, 641 count); 642 643 } 644 645/*****************************************************************************/ 646 647inline void DoSwapBytes16 (uint16 *dPtr, 648 uint32 count) 649 { 650 651 (gDNGSuite.SwapBytes16) (dPtr, 652 count); 653 654 } 655 656inline void DoSwapBytes32 (uint32 *dPtr, 657 uint32 count) 658 { 659 660 (gDNGSuite.SwapBytes32) (dPtr, 661 count); 662 663 } 664 665/*****************************************************************************/ 666 667inline void DoSetArea8 (uint8 *dPtr, 668 uint8 value, 669 uint32 rows, 670 uint32 cols, 671 uint32 planes, 672 int32 rowStep, 673 int32 colStep, 674 int32 planeStep) 675 { 676 677 (gDNGSuite.SetArea8) (dPtr, 678 value, 679 rows, 680 cols, 681 planes, 682 rowStep, 683 colStep, 684 planeStep); 685 686 } 687 688inline void DoSetArea16 (uint16 *dPtr, 689 uint16 value, 690 uint32 rows, 691 uint32 cols, 692 uint32 planes, 693 int32 rowStep, 694 int32 colStep, 695 int32 planeStep) 696 { 697 698 (gDNGSuite.SetArea16) (dPtr, 699 value, 700 rows, 701 cols, 702 planes, 703 rowStep, 704 colStep, 705 planeStep); 706 707 } 708 709inline void DoSetArea32 (uint32 *dPtr, 710 uint32 value, 711 uint32 rows, 712 uint32 cols, 713 uint32 planes, 714 int32 rowStep, 715 int32 colStep, 716 int32 planeStep) 717 { 718 719 (gDNGSuite.SetArea32) (dPtr, 720 value, 721 rows, 722 cols, 723 planes, 724 rowStep, 725 colStep, 726 planeStep); 727 728 } 729 730/*****************************************************************************/ 731 732inline void DoCopyArea8 (const uint8 *sPtr, 733 uint8 *dPtr, 734 uint32 rows, 735 uint32 cols, 736 uint32 planes, 737 int32 sRowStep, 738 int32 sColStep, 739 int32 sPlaneStep, 740 int32 dRowStep, 741 int32 dColStep, 742 int32 dPlaneStep) 743 { 744 745 (gDNGSuite.CopyArea8) (sPtr, 746 dPtr, 747 rows, 748 cols, 749 planes, 750 sRowStep, 751 sColStep, 752 sPlaneStep, 753 dRowStep, 754 dColStep, 755 dPlaneStep); 756 757 } 758 759inline void DoCopyArea16 (const uint16 *sPtr, 760 uint16 *dPtr, 761 uint32 rows, 762 uint32 cols, 763 uint32 planes, 764 int32 sRowStep, 765 int32 sColStep, 766 int32 sPlaneStep, 767 int32 dRowStep, 768 int32 dColStep, 769 int32 dPlaneStep) 770 { 771 772 (gDNGSuite.CopyArea16) (sPtr, 773 dPtr, 774 rows, 775 cols, 776 planes, 777 sRowStep, 778 sColStep, 779 sPlaneStep, 780 dRowStep, 781 dColStep, 782 dPlaneStep); 783 784 } 785 786inline void DoCopyArea32 (const uint32 *sPtr, 787 uint32 *dPtr, 788 uint32 rows, 789 uint32 cols, 790 uint32 planes, 791 int32 sRowStep, 792 int32 sColStep, 793 int32 sPlaneStep, 794 int32 dRowStep, 795 int32 dColStep, 796 int32 dPlaneStep) 797 { 798 799 (gDNGSuite.CopyArea32) (sPtr, 800 dPtr, 801 rows, 802 cols, 803 planes, 804 sRowStep, 805 sColStep, 806 sPlaneStep, 807 dRowStep, 808 dColStep, 809 dPlaneStep); 810 811 } 812 813inline void DoCopyArea8_16 (const uint8 *sPtr, 814 uint16 *dPtr, 815 uint32 rows, 816 uint32 cols, 817 uint32 planes, 818 int32 sRowStep, 819 int32 sColStep, 820 int32 sPlaneStep, 821 int32 dRowStep, 822 int32 dColStep, 823 int32 dPlaneStep) 824 { 825 826 (gDNGSuite.CopyArea8_16) (sPtr, 827 dPtr, 828 rows, 829 cols, 830 planes, 831 sRowStep, 832 sColStep, 833 sPlaneStep, 834 dRowStep, 835 dColStep, 836 dPlaneStep); 837 838 } 839 840inline void DoCopyArea8_S16 (const uint8 *sPtr, 841 int16 *dPtr, 842 uint32 rows, 843 uint32 cols, 844 uint32 planes, 845 int32 sRowStep, 846 int32 sColStep, 847 int32 sPlaneStep, 848 int32 dRowStep, 849 int32 dColStep, 850 int32 dPlaneStep) 851 { 852 853 (gDNGSuite.CopyArea8_S16) (sPtr, 854 dPtr, 855 rows, 856 cols, 857 planes, 858 sRowStep, 859 sColStep, 860 sPlaneStep, 861 dRowStep, 862 dColStep, 863 dPlaneStep); 864 865 } 866 867inline void DoCopyArea8_32 (const uint8 *sPtr, 868 uint32 *dPtr, 869 uint32 rows, 870 uint32 cols, 871 uint32 planes, 872 int32 sRowStep, 873 int32 sColStep, 874 int32 sPlaneStep, 875 int32 dRowStep, 876 int32 dColStep, 877 int32 dPlaneStep) 878 { 879 880 (gDNGSuite.CopyArea8_32) (sPtr, 881 dPtr, 882 rows, 883 cols, 884 planes, 885 sRowStep, 886 sColStep, 887 sPlaneStep, 888 dRowStep, 889 dColStep, 890 dPlaneStep); 891 892 } 893 894inline void DoCopyArea16_S16 (const uint16 *sPtr, 895 int16 *dPtr, 896 uint32 rows, 897 uint32 cols, 898 uint32 planes, 899 int32 sRowStep, 900 int32 sColStep, 901 int32 sPlaneStep, 902 int32 dRowStep, 903 int32 dColStep, 904 int32 dPlaneStep) 905 { 906 907 (gDNGSuite.CopyArea16_S16) (sPtr, 908 dPtr, 909 rows, 910 cols, 911 planes, 912 sRowStep, 913 sColStep, 914 sPlaneStep, 915 dRowStep, 916 dColStep, 917 dPlaneStep); 918 919 } 920 921inline void DoCopyArea16_32 (const uint16 *sPtr, 922 uint32 *dPtr, 923 uint32 rows, 924 uint32 cols, 925 uint32 planes, 926 int32 sRowStep, 927 int32 sColStep, 928 int32 sPlaneStep, 929 int32 dRowStep, 930 int32 dColStep, 931 int32 dPlaneStep) 932 { 933 934 (gDNGSuite.CopyArea16_32) (sPtr, 935 dPtr, 936 rows, 937 cols, 938 planes, 939 sRowStep, 940 sColStep, 941 sPlaneStep, 942 dRowStep, 943 dColStep, 944 dPlaneStep); 945 946 } 947 948inline void DoCopyArea8_R32 (const uint8 *sPtr, 949 real32 *dPtr, 950 uint32 rows, 951 uint32 cols, 952 uint32 planes, 953 int32 sRowStep, 954 int32 sColStep, 955 int32 sPlaneStep, 956 int32 dRowStep, 957 int32 dColStep, 958 int32 dPlaneStep, 959 uint32 pixelRange) 960 { 961 962 (gDNGSuite.CopyArea8_R32) (sPtr, 963 dPtr, 964 rows, 965 cols, 966 planes, 967 sRowStep, 968 sColStep, 969 sPlaneStep, 970 dRowStep, 971 dColStep, 972 dPlaneStep, 973 pixelRange); 974 975 } 976 977inline void DoCopyArea16_R32 (const uint16 *sPtr, 978 real32 *dPtr, 979 uint32 rows, 980 uint32 cols, 981 uint32 planes, 982 int32 sRowStep, 983 int32 sColStep, 984 int32 sPlaneStep, 985 int32 dRowStep, 986 int32 dColStep, 987 int32 dPlaneStep, 988 uint32 pixelRange) 989 { 990 991 (gDNGSuite.CopyArea16_R32) (sPtr, 992 dPtr, 993 rows, 994 cols, 995 planes, 996 sRowStep, 997 sColStep, 998 sPlaneStep, 999 dRowStep, 1000 dColStep, 1001 dPlaneStep, 1002 pixelRange); 1003 1004 } 1005 1006inline void DoCopyAreaS16_R32 (const int16 *sPtr, 1007 real32 *dPtr, 1008 uint32 rows, 1009 uint32 cols, 1010 uint32 planes, 1011 int32 sRowStep, 1012 int32 sColStep, 1013 int32 sPlaneStep, 1014 int32 dRowStep, 1015 int32 dColStep, 1016 int32 dPlaneStep, 1017 uint32 pixelRange) 1018 { 1019 1020 (gDNGSuite.CopyAreaS16_R32) (sPtr, 1021 dPtr, 1022 rows, 1023 cols, 1024 planes, 1025 sRowStep, 1026 sColStep, 1027 sPlaneStep, 1028 dRowStep, 1029 dColStep, 1030 dPlaneStep, 1031 pixelRange); 1032 1033 } 1034 1035inline void DoCopyAreaR32_8 (const real32 *sPtr, 1036 uint8 *dPtr, 1037 uint32 rows, 1038 uint32 cols, 1039 uint32 planes, 1040 int32 sRowStep, 1041 int32 sColStep, 1042 int32 sPlaneStep, 1043 int32 dRowStep, 1044 int32 dColStep, 1045 int32 dPlaneStep, 1046 uint32 pixelRange) 1047 { 1048 1049 (gDNGSuite.CopyAreaR32_8) (sPtr, 1050 dPtr, 1051 rows, 1052 cols, 1053 planes, 1054 sRowStep, 1055 sColStep, 1056 sPlaneStep, 1057 dRowStep, 1058 dColStep, 1059 dPlaneStep, 1060 pixelRange); 1061 1062 } 1063 1064inline void DoCopyAreaR32_16 (const real32 *sPtr, 1065 uint16 *dPtr, 1066 uint32 rows, 1067 uint32 cols, 1068 uint32 planes, 1069 int32 sRowStep, 1070 int32 sColStep, 1071 int32 sPlaneStep, 1072 int32 dRowStep, 1073 int32 dColStep, 1074 int32 dPlaneStep, 1075 uint32 pixelRange) 1076 { 1077 1078 (gDNGSuite.CopyAreaR32_16) (sPtr, 1079 dPtr, 1080 rows, 1081 cols, 1082 planes, 1083 sRowStep, 1084 sColStep, 1085 sPlaneStep, 1086 dRowStep, 1087 dColStep, 1088 dPlaneStep, 1089 pixelRange); 1090 1091 } 1092 1093inline void DoCopyAreaR32_S16 (const real32 *sPtr, 1094 int16 *dPtr, 1095 uint32 rows, 1096 uint32 cols, 1097 uint32 planes, 1098 int32 sRowStep, 1099 int32 sColStep, 1100 int32 sPlaneStep, 1101 int32 dRowStep, 1102 int32 dColStep, 1103 int32 dPlaneStep, 1104 uint32 pixelRange) 1105 { 1106 1107 (gDNGSuite.CopyAreaR32_S16) (sPtr, 1108 dPtr, 1109 rows, 1110 cols, 1111 planes, 1112 sRowStep, 1113 sColStep, 1114 sPlaneStep, 1115 dRowStep, 1116 dColStep, 1117 dPlaneStep, 1118 pixelRange); 1119 1120 } 1121 1122/*****************************************************************************/ 1123 1124inline void DoRepeatArea8 (const uint8 *sPtr, 1125 uint8 *dPtr, 1126 uint32 rows, 1127 uint32 cols, 1128 uint32 planes, 1129 int32 rowStep, 1130 int32 colStep, 1131 int32 planeStep, 1132 uint32 repeatV, 1133 uint32 repeatH, 1134 uint32 phaseV, 1135 uint32 phaseH) 1136 { 1137 1138 (gDNGSuite.RepeatArea8) (sPtr, 1139 dPtr, 1140 rows, 1141 cols, 1142 planes, 1143 rowStep, 1144 colStep, 1145 planeStep, 1146 repeatV, 1147 repeatH, 1148 phaseV, 1149 phaseH); 1150 1151 } 1152 1153inline void DoRepeatArea16 (const uint16 *sPtr, 1154 uint16 *dPtr, 1155 uint32 rows, 1156 uint32 cols, 1157 uint32 planes, 1158 int32 rowStep, 1159 int32 colStep, 1160 int32 planeStep, 1161 uint32 repeatV, 1162 uint32 repeatH, 1163 uint32 phaseV, 1164 uint32 phaseH) 1165 { 1166 1167 (gDNGSuite.RepeatArea16) (sPtr, 1168 dPtr, 1169 rows, 1170 cols, 1171 planes, 1172 rowStep, 1173 colStep, 1174 planeStep, 1175 repeatV, 1176 repeatH, 1177 phaseV, 1178 phaseH); 1179 1180 } 1181 1182inline void DoRepeatArea32 (const uint32 *sPtr, 1183 uint32 *dPtr, 1184 uint32 rows, 1185 uint32 cols, 1186 uint32 planes, 1187 int32 rowStep, 1188 int32 colStep, 1189 int32 planeStep, 1190 uint32 repeatV, 1191 uint32 repeatH, 1192 uint32 phaseV, 1193 uint32 phaseH) 1194 { 1195 1196 (gDNGSuite.RepeatArea32) (sPtr, 1197 dPtr, 1198 rows, 1199 cols, 1200 planes, 1201 rowStep, 1202 colStep, 1203 planeStep, 1204 repeatV, 1205 repeatH, 1206 phaseV, 1207 phaseH); 1208 1209 } 1210 1211/*****************************************************************************/ 1212 1213inline void DoShiftRight16 (uint16 *dPtr, 1214 uint32 rows, 1215 uint32 cols, 1216 uint32 planes, 1217 int32 rowStep, 1218 int32 colStep, 1219 int32 planeStep, 1220 uint32 shift) 1221 { 1222 1223 (gDNGSuite.ShiftRight16) (dPtr, 1224 rows, 1225 cols, 1226 planes, 1227 rowStep, 1228 colStep, 1229 planeStep, 1230 shift); 1231 1232 } 1233 1234/*****************************************************************************/ 1235 1236inline void DoBilinearRow16 (const uint16 *sPtr, 1237 uint16 *dPtr, 1238 uint32 cols, 1239 uint32 patPhase, 1240 uint32 patCount, 1241 const uint32 * kernCounts, 1242 const int32 * const * kernOffsets, 1243 const uint16 * const * kernWeights, 1244 uint32 sShift) 1245 { 1246 1247 (gDNGSuite.BilinearRow16) (sPtr, 1248 dPtr, 1249 cols, 1250 patPhase, 1251 patCount, 1252 kernCounts, 1253 kernOffsets, 1254 kernWeights, 1255 sShift); 1256 1257 } 1258 1259inline void DoBilinearRow32 (const real32 *sPtr, 1260 real32 *dPtr, 1261 uint32 cols, 1262 uint32 patPhase, 1263 uint32 patCount, 1264 const uint32 * kernCounts, 1265 const int32 * const * kernOffsets, 1266 const real32 * const * kernWeights, 1267 uint32 sShift) 1268 { 1269 1270 (gDNGSuite.BilinearRow32) (sPtr, 1271 dPtr, 1272 cols, 1273 patPhase, 1274 patCount, 1275 kernCounts, 1276 kernOffsets, 1277 kernWeights, 1278 sShift); 1279 1280 } 1281 1282/*****************************************************************************/ 1283 1284inline void DoBaselineABCtoRGB (const real32 *sPtrA, 1285 const real32 *sPtrB, 1286 const real32 *sPtrC, 1287 real32 *dPtrR, 1288 real32 *dPtrG, 1289 real32 *dPtrB, 1290 uint32 count, 1291 const dng_vector &cameraWhite, 1292 const dng_matrix &cameraToRGB) 1293 { 1294 1295 (gDNGSuite.BaselineABCtoRGB) (sPtrA, 1296 sPtrB, 1297 sPtrC, 1298 dPtrR, 1299 dPtrG, 1300 dPtrB, 1301 count, 1302 cameraWhite, 1303 cameraToRGB); 1304 1305 } 1306 1307inline void DoBaselineABCDtoRGB (const real32 *sPtrA, 1308 const real32 *sPtrB, 1309 const real32 *sPtrC, 1310 const real32 *sPtrD, 1311 real32 *dPtrR, 1312 real32 *dPtrG, 1313 real32 *dPtrB, 1314 uint32 count, 1315 const dng_vector &cameraWhite, 1316 const dng_matrix &cameraToRGB) 1317 { 1318 1319 (gDNGSuite.BaselineABCDtoRGB) (sPtrA, 1320 sPtrB, 1321 sPtrC, 1322 sPtrD, 1323 dPtrR, 1324 dPtrG, 1325 dPtrB, 1326 count, 1327 cameraWhite, 1328 cameraToRGB); 1329 1330 } 1331 1332/*****************************************************************************/ 1333 1334inline void DoBaselineHueSatMap (const real32 *sPtrR, 1335 const real32 *sPtrG, 1336 const real32 *sPtrB, 1337 real32 *dPtrR, 1338 real32 *dPtrG, 1339 real32 *dPtrB, 1340 uint32 count, 1341 const dng_hue_sat_map &lut, 1342 const dng_1d_table *encodeTable, 1343 const dng_1d_table *decodeTable) 1344 { 1345 1346 (gDNGSuite.BaselineHueSatMap) (sPtrR, 1347 sPtrG, 1348 sPtrB, 1349 dPtrR, 1350 dPtrG, 1351 dPtrB, 1352 count, 1353 lut, 1354 encodeTable, 1355 decodeTable); 1356 1357 } 1358 1359/*****************************************************************************/ 1360 1361inline void DoBaselineRGBtoGray (const real32 *sPtrR, 1362 const real32 *sPtrG, 1363 const real32 *sPtrB, 1364 real32 *dPtrG, 1365 uint32 count, 1366 const dng_matrix &matrix) 1367 { 1368 1369 (gDNGSuite.BaselineRGBtoGray) (sPtrR, 1370 sPtrG, 1371 sPtrB, 1372 dPtrG, 1373 count, 1374 matrix); 1375 1376 } 1377 1378inline void DoBaselineRGBtoRGB (const real32 *sPtrR, 1379 const real32 *sPtrG, 1380 const real32 *sPtrB, 1381 real32 *dPtrR, 1382 real32 *dPtrG, 1383 real32 *dPtrB, 1384 uint32 count, 1385 const dng_matrix &matrix) 1386 { 1387 1388 (gDNGSuite.BaselineRGBtoRGB) (sPtrR, 1389 sPtrG, 1390 sPtrB, 1391 dPtrR, 1392 dPtrG, 1393 dPtrB, 1394 count, 1395 matrix); 1396 1397 } 1398 1399/*****************************************************************************/ 1400 1401inline void DoBaseline1DTable (const real32 *sPtr, 1402 real32 *dPtr, 1403 uint32 count, 1404 const dng_1d_table &table) 1405 { 1406 1407 (gDNGSuite.Baseline1DTable) (sPtr, 1408 dPtr, 1409 count, 1410 table); 1411 1412 } 1413 1414/*****************************************************************************/ 1415 1416inline void DoBaselineRGBTone (const real32 *sPtrR, 1417 const real32 *sPtrG, 1418 const real32 *sPtrB, 1419 real32 *dPtrR, 1420 real32 *dPtrG, 1421 real32 *dPtrB, 1422 uint32 count, 1423 const dng_1d_table &table) 1424 { 1425 1426 (gDNGSuite.BaselineRGBTone) (sPtrR, 1427 sPtrG, 1428 sPtrB, 1429 dPtrR, 1430 dPtrG, 1431 dPtrB, 1432 count, 1433 table); 1434 1435 } 1436 1437/*****************************************************************************/ 1438 1439inline void DoResampleDown16 (const uint16 *sPtr, 1440 uint16 *dPtr, 1441 uint32 sCount, 1442 int32 sRowStep, 1443 const int16 *wPtr, 1444 uint32 wCount, 1445 uint32 pixelRange) 1446 { 1447 1448 (gDNGSuite.ResampleDown16) (sPtr, 1449 dPtr, 1450 sCount, 1451 sRowStep, 1452 wPtr, 1453 wCount, 1454 pixelRange); 1455 1456 } 1457 1458inline void DoResampleDown32 (const real32 *sPtr, 1459 real32 *dPtr, 1460 uint32 sCount, 1461 int32 sRowStep, 1462 const real32 *wPtr, 1463 uint32 wCount) 1464 { 1465 1466 (gDNGSuite.ResampleDown32) (sPtr, 1467 dPtr, 1468 sCount, 1469 sRowStep, 1470 wPtr, 1471 wCount); 1472 1473 } 1474 1475/*****************************************************************************/ 1476 1477inline void DoResampleAcross16 (const uint16 *sPtr, 1478 uint16 *dPtr, 1479 uint32 dCount, 1480 const int32 *coord, 1481 const int16 *wPtr, 1482 uint32 wCount, 1483 uint32 wStep, 1484 uint32 pixelRange) 1485 { 1486 1487 (gDNGSuite.ResampleAcross16) (sPtr, 1488 dPtr, 1489 dCount, 1490 coord, 1491 wPtr, 1492 wCount, 1493 wStep, 1494 pixelRange); 1495 1496 } 1497 1498inline void DoResampleAcross32 (const real32 *sPtr, 1499 real32 *dPtr, 1500 uint32 dCount, 1501 const int32 *coord, 1502 const real32 *wPtr, 1503 uint32 wCount, 1504 uint32 wStep) 1505 { 1506 1507 (gDNGSuite.ResampleAcross32) (sPtr, 1508 dPtr, 1509 dCount, 1510 coord, 1511 wPtr, 1512 wCount, 1513 wStep); 1514 1515 } 1516 1517/*****************************************************************************/ 1518 1519inline bool DoEqualBytes (const void *sPtr, 1520 const void *dPtr, 1521 uint32 count) 1522 { 1523 1524 return (gDNGSuite.EqualBytes) (sPtr, 1525 dPtr, 1526 count); 1527 1528 } 1529 1530inline bool DoEqualArea8 (const uint8 *sPtr, 1531 const uint8 *dPtr, 1532 uint32 rows, 1533 uint32 cols, 1534 uint32 planes, 1535 int32 sRowStep, 1536 int32 sColStep, 1537 int32 sPlaneStep, 1538 int32 dRowStep, 1539 int32 dColStep, 1540 int32 dPlaneStep) 1541 { 1542 1543 return (gDNGSuite.EqualArea8) (sPtr, 1544 dPtr, 1545 rows, 1546 cols, 1547 planes, 1548 sRowStep, 1549 sColStep, 1550 sPlaneStep, 1551 dRowStep, 1552 dColStep, 1553 dPlaneStep); 1554 1555 } 1556 1557inline bool DoEqualArea16 (const uint16 *sPtr, 1558 const uint16 *dPtr, 1559 uint32 rows, 1560 uint32 cols, 1561 uint32 planes, 1562 int32 sRowStep, 1563 int32 sColStep, 1564 int32 sPlaneStep, 1565 int32 dRowStep, 1566 int32 dColStep, 1567 int32 dPlaneStep) 1568 { 1569 1570 return (gDNGSuite.EqualArea16) (sPtr, 1571 dPtr, 1572 rows, 1573 cols, 1574 planes, 1575 sRowStep, 1576 sColStep, 1577 sPlaneStep, 1578 dRowStep, 1579 dColStep, 1580 dPlaneStep); 1581 1582 } 1583 1584inline bool DoEqualArea32 (const uint32 *sPtr, 1585 const uint32 *dPtr, 1586 uint32 rows, 1587 uint32 cols, 1588 uint32 planes, 1589 int32 sRowStep, 1590 int32 sColStep, 1591 int32 sPlaneStep, 1592 int32 dRowStep, 1593 int32 dColStep, 1594 int32 dPlaneStep) 1595 { 1596 1597 return (gDNGSuite.EqualArea32) (sPtr, 1598 dPtr, 1599 rows, 1600 cols, 1601 planes, 1602 sRowStep, 1603 sColStep, 1604 sPlaneStep, 1605 dRowStep, 1606 dColStep, 1607 dPlaneStep); 1608 1609 } 1610 1611/*****************************************************************************/ 1612 1613inline void DoVignetteMask16 (uint16 *mPtr, 1614 uint32 rows, 1615 uint32 cols, 1616 int32 rowStep, 1617 int64 offsetH, 1618 int64 offsetV, 1619 int64 stepH, 1620 int64 stepV, 1621 uint32 tBits, 1622 const uint16 *table) 1623 { 1624 1625 (gDNGSuite.VignetteMask16) (mPtr, 1626 rows, 1627 cols, 1628 rowStep, 1629 offsetH, 1630 offsetV, 1631 stepH, 1632 stepV, 1633 tBits, 1634 table); 1635 1636 } 1637 1638/*****************************************************************************/ 1639 1640inline void DoVignette16 (int16 *sPtr, 1641 const uint16 *mPtr, 1642 uint32 rows, 1643 uint32 cols, 1644 uint32 planes, 1645 int32 sRowStep, 1646 int32 sPlaneStep, 1647 int32 mRowStep, 1648 uint32 mBits) 1649 { 1650 1651 (gDNGSuite.Vignette16) (sPtr, 1652 mPtr, 1653 rows, 1654 cols, 1655 planes, 1656 sRowStep, 1657 sPlaneStep, 1658 mRowStep, 1659 mBits); 1660 1661 } 1662 1663/*****************************************************************************/ 1664 1665inline void DoVignette32 (real32 *sPtr, 1666 const uint16 *mPtr, 1667 uint32 rows, 1668 uint32 cols, 1669 uint32 planes, 1670 int32 sRowStep, 1671 int32 sPlaneStep, 1672 int32 mRowStep, 1673 uint32 mBits) 1674 { 1675 1676 (gDNGSuite.Vignette32) (sPtr, 1677 mPtr, 1678 rows, 1679 cols, 1680 planes, 1681 sRowStep, 1682 sPlaneStep, 1683 mRowStep, 1684 mBits); 1685 1686 } 1687 1688/*****************************************************************************/ 1689 1690inline void DoMapArea16 (uint16 *dPtr, 1691 uint32 count0, 1692 uint32 count1, 1693 uint32 count2, 1694 int32 step0, 1695 int32 step1, 1696 int32 step2, 1697 const uint16 *map) 1698 { 1699 1700 (gDNGSuite.MapArea16) (dPtr, 1701 count0, 1702 count1, 1703 count2, 1704 step0, 1705 step1, 1706 step2, 1707 map); 1708 1709 } 1710 1711/*****************************************************************************/ 1712 1713#endif 1714 1715/*****************************************************************************/ 1716