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