home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 12 / MA_Cover_12.iso / devs / ics / software / ics.lzh / ICS / Programmer / ICS.doc < prev   
Encoding:
Text File  |  1999-05-23  |  41.9 KB  |  993 lines

  1.  
  2.  
  3.                             ICS PROGRAMMER MANUAL
  4.  
  5.  
  6. TABLE OF CONTENTS
  7.  
  8. ics.library/CreateIDC
  9. ics.library/CreateIDCA
  10. ics.library/CreateIDCTransform
  11. ics.library/CreateIDCTransformA
  12. ics.library/DeleteIDC
  13. ics.library/DeleteIDCTransform
  14. ics.library/ICSErr
  15. ics.library/ICSFault
  16. ics.library/ICSStatusWin
  17. ics.library/ICSStatusWinA
  18. ics.library/SetIDCMode
  19. ics.library/SetupIDCColorMatching
  20. ics.library/SetupIDCColorMatchingA
  21. ics.library/TranslateColors
  22.  
  23. ics.library/--background--                   ics.library/--background--
  24.  
  25.     COPYRIGHT
  26.  
  27.        This  file  and  all  other parts of the ICS package are Copyright
  28.        1999  Wolf Faust.  All rights reserved.  You  may  not  copy or
  29.        distribute ICS without written permission by:
  30.  
  31.                              Wolf-Jürgen Faust
  32.                              Am Dorfgarten 10
  33.                               60435 Frankfurt 
  34.                                   Germany
  35.                            Tel: ++49-69-5486556
  36.                           Fax: ++49-69-95409598
  37.                        email: wfaust@compuserve.com
  38.  
  39.     PURPOSE
  40.  
  41.        The  ics.library  alias ICS ensures that a color image, graphic or
  42.        text  object  can  be scanned/rendered/printer as close as possible to its
  43.        original  intent  on  any  device,  despite differences in imaging
  44.        technologies  and color capabilities between devices.  Whether you
  45.        are  scanning  an  image  or  other  graphic  on  a color scanner,
  46.        downloading  it  over  the  Internet, viewing or editing it on the
  47.        screen,   or  outputting  it  to  video, paper,  film,  or  other
  48.        media, ics.library helps you keep its colors consistent and accurate.
  49.  
  50.        Color Management Systems implemented like the ICS library are of
  51.        great importance to current and future application software as
  52.        need rises. Here some examples of the use of such a system:
  53.        
  54.        - Converting an image colors from known color spaces like PhotoCD,
  55.          sRGB, Monitor, Scanner to the users Monitor.         
  56.        - Convert colors used by the user on his monitor to printer colors
  57.        - Convert colors used by the user on his display to another
  58.          persons display
  59.        - Color correct video
  60.        - Changes colors for different viewing conditions (white point,
  61.          surrround light,...).
  62.        - Convert colors between different device dependent and device
  63.          independent color spaces:
  64.          RGB<->CIE Lab<->CIE XYZ<->CMYK<->...
  65.  
  66.        But ICS also allows profiling devices. This means, it will provide
  67.        methods for characterizing devices. Once measured, these devices
  68.        become a reliable and predictable part of your system.
  69.  
  70.        Note  that  ICS  is  an  ongoing  project.   The amount of devices
  71.        supported is currently not complete.  Please contact Wolf Faust
  72.        for the latest info (address above).
  73.        
  74.        Currently planned development stages (development did start summer 1997):
  75.  
  76.        1st Generation (release planned spring 1999):
  77.          Scanner characterization.
  78.          Scanner -> Monitor/Device color transformation.
  79.        2nd Generation
  80.          ICC V3.4 standard profile support for exchanging profiles with
  81.          Mac, PC, SGI,...
  82.          Device (Monitor) -> Device (Monitor) color transformation
  83.          Input/Device (Scanner/Monitor) -> Target (printer) color transformation
  84.          Support color spectrometers (X-Rite's Monitor Optimizer)
  85.        3rd Generation
  86.          Printer characterization.
  87.          Support color spectrometers (X-Rite's Digital Swatchbook)
  88.        4th Generation:
  89.          Provide a mechanism for external CMM's.
  90.  
  91.        This document describes the 1st generation of the ICS library.
  92.        
  93.     REQUIREMENTS
  94.     
  95.       - Well, first you must legaly own this software ;-)
  96.       - This library does call dos functions.
  97.         Thus all calls to this library must be done by a process!!!
  98.       - Some memory and disk space...
  99.       - Kickstart 2.04 or higher.
  100.         
  101.     OVERVIEW
  102.     
  103.        The basic procedure for using this library in order to
  104.        convert a color from one device (scanner/monitor/printer) to another:
  105.        
  106.        1. You should include following headers if not already
  107.           present in your application source:
  108.  
  109.           #include  <inttypes.h>
  110.           #include  <proto/ics.h>
  111.        
  112.        2. In your application: First, create an interchange device
  113.           context handle using CreateIDC().
  114.           
  115.        3. Next setup ICS preferences as wanted using SetupIDCColorMatching()
  116.           and SetIDCMode(). Or offer a ICS Setup option/menu item for
  117.           the user wich than calls SetupIDCColorMatching() on an existing
  118.           IDC handle created with 2.
  119.  
  120.        4. Create a color transformation function based on the preferences
  121.           made in 3. using CreateIDCTransform().
  122.  
  123.        5. Convert your colors using TranslateColors().
  124.  
  125.        6. Free all resources using DeleteIDCTransform() and DeleteIDC()
  126.           before closing the library.
  127.  
  128.        7. If you want to support ICS in a scanner driver, there are some
  129.           things you should know in order to increase the quality:
  130.  
  131.           - Warning: ICS might not work perfect with grayscale
  132.             data as input as the calibration target was scanned
  133.             using the scanners color and not grayscale mode.
  134.             Even with the target scanned in grayscale mode,
  135.             certain things can only be guessed wich is why
  136.             you should do following:
  137.             
  138.             + Try avoid grayscale as input data for ICS.
  139.             + If possible scan using the color mode and let
  140.               ICS convert color to grayscales while performing
  141.               the correction.
  142.               This is the recommended default method.
  143.               There is a benefit to it: the number of shades
  144.               scanned is usualy increased by this method resulting
  145.               in higher quality.
  146.             + A rather bad method: Do not allow using ICS with
  147.               grayscale as input. Well, I wouldn't recommend
  148.               this as ICS hardly make things worse with grayscale
  149.               as input.
  150.  
  151.           - It's recommended to provide a "Mode" cycle gadget in your
  152.             scanner driver. The Mode gadget should provide a
  153.             "Calibration" and a "ICS Correction" setting.
  154.             When set to "Calibration", the scanner software
  155.             should be setup to provide linear non-gamma corrected
  156.             values. Often scanners do offer various settings
  157.             for NTSC or Gamma correction. These settings
  158.             may also be part of the Mode gadget, but often
  159.             do not provide the best quality when calibrating ICS.
  160.             The "Calibration" Mode should be used by the user
  161.             to calibrate the scanner. So the software should
  162.             only provide uncorrected linear data
  163.             when calibrating and using ICS.
  164.           - The "ICS Correction" should be the default mode
  165.             and use the ICS library for correcting the scanned colors.
  166.             The scanner must be setup in the exact same way
  167.             as with the "Calibration" mode wich was used by the
  168.             user to calibrate ICS. Your scanner driver should
  169.             than ask ICS to correct the provided data.
  170.             Note that ICS can provide download tables for
  171.             your scanner in order to increase the precession.
  172.  
  173.             Or implement the "Calibration" and "ICS Correction"
  174.             settings as mutual exclusive menu items.
  175.  
  176.           - Your scan software should provide an "ICS Setup" button
  177.             in order to setup ICS. Your software 
  178.             should call SetupIDCColorMatching() when the user
  179.             hits the button.
  180.  
  181.  
  182. ics.library/--version--                          ics.library/--version--
  183.  
  184.     NOTES
  185.  
  186.        This document describes ics.library V2.00 or higher.
  187.  
  188.  
  189. ics.library/CreateIDC                            ics.library/CreateIDC
  190.  
  191.    NAME
  192.       CreateIDC  -- create a new interchange device context handle (IDC)
  193.  
  194.    SYNOPSIS
  195.       IDC = CreateIDCA(tags);
  196.       D0               A0
  197.  
  198.       void *CreateIDCA(struct TagItem *);
  199.  
  200.       IDC = CreateIDC(Tag1, ...)
  201.  
  202.       void *CreateIDC(ULONG, ...)
  203.  
  204.    FUNCTION
  205.       This function creates a handle to an interchange device context
  206.       object (IDC).
  207.  
  208.       The IDC object mainly contains all global settings and 
  209.       preferences used  by the ics.library. The IDC settings
  210.       in the IDC object mainly describe the devices (monitor, scanner,...)
  211.       used by the user. It also contains the settings on how the
  212.       transformation between device dependent color spaces should be done.
  213.  
  214.       The contents of IDC is hidden from the user and changes to the
  215.       IDC object must be done using the offered ics.library function calls.
  216.   
  217.       Note that on creation of the IDC object, the ICS library does
  218.       read the global systems ICS settings. So once you created an
  219.       IDC, changes to the global ICS settings by a different application
  220.       will have no effect on the functioning of previously generated IDC.
  221.   
  222.       Do not assume certain settings in a new IDC objects. Specificly,
  223.       check if the color mapping is turned on using SetIDCMode() when you
  224.       want to generate a real color mapping function using CreateIDCTransform().
  225.  
  226.       Calls to CreateIDC must be matched by calls to DeleteIDC().
  227.   
  228.    INPUTS
  229.       tags - Following tags are supported (some are always required!).
  230.              The tags are mainly added for safety so that ICS
  231.              may workarround problems with faulty applications.
  232.  
  233.             ICS_APPNAME - The required value of this
  234.                 tag must be a string pointer not longer
  235.                 than 25 chars containing the name
  236.                 of your application. The name should follow
  237.                 the rules for AmigaDOS filenames (no ~?#... chars).
  238.                 The name given will be copied by ICS to an internal
  239.                 buffer and will be used for saving settings
  240.                 or displaying messages.
  241.             ICS_APPNAMEVERSION - This required tag specifies
  242.                 a uint32_t value containg the version of your
  243.                 application. The version given may be used
  244.                 by future version of ICS in order to
  245.                 enable/disable new features for specific
  246.                 applications.
  247.             ICS_APPICSVERSION - This required tag specifies
  248.                 the latest version of ICS library you developed
  249.                 your application for.
  250.                 The version given may allow ICS to identify the
  251.                 capabilities of your application so that
  252.                 new versions of the ICS library can behave
  253.                 in a compatible way if required.
  254.                 I hope the API of this library is well designed
  255.                 so that the library never makes use of this
  256.                 value. But again, safety first. So specify the
  257.                 library version (see ics.library/--version-- above)
  258.             ICS_PREFSFILE - Use this tag to specify a
  259.                 string pointer containg the full path and name
  260.                 of an ICS preferences file. ICS preferences settings 
  261.                 will be loaded from the specified file.
  262.                 However, if you do call SetupIDCColorMatching() and
  263.                 the users saves his settings, they
  264.                 will overwrite the normal ICS preferences
  265.                 settings. So this is just for loading
  266.                 custom preferences.
  267.                 You may specify NULL for the default preferences
  268.                 file.
  269.                 If the specified file does not exist or
  270.                 has the wrong version, ICS will silently
  271.                 skip the ICS_PREFSFILE tag and normal
  272.                 preferences will be used.
  273.  
  274.    RESULTS
  275.       IDC  - pointer to IDC object or NULL in case of failure.
  276.              There is no error id or text available in case
  277.              of a failure. However, the most likely reason
  278.              for a failure is simple lack of memory.
  279.  
  280.    SEE ALSO
  281.       DeleteIDC().
  282.  
  283.  
  284. ics.library/CreateIDCTransform                   ics.library/CreateIDCTransform
  285.  
  286.    NAME
  287.  
  288.       CreateIDCTransform  -- creates a transformation function handle.
  289.  
  290.    SYNOPSIS
  291.       hColorTransform = CreateIDCTransformA(idc,tags);
  292.       D0                                   A0   A1
  293.  
  294.       HTRANSFORM CreateIDCTransformA(void *, struct TagItem *);
  295.  
  296.  
  297.       hColorTransform = CreateIDCTransform(idc,Tag1, ...)
  298.  
  299.       HTRANSFORM CreateIDCTransform(void *, ULONG, ...)
  300.  
  301.    FUNCTION
  302.       This function returns a handle to a transformation
  303.       function (HTRANSFORM) used to convert colors
  304.       between two devices specified by the IDC given.
  305.   
  306.       The transformation functions is basicly created
  307.       from the settings of the IDC object. The necessary
  308.       device profiles are read from disk and a transformation
  309.       function is calculated.
  310.  
  311.       Depending on the library version and type of
  312.       transformation, CreateIDCTransform might take
  313.       much of your systems free RAM in order to 
  314.       create interpolation tables used to speed
  315.       up the correction later on. Thus the amount of free
  316.       memory can have a huge effect on the speed
  317.       and precission of the created mapping function.
  318.  
  319.       NOTE: a call to CreateIDCTransform() can take several
  320.       minutes. Thus it is a good idea to create a busy
  321.       pointer for your windows. Also, try to avoid
  322.       unnecessary calls to CreateIDCTransform(). For instance,
  323.       if you want to convert many images using the same
  324.       transformation function, only call CreateIDCTransform()
  325.       once. Use ICS_StatusOpen tag in order to
  326.       get a status window displayed allowing the user
  327.       to abort CreateIDCTransform if wanted.
  328.  
  329.       You can call CreateIDCTransform() with the color mapping
  330.       turned off (see SetIDCMode()). In this case, a transformation
  331.       function is created leaving colors unchanged
  332.       when mapping. You can not use this transformation
  333.       function while ICS is enabled. ICS may be enabled/disabled
  334.       by calls to SetIDCMode() or SetupIDCColorMatching().
  335.  
  336.       If you want a valid and functional transformation
  337.       function, query the mapping mode of the created IDC using
  338.       SetIDCMode(). Than enable the mapping for calling 
  339.       CreateIDCTransform(). Afterwoods you set the ICS
  340.       mode back to it's default. This way you can enabled
  341.       and disable ICS as wanted and use existing transformations.
  342.   
  343.       It's a nice and quick method to disable the color mapping
  344.       with SetIDCMode(idc, ICS_OFF) prior to CreateIDCTransform()
  345.       in order to use the same program calls to the ICS library
  346.       without doing any color mapping. However, in this
  347.       case you have to delete the transformation function first
  348.       before you can generate a real color mapping function based
  349.       on the user selected device profiles.
  350.   
  351.       All successfull created transformation functions must
  352.       be freed using DeleteIDCTransform().
  353.  
  354.             CreateIDCTransform() does call ICSStatusWin() with the
  355.             given tags. This means, you can automaticly get a status
  356.             window with CreateIDCTransform() showing the user
  357.             the progress of CreateIDCTransform() and allowing
  358.             the user to abort the action.
  359.             
  360.             CreateIDCTransform() can also provide you with the data
  361.             required to generate a download table for your scanner.
  362.             
  363.  
  364.  
  365.    INPUTS
  366.       idc - pointer to an interchanged device context object
  367.             created using CreateIDC().
  368.             It contains all the preferences and settings describing
  369.             the wanted transformation function.
  370.      tags - Following tags are supported:
  371.  
  372.             ICS_TransferDevices - descibes from source/destination
  373.                 device to be used. Set to:
  374.  
  375.                      ICS_INPUT_DEVICE
  376.                        Specifies that you want to transform input
  377.                        device colors for the display device.
  378.                        Currently you MUST use this.
  379.  
  380.             ICS_ScanTLCGray  -
  381.             ICS_ScanTLCRed   -
  382.             ICS_ScanTLCGreen -
  383.             ICS_ScanTLCBlue  - 
  384.                        Disables TLC/Graybalance correction
  385.                        and the library will return a (uint16_t *) to
  386.                        the 1D LUTs in the given address so that you
  387.                        can apply the TLC table (download to scanner)
  388.                        yourself.
  389.                        
  390.                        Some scanners allow drivers to download
  391.                        a correction table. Often this is combined
  392.                        with a greater precission as the internal
  393.                        processing is done with more bits than
  394.                        the data is sent to the computer
  395.                        (ie. 12 Bit scanners providing 8 Bit grayscale
  396.                        values,...).
  397.                        One of the first corrections done by the
  398.                        ICS library is graybalance and linearization
  399.                        of the input data based on the scanner
  400.                        profile given. This is done by using
  401.                        simple 1D LUTs.
  402.                        You can ask the ICS library using these tags
  403.                        for the 1D LUTs used in order to download
  404.                        them to the scanner. The scanner will
  405.                        than do the correction.
  406.  
  407.                        Because of this, it is important:
  408.  
  409.                        A. do not specify these tags unless
  410.                           you really apply the returned
  411.                           LUTs to the input data yourself.
  412.                        B. ICS will return NULL in the address
  413.                           given by the tag values if no LUT
  414.                           is available. In this case, the
  415.                           general rule applies:
  416.                           always use the same correction in your
  417.                           software as used during the calibration
  418.                           of the scanner using ICS. This
  419.                           correction should return linear data
  420.                           and not gamma corrected for best quality.
  421.                        C. You may only ask for ICS_ScanTLCGray
  422.                           or ICS_ScanTLCRed, ICS_ScanTLCGreen,
  423.                           ICS_ScanTLCBlue, or both. Just asking
  424.                           for ICS_ScanTLCRed is not supported.
  425.                        D. The provided table must not be altered.
  426.                           If your scanners wants 12Bit->8Bit tables,
  427.                           it's up to you to allocated and calculate
  428.                           the values from the table provided.
  429.                        E. The values in the table are unsigned 16 Bit
  430.                           values (0-65535). Black is 0 and White
  431.                           is 65535 for both, color and grayscale
  432.                           tables.
  433.                        F. These tags are only supported with
  434.                           ICS_TransferDevices set to ICS_INPUT_DEVICE.
  435.                        G. The pointer address given must be initialized
  436.                           with a NULL pointer. Check if the pointer
  437.                           is still NULL after the CreateIDCTransform()
  438.                           call in order to know if the library
  439.                           provided a table.
  440.                        H. It's your responsibility to not use the
  441.                           returned tables if ICS is switched
  442.                           off by you later on. Use SetIDCMode()
  443.                           to check if the ICS mode is off.
  444.                           So only use the tables if ICS is enabled during
  445.                           the TranslateColors() call.
  446.  
  447.             ICS_StatusOpen  - This will open the status window
  448.                 as descibed by ICSStatusWin(). The status
  449.                 window will automaticly be closed on return
  450.                 of CreateIDCTransform() unless you use
  451.                 the ICS_StatusKeep tag. 
  452.                 The status window will always automaticly be closed
  453.                 when calling DeleteIDCTransform()
  454.                 See ICSStatusWin() for more info.
  455.             ICS_Screen         - See ICSStatusWin() for more info.
  456.             ICS_StatusClose    - Do not use in CreateIDCTransform().
  457.             ICS_StatusCheck    - Do not use in CreateIDCTransform().
  458.             ICS_StatusActivate - See ICSStatusWin().
  459.             ICS_StatusTitle    - See ICSStatusWin().
  460.             ICS_StatusText     - See ICSStatusWin().
  461.             ICS_StatusProgress - See ICSStatusWin().
  462.             ICS_StatusKeep - Set this bool tag value
  463.                 to TRUE if you want the status window
  464.                 to be left opened for further progress
  465.                 display. The status window can be
  466.                 further be controlled by ICSStatusWin().
  467.             ICS_StatusDisableAbort - Set the BOOL value of
  468.                 this tag to TRUE/FALSE in order to disable/enable
  469.                 the abort gadget of the status window
  470.                 (default: enabled).
  471.             ICS_StatusAbortPtr - The value of this tag is a pointer
  472.                 to an uint32_t var. This var gets set to non-zero
  473.                 if user wants to abort. Note that the preferred
  474.                 way of checking for user aborts is using the
  475.                 ICS_StatusCheck tag. ICS_StatusAbortPtr should
  476.                 only be used when calls to ICSStatusWin()
  477.                 are impossible by the application.
  478.             ICS_TextAttr - Font (struct TextAttr *) to be used for
  479.                 the window's gadgets and menus. If this tag
  480.                 is not provided    or its value is NULL, the default font
  481.                 of the screen on which the requesting window opens will
  482.                 be used. This font must already be in memory as ICS calls
  483.                 OpenFont() and not OpenDiskFont(). The font must be
  484.                 monospaced.
  485.                 ICS will check for an allowed font in following order:
  486.                 1. ICS_TextAttr tag
  487.                 2. default font of Screen used for the window
  488.                 3. system default font
  489.                 4. Topaz80
  490.  
  491.    RESULTS
  492.       htransform  - handle for a transformation function or NULL
  493.                     if failure.
  494.                     Use ICSFault() or ICSErr() for further
  495.                     error information.
  496.  
  497.    SEE ALSO
  498.       DeleteIDCTransform(), ICSStatusWin(), SetIDCMode()
  499.  
  500.  
  501.  
  502. ics.library/DeleteIDC                              ics.library/DeleteIDC
  503.  
  504.    NAME
  505.       DeleteIDC -- delete an interchange device context object (IDC).
  506.  
  507.    SYNOPSIS
  508.       DeleteIDC(idc);
  509.                 A0
  510.  
  511.       VOID DeleteIDC(void *);
  512.  
  513.    FUNCTION
  514.       Deletes an interchanged device context object (IDC).
  515.  
  516.       Note that all transformation functions created
  517.       with the IDC object using CreateIDCTransform()
  518.       must be freed using DeleteIDCTransform()
  519.       before calling DeleteIDC().
  520.  
  521.       Note that the handle 'idc' is invalid after this
  522.       function is called.
  523.  
  524.    INPUTS
  525.       idc - pointer to an interchanged device context object
  526.             created using CreateIDC().
  527.  
  528.    SEE ALSO
  529.       CreateIDC()
  530.  
  531.  
  532. ics.library/DeleteIDCTransform                   ics.library/DeleteIDCTransform
  533.  
  534.    NAME
  535.       DeleteIDCTransform -- delete a transformation function.
  536.  
  537.    SYNOPSIS
  538.       DeleteIDCTransform(hColorTransform);
  539.                                A0
  540.  
  541.       VOID DeleteIDC(void *);
  542.  
  543.    FUNCTION
  544.       Deletes a device transformation function.
  545.  
  546.    INPUTS
  547.       hColorTransform - pointer to transformation function
  548.                         created using CreateIDCTransform().
  549.  
  550.    SEE ALSO
  551.       CreateIDCTransform()
  552.  
  553.  
  554. ics.library/ICSErr                               ics.library/ICSErr
  555.  
  556.    NAME
  557.       ICSErr -- Return extra error information from the library
  558.  
  559.    SYNOPSIS
  560.       error = ICSErr(idc);
  561.         D0            A0
  562.  
  563.       uint_fast32_t ICSErr(void *);
  564.  
  565.    FUNCTION
  566.       Most library routines return zero to indicate an error. When this 
  567.       happens (or whatever the defined error return for the routine)
  568.       this routine may be called to determine more information.
  569.       The error yelled by the library is always specific for the
  570.       used IDC object.
  571.  
  572.       Note that every successfull new call to one of the ICS library
  573.       functions will set the error to 0 for the given IDC.
  574.   
  575.       Use ICSFault() to get the text associated with the last error.
  576.  
  577.     RESULTS
  578.       error - non zero if a fault appeared in the last ics library
  579.               function call.
  580.               Error values 1 - ICS_ERRMSGLIMIT should not cause
  581.               an error message from your application as the
  582.               ICS library already showed the error to the user.
  583.               Just abort quietly in this case.
  584.   
  585.    INPUTS
  586.       idc - the interchanged device context you want to check for errors.
  587.  
  588.    SEE ALSO
  589.       ICSFault()
  590.  
  591.  
  592. ics.library/ICSFault                               ics.library/ICSFault
  593.  
  594.    NAME
  595.       ICSFault --  Returns the text associated with the last error
  596.  
  597.    SYNOPSIS
  598.       errtext = ICSFault(idc, header);
  599.          D0               A0    A1
  600.  
  601.       PSTR ICSFault(void *, PSTR);
  602.  
  603.    FUNCTION
  604.       Most library routines return zero to indicate an error. When this 
  605.       happens (or whatever the defined error return for the routine)
  606.       this routine may be called to determine more information.
  607.  
  608.       Unlike ICSErr(), this function returns a pointer to a formated
  609.       textstring describing the problem in detail associated with the
  610.       IDC used.  The error text can be used to prompt a requester.
  611.   
  612.       The function returns NULL in case no error appeared since
  613.       your last call to ICS library with the given IDC object.
  614.   
  615.       WARNING: the error text may be more than 80 chars in size.
  616.                However, you must be sure it is formated in order
  617.                to display nicely using EasyRequest().
  618.  
  619.                The string pointer is only valid until you call another
  620.                ICS library function.
  621.   
  622.     RESULTS
  623.       errtext - pointer to locale string containg error text or zero
  624.                 no fault appeared in the last ICS library call
  625.                 function call.
  626.   
  627.    INPUTS
  628.       idc    - the interchanged device context you want to check for errors.
  629.       header - text string used as header in the error message.
  630.  
  631.    SEE ALSO
  632.       ICSErr()
  633.  
  634.  
  635. ics.library/ICSStatusWin                           ics.library/ICSStatusWin
  636.  
  637.  
  638.    NAME
  639.  
  640.       ICSStatusWinA-- open/close and control a status/progess window
  641.  
  642.    SYNOPSIS
  643.  
  644.       ret = ICSStatusWinA(hColorTransform, tags)
  645.       D0                           A0                   A1
  646.  
  647.       uint_fast32_t = ICSStatusWinA((struct Transform *, struct TagItem *)
  648.  
  649.       ret = ICSStatusWin(hColorTransform, ...)
  650.  
  651.       uint_fast32_t = ICSStatusWin((struct Transform *, ...)
  652.  
  653.    FUNCTION
  654.       This function can be used to open, close and control a status
  655.       window for showing the user progress of the calculation.
  656.       It also offers the user to abort processing. The window
  657.       runs as seperate process in order to give quick response
  658.       to the user.
  659.       
  660.       The status window is always linked to a transformation handle
  661.       wich must be given as first function argument. You can open,
  662.       close and set attributes of the status window as you like.
  663.       So you may use it in your program for various other tasks.
  664.       
  665.  
  666.       Note that you can also add the tags listed below during
  667.       the CreateIDCTransform() call with ICS_StatusOpen defined.
  668.       In this case a status window is opened automaticly for
  669.       you during the CreateIDCTransform() call.
  670.       
  671.       The status window can be closed by using the ICS_StatusClose tag.
  672.       The status window will also be automaticly closed by the
  673.       DeleteIDCTransform().
  674.       
  675.       All text arguments are copied to internal buffers and thus
  676.       can be altered/deleted after the ICSStatusWin() call.
  677.  
  678.    INPUTS
  679.       hColorTransform - pointer to transformation function
  680.                         created using CreateIDCTransform().
  681.       tags - Following tags are supported:
  682.  
  683.             ICS_StatusOpen - A progress/status window will
  684.                 be opened for the given transformation handle.
  685.                 The value of this tag must be a screen pointer
  686.                 or NULL. If NULL, the screen pointer provided
  687.                 ICS_Screen will be used. If ICS_Screen is NULL
  688.                 too, the default public screen will be used.
  689.             ICS_Screen - Screen pointer on wich to open the Setup
  690.                 window if NULL was specified by the ICS_StatusOpen.
  691.                 ICS_Screen is an alternativ form to provide the
  692.                 screen pointer. ICS_Screen is a global tag
  693.                 supported by various ICS functions.
  694.                 It allows you to store all ICS tags in a single
  695.                 array in your application and only a single
  696.                 screen pointer value has to be changed if needed.
  697.             ICS_StatusClose - This will close the status window.
  698.                 Set the tag value to 0. The status window
  699.                 will automaticly close when calling
  700.                 DeleteIDCTransform().
  701.             ICS_StatusActivate - Use this flag if you want the
  702.                 status window to automatically become the active
  703.                 window when opening the status window. Or you can
  704.                 use this flag to make the status window active
  705.                 after creation.
  706.                 The active window is the one that receives
  707.                 input from the keyboard and mouse. By default,
  708.                 the ICS status window is not active.
  709.                 It's not recommended to make the status
  710.                 window active in order to avoid disturbing the
  711.                 user working on a different screen/window.
  712.                 Please use this flag thoughtfully and
  713.                 carefully.
  714.             ICS_StatusCheck - This function should be called
  715.                 from time to time in order to check
  716.                 if the user asked for aborting the task.
  717.                 The function returns non-zero once for each
  718.                 abort request by the user.
  719.                 You can use ICS_StatusDisableAbort in order
  720.                 to disable the user from aborting.
  721.                 In this case calls with ICS_StatusCheck
  722.                 are not necessary anymore.
  723.                 Set the value of this tag to 0!
  724.             ICS_StatusTitle - The value of this tag must be
  725.                 a string pointer containing the new
  726.                 window title of the status window.
  727.                 The text specified by the given string pointer
  728.                 is copied to an internal buffer and
  729.                 thus can be altered by the application
  730.                 after the call.
  731.                 Providing NULL as string pointer
  732.                 will cause ICS to set the window
  733.                 title (wich is the default after
  734.                 creating the status window).
  735.                 Note that the status title is set by
  736.                 ICS usualy by all major calculations
  737.                 making the a title change worth it.
  738.             ICS_StatusText - The value of this tag is a string
  739.                 pointer to the body text. The text
  740.                 is copied to an internal buffer and thus
  741.                 can be altered by the application after
  742.                 the call.
  743.                 Note that the status text is altered
  744.                 by ICS for major calculations in order
  745.                 to show the user the progress.
  746.                 You disable this default feature by
  747.                 defining a string with ICS_StatusText.
  748.                 ICS than assumes you want to control the
  749.                 text of the status window.
  750.                 Providing NULL as string pointer
  751.                 will cause ICS to set the status
  752.                 text by itself again (as said, this is the
  753.                 default after  creating the status window).
  754.             ICS_StatusProgress - This tag allows
  755.                 the status window to show a graphical bar
  756.                 for the progress done. The tag value
  757.                 given describes the percentage done (0-100).
  758.                 Any ICS_StatusText tag will reset the progress
  759.                 value automaticly to 0.
  760.             ICS_StatusDisableAbort - Set the BOOL value of
  761.                 this tag to TRUE/FALSE in order to disable/enable
  762.                 the abort gadget of the status window
  763.                 (default: enabled).
  764.             ICS_StatusAbortPtr - The value of this tag is a pointer
  765.                 to an uint32_t var. This var gets set to non-zero
  766.                 if user wants to abort. Note that the preferred
  767.                 way of checking for user aborts is using the
  768.                 ICS_StatusCheck tag. ICS_StatusAbortPtr should
  769.                 only be used when calls to ICSStatusWin()
  770.                 are impossible by the application.
  771.             ICS_TextAttr - Font (struct TextAttr *) to be used for
  772.                 the window's gadgets and text. If this tag
  773.                 is not provided    or its value is NULL, the default font
  774.                 of the screen on which the requesting window opens will
  775.                 be used. This font must already be in memory as ICS calls
  776.                 OpenFont() and not OpenDiskFont(). The font must be
  777.                 monospaced.
  778.                 ICS will check for an allowed font in following order:
  779.                 1. ICS_TextAttr tag
  780.                 2. default font of Screen used for the window
  781.                 3. system default font
  782.                 4. Topaz80
  783.  
  784.  
  785.    RESULTS
  786.       Zero is returned in case of success.
  787.  
  788.       You can safely call this function with various tags even
  789.       if no status window exists. The function will simply
  790.       return zero in this case - just like a status window exists.
  791.       So basicly only ICS_StatusOpen will return an error and
  792.       needs special error checking.
  793.  
  794.    SEE ALSO
  795.       CreateIDCTransform()
  796.  
  797.  
  798. ics.library/SetIDCMode                           ics.library/SetIDCMode
  799.  
  800.    NAME
  801.       SetIDCMode -- Query, enable or disable color mapping
  802.  
  803.    SYNOPSIS
  804.       oldmode = SetIDCMode(idc, newmode);
  805.         D0                  A0    D0
  806.  
  807.       uint_fast32_t SetIDCMode(void *, uint_fast32_t);
  808.  
  809.    FUNCTION
  810.       This function causes color mapping to be enabled, disabled,
  811.       or queried on a given interchange device context (IDC).
  812.  
  813.       The newmode parameter can take one of the following constant values:
  814.  
  815.       ICS_ON   :  Turns color mapping on.
  816.       ICS_OFF  :  Turns color mapping off.
  817.       ICS_QUERY:  Queries the current state of color mapping of the IDC.
  818.  
  819.       If ICS_QUERY is specified and the function succeeds, the nonzero
  820.       value returned is ICS_ON or ICS_OFF to indicate the current mode.
  821.  
  822.       You can disable and enable the color mapping of a given IDC
  823.       and it's associated transformation functions. 
  824.       But you must not enable the mapping mode using ICS_ON if
  825.       a transformation function was created by CreateIDCTransform()
  826.       with the IDC handle set to ICS_OFF.
  827.    
  828.    RESULTS
  829.       oldmode - If the function succeeds, the return value is a nonzero value
  830.                 describing the previous mode: ICS_OFF or ICS_ON.
  831.                 0 is returned in case of failure.
  832.                 Use ICSFault() or ICSErr() for further error information.
  833.  
  834.    INPUTS
  835.       idc     - pointer to the interchanged device context.
  836.       newmode - one of the following flags: ICS_OFF, ICS_ON, ICS_QUERY.
  837.  
  838.    SEE ALSO
  839.       CreateIDCTransform()
  840.  
  841.  
  842. ics.library/SetupIDCColorMatching           ics.library/SetupIDCColorMatching
  843.  
  844.    NAME
  845.       SetupIDCColorMatching -- Create a color mapping preferences window.
  846.  
  847.    SYNOPSIS
  848.       ret = SetupIDCColorMatchingA(idc, screen, tags);
  849.       D0                            A0     A1    D0
  850.  
  851.       uint32_t SetupIDCColorMatchingA(void *, struct Screen *, struct TagItem *);
  852.  
  853.  
  854.       ret = SetupIDCColorMatching(idc, screen, Tag1, ...)
  855.  
  856.       uint32_t SetupIDCColorMatching(void *, struct Screen *, ULONG, ...)
  857.  
  858.    FUNCTION
  859.       The SetupIDCColorMatching function creates a Color Management requester
  860.       window that lets the user choose whether to enable color mapping, and
  861.       if so, provides control over the color profiles used and the
  862.       rendering intent.
  863.       
  864.       Important: note that the settings made by the user may only be valid
  865.       for the idc handle used in the SetupIDCColorMatching() call.
  866.       Thus you should create and keep an idc handle as long as possible.
  867.    
  868.       You should free any transformation function created with
  869.       CreateIDCTransform() after calling SetupIDCColorMatching()
  870.       if the user altered the settings (return value of 3).
  871.       So it's a good idea to create a transformation function during
  872.       the startup of your software once. Only free and afterwoods create
  873.       the transformation function if the user altered the settings.
  874.       This avoids calling the computing intensive CreateIDCTransform()
  875.       function.
  876.       
  877.       Note that the user might disabled/enabled ICS when calling
  878.       SetupIDCColorMatching(). So you should not call
  879.       SetupIDCColorMatching() while a transformation function linked
  880.       to the IDC is used simultaniously. Other changes 
  881.       than enabling/disabling ICS do not affect existing transformation
  882.       functions.
  883.       
  884.     RESULTS
  885.  
  886.       ret -     A return value:
  887.  
  888.                 0 - An error occured, the IDC is left unchanged.
  889.                     Use ICSFault() or ICSErr() for further error
  890.                     information.
  891.                 1 - The user quit the setup window using the
  892.                     cancel gadget.
  893.                 2 - The user quit the setup window using the
  894.                     Save or Use gadget. The user left
  895.                     the settings unchanged.
  896.                 3 - The user quit the setup window using the
  897.                     Save or Use gadget. The user altered
  898.                     the ICS settings.
  899.                     Free any transfer function handle created
  900.                     by CreateIDCTransform() after this call.
  901.   
  902.    INPUTS
  903.       idc     - handle to the interchanged device context you want the
  904.                 user to alter.
  905.       screen  - Pointer to an intuition screen you want the
  906.                 requester to appear on. Do not close the screen
  907.                 by another task while requester is on the screen.
  908.                 Or NULL the ICS_Screen or default public screen
  909.                 should be used. The screen must be at least 640*200
  910.                 pixels in size.
  911.       tags - Following tags are supported:
  912.             ICS_Screen - Screen pointer on wich to open the Setup
  913.                 window if NULL was specified by the screen argument.
  914.                 If neither, screen and ICS_Screen were defined,
  915.                 the default public screen will be used.
  916.             ICS_TextAttr - Font (struct TextAttr *) to be used for
  917.                 the window's gadgets and menus. If this tag
  918.                 is not provided    or its value is NULL, the default font
  919.                 of the screen on which the requesting window opens will
  920.                 be used. This font must already be in memory as ICS calls
  921.                 OpenFont() and not OpenDiskFont(). The font must be
  922.                 monospaced.
  923.                 ICS will check for an allowed font in following order:
  924.                 1. ICS_TextAttr tag
  925.                 2. default font of Screen used for the window
  926.                 3. system default font
  927.                 4. Topaz80
  928.  
  929. ics.library/TranslateColors                      ics.library/TranslateColors
  930.  
  931.    NAME
  932.       TranslateColors -- Translate an array of colors.
  933.  
  934.    SYNOPSIS
  935.       success = TranslateColors(hColorTransform, paInoutColors, nColors, ctInpout, paOutputColors, ctOutput);
  936.          D0                             A0             A1          D0       D1         A2             D2
  937.  
  938.       BOOL TranslateColors(HTRANSFORM, PCOLOR, uintmax_t, COLORTYPE, PCOLOR, COLORTYPE);
  939.  
  940.    FUNCTION
  941.       The TranslateColors function translates an array of colors
  942.       from the source color space to the destination color space as
  943.       defined by a color transform.
  944.  
  945.       If the input and the output color types are not compatible
  946.       with the color transform or are unsupported, this function fails
  947.       and ICSFault() can be used to get more info about the cause.
  948.       
  949.       If ICS is disabled because of preferences or because
  950.       you used SetIDCMode(), this function will do no color correction
  951.       and input colors are copied to the output colors by TranslateColors.
  952.       It might also be usefull to convert colors between different
  953.       color spaces using ICS (for instance CIE Lab -> CIE xyz,...).
  954.       
  955.       Note: Each element of the array pointed to by paInoutColors and
  956.             paOutputColors is of the size specified by the ctInpout and
  957.             ctOutput type. So when converting an COLOR_URGB array of 6 elements,
  958.             the size of the array is assumed sizeof(struct URGBCOLOR)*6 and
  959.             not sizeof(struct COLOR)*6.
  960.       Note: paInoutColors and paOutputColors may point to the same color(s).
  961.       Note: With COLOR_UGRAY black is 0 and white is 65535.
  962.       Note: With COLOR_URGB black is 0/0/0 and white is 65535/65535/65535.
  963.       Note: Avoid COLOR_UGRAY as input color space when possible
  964.             (why? See "--background--" above!). The quality is limited
  965.             and future version of ICS might not allow grayscale correction.
  966.             Use COLOR_URGB as source if you want COLOR_UGRAY as output whenver
  967.             possible.
  968.       Note: Avoid calling TranslateColors() for a single pixel. Performance
  969.             can be dramaticly lowered. When converting an image,
  970.             try to provide at least a single image line.
  971.  
  972.     RESULTS
  973.       success - returns TRUE if no error appeared. Otherwise FALSE.
  974.                 Use ICSFault() or ICSErr() for further error information.
  975.   
  976.     INPUTS
  977.       hColorTransform -  Identifies the color transform to use. Created
  978.                          by CreateIDCTransform().
  979.        paInputColors  -  Pointer to an array of nColors COLOR structures
  980.                          to translate.
  981.           nColors     -  Contains the number of elements in the arrays
  982.                          pointed to by paInputColors and paOutputColors.
  983.           ctInput     -  Specifies the input color type.
  984.                          Currently allowed:  COLOR_UGRAY, COLOR_URGB.
  985.       paOutputColors  -  Pointer to an array of nColors COLOR structures that
  986.                          receive the translated colors. 
  987.          ctOutput     -  Specifies the output color type.
  988.                          Currently allowed:  COLOR_UGRAY, COLOR_URGB,
  989.    SEE ALSO
  990.       SetIDCMode()
  991.  
  992.  
  993.