home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / ifl_c / iflFile.z / iflFile
Encoding:
Text File  |  2002-10-03  |  57.6 KB  |  1,189 lines

  1.  
  2.  
  3.  
  4. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      iiiiffffllllFFFFiiiilllleeee - abstraction for image file access
  10.  
  11.  
  12. IIIINNNNHHHHEEEERRRRIIIITTTTSSSS FFFFRRRROOOOMMMM
  13.      This is a base class
  14.  
  15.  
  16. HHHHEEEEAAAADDDDEEEERRRR FFFFIIIILLLLEEEE
  17.      #include <ifl/iflCdefs.h>
  18.  
  19.  
  20. CCCCLLLLAAAASSSSSSSS DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  21.      iflFile is an abstraction of a handle to an image file.  It is an
  22.      abstract base class; every iflFile object is actually an object of a
  23.      file-format-specific subclass such as iflTIFFFile.
  24.  
  25.  
  26.    CCCCrrrreeeeaaaattttiiiinnnngggg aaaannnndddd ddddeeeessssttttrrrrooooyyyyiiiinnnngggg
  27.      An IFL application opens a file by calling iiiiffffllllFFFFiiiilllleeee::::::::ooooppppeeeennnn() (to open an
  28.      existing image file) or iiiiffffllllFFFFiiiilllleeee::::::::ccccrrrreeeeaaaatttteeee() (to create a new image file).
  29.      The returned value is an _i_f_l_F_i_l_e* pointing to a newly created object of
  30.      the appropriate subclass (one of iflTIFFFile, etc.).  The file can be
  31.      manipulated by calling the object's member functions.  The object can be
  32.      destroyed by calling the cccclllloooosssseeee() member function.  Buffered data is
  33.      automatically flushed during the close(), but the application may elect
  34.      to explicitly flush at any time by calling fffflllluuuusssshhhh().
  35.  
  36.      This is the only public interface to construction and destruction of
  37.      iflFile objects.  There is no public constructor or destructor for this
  38.      class or any of its subclasses.  It is illegal to create an iflFile on
  39.      the stack.
  40.  
  41.  
  42.    AAAAcccccccceeeessssssssiiiinnnngggg iiiimmmmaaaaggggeeee ddddaaaattttaaaa
  43.      Several member functions are used by an IFL application to read image
  44.      data from an image file into memory, or to write image data from memory
  45.      to an image file.
  46.  
  47.      The most general and usual interface is to use ggggeeeettttTTTTiiiilllleeee() and sssseeeettttTTTTiiiilllleeee(),
  48.      which allow reading and writing of arbitrary rectangular regions (_t_i_l_e_s),
  49.      with an arbitrary data type, dimension ordering, and orientation.
  50.  
  51.      Optimized applications may want to use the lower-level ggggeeeettttPPPPaaaaggggeeee() and
  52.      sssseeeettttPPPPaaaaggggeeee() interface, which does no conversion and requires the specified
  53.      region to be one of the file's natural _p_a_g_e_s.
  54.  
  55.      The IFL library implements ggggeeeettttTTTTiiiilllleeee() and sssseeeettttTTTTiiiilllleeee() in terms of ggggeeeettttPPPPaaaaggggeeee()
  56.      and sssseeeettttPPPPaaaaggggeeee(), which are defined by the format-specific subclasses of
  57.      iflFile.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  71.  
  72.  
  73.  
  74.    AAAAcccccccceeeessssssssiiiinnnngggg ssssuuuubbbb----iiiimmmmaaaaggggeeeessss
  75.      An image file can contain more than one image, depending on the file
  76.      format.  For example, the TIFF and GIF formats allow a file to contain
  77.      any number of unrelated images, and the Kodak Photo CD Image Pac (PCD)
  78.      and JFIF formats allow access to multiple resolutions of the same image.
  79.      Both of these situations are handled by the notion of an iflFile object's
  80.      "current image index".  Image operations and queries applied to an
  81.      iflFile object refer to the image at the current index.
  82.  
  83.      The application can change the index by calling the object's
  84.      sssseeeettttCCCCuuuurrrrrrrreeeennnnttttIIIImmmmgggg() method.  The current index and total number of images in
  85.      the file can be queried by calling the ggggeeeettttCCCCuuuurrrrrrrreeeennnnttttIIIImmmmgggg() or ggggeeeettttNNNNuuuummmmIIIImmmmggggssss()
  86.      method, respectively.  The initial index may also be set by specifying an
  87.      index with the filename argument to iiiiffffllllFFFFiiiilllleeee::::::::ooooppppeeeennnn() (see the description
  88.      of that function above).
  89.  
  90.      Note that these operations are meaningful even if the file format does
  91.      not support multiple images per file.  In that case, ggggeeeettttNNNNuuuummmmIIIImmmmggggssss() returns
  92.      1, ggggeeeettttCCCCuuuurrrrrrrreeeennnnttttIIIImmmmgggg() returns 0, and sssseeeettttCCCCuuuurrrrrrrreeeennnnttttIIIImmmmgggg(idx) will succeed if and
  93.      only if idx == 0.
  94.  
  95.      If an image file is open for write access and the file format and
  96.      format-specific implementation supports it, the application can append an
  97.      image to an image file by calling the aaaappppppppeeeennnnddddIIIImmmmgggg() member function.
  98.  
  99.  
  100.    IIIICCCCCCCC pppprrrrooooffffiiiilllleeeessss
  101.      An ICC (International Color Consortium) profile can be used for color
  102.      management; see _h_t_t_p://_w_w_w._c_o_l_o_r._o_r_g for more details on the specifics of
  103.      how such profiles are used.  To access the profile for those formats that
  104.      support it, call ggggeeeettttIIIICCCCCCCCPPPPrrrrooooffffiiiilllleeee().  When you are done with the profile
  105.      call ffffrrrreeeeeeeeIIIICCCCCCCCPPPPrrrrooooffffiiiilllleeee() to release any allocated memory.  You can update
  106.      the profile of an image by calling sssseeeettttIIIICCCCCCCCPPPPrrrrooooffffiiiilllleeee().
  107.  
  108.      The GIF, TIFF, JFIF and SGI formats included with IFL all support ICC
  109.      profiles.  New formats must implement the virtual methods listed above in
  110.      order to provide ICC profile support.
  111.  
  112.  
  113.    FFFFoooorrrrmmmmaaaatttt----ssssppppeeeecccciiiiffffiiiicccc ooooppppeeeerrrraaaattttiiiioooonnnnssss
  114.      The member functions ggggeeeettttIIIItttteeeemmmm() and sssseeeettttIIIItttteeeemmmm() deal with "items"; that is,
  115.      format-dependent name-value pairs associated with an image within an
  116.      image file.
  117.  
  118.      Usage of these functions requires format-specific knowledge of the
  119.      meaning of the tags for the specific file format; e.g. for iflTIFFFile,
  120.      the meaning of the tags is given in the TIFF spec.
  121.  
  122.  
  123.    DDDDeeeeaaaalllliiiinnnngggg wwwwiiiitttthhhh ccccoooonnnnccccuuuurrrrrrrreeeennnntttt aaaacccccccceeeesssssssseeeessss
  124.      If an IFL application is going to make concurrent calls to an iflFile's
  125.      ggggeeeettttPPPPaaaaggggeeee() and/or sssseeeettttPPPPaaaaggggeeee() methods, it must provide the iflFile object
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  137.  
  138.  
  139.  
  140.      with a semaphore mechanism.  The application does this by supplying a
  141.      beginFileIO callback with sssseeeettttBBBBeeeeggggiiiinnnnFFFFiiiilllleeeeIIIIOOOO____CCCCBBBB() (which should acquire a
  142.      semaphore) and an endFileIO callback with sssseeeettttEEEEnnnnddddFFFFiiiilllleeeeIIIIOOOO____CCCCBBBB() (which should
  143.      release the semaphore).  These callbacks will be called by ggggeeeettttPPPPaaaaggggeeee() and
  144.      sssseeeettttPPPPaaaaggggeeee() surrounding thread-unsafe code.
  145.  
  146.      See the next section for the DSO implementor's interface to this
  147.      mechanism.
  148.  
  149.  
  150. DDDDEEEERRRRIIIIVVVVIIIINNNNGGGG SSSSUUUUBBBBCCCCLLLLAAAASSSSSSSSEEEESSSS
  151.      iflFile subclass implementors must surround code that needs to be
  152.      executed atomically with calls to the protected bbbbeeeeggggiiiinnnnFFFFiiiilllleeeeIIIIOOOO() and
  153.      eeeennnnddddFFFFiiiilllleeeeIIIIOOOO() member functions (which call the application's beginFileIO
  154.      and endFileIO callbacks, respectively, if they exist).
  155.  
  156.      The most common and unavoidable case is when getPage or setPage contain
  157.      an llllsssseeeeeeeekkkk() and a subsequent rrrreeeeaaaadddd() or wwwwrrrriiiitttteeee(); this code must be
  158.      surrounded by bbbbeeeeggggiiiinnnnFFFFiiiilllleeeeIIIIOOOO()/eeeennnnddddFFFFiiiilllleeeeIIIIOOOO() to insure that concurrent calls
  159.      don't change the I/O pointer between the seek and the read or write.
  160.  
  161.      If the underlying sssseeeettttPPPPaaaaggggeeee()/ggggeeeettttPPPPaaaaggggeeee() code is completely non-MP-safe, the
  162.      implementor may choose to surround the entire function bodies with
  163.      bbbbeeeeggggiiiinnnnFFFFiiiilllleeeeIIIIOOOO()/eeeennnnddddFFFFiiiilllleeeeIIIIOOOO().
  164.  
  165.  
  166.    CCCCrrrreeeeaaaattttiiiinnnngggg aaaannnndddd ddddeeeessssttttrrrrooooyyyyiiiinnnngggg
  167.      The IFL library's functions ooooppppeeeennnn()/ccccrrrreeeeaaaatttteeee()/cccclllloooosssseeee() methods call the
  168.      ooooppppeeeennnnFFFFiiiilllleeee()/ccccrrrreeeeaaaatttteeeeFFFFiiiilllleeee()/cccclllloooosssseeeeFFFFiiiilllleeee() protected virtual functions to
  169.      perform the subclass-specific initialization and destruction of an
  170.      iflFile object.  These functions are not accessible to the application.
  171.  
  172.      If you install ifl_dev.sw.gifts then you can check out the source code
  173.      provided in /usr/share/src/ifl for more examples of deriving from
  174.      iflFile.
  175.  
  176.  
  177. CCCCLLLLAAAASSSSSSSS MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN SSSSUUUUMMMMMMMMAAAARRRRYYYY
  178.      OOOOppppeeeennnn////ccccrrrreeeeaaaatttteeee////cccclllloooosssseeee mmmmeeeetttthhhhooooddddssss
  179.  
  180.           iflFile* iflFileOpenPreParsed(iflFile *obj, iflFileDesc* fileDesc,
  181.                                         int mode, iflStatus* status)
  182.           iflFile* iflFileOpenByDescriptor(iflFile *obj,
  183.                                            int fd, const char* filename,
  184.                                            int mode, iflFormat* format,
  185.                                            iflStatus* status)
  186.           iflFile* iflFileOpen(iflFile *obj, const char* filename,
  187.                                int mode, iflStatus* status)
  188.           iflFile* iflFileCreatePreParsed(iflFile *obj, iflFileDesc* fileDesc,
  189.                                           iflFile* source,
  190.                                           const iflFileConfig* cfg,
  191.                                           iflStatus* status)
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  203.  
  204.  
  205.  
  206.           iflFile* iflFileCreateByDescriptor(iflFile *obj,
  207.                                              int fd, const char *filename,
  208.                                              iflFile* source,
  209.                                              const iflFileConfig* cfg,
  210.                                              iflFormat* format,
  211.                                              iflStatus* status)
  212.           iflFile* iflFileCreate(iflFile *obj, const char *filename,
  213.                                  iflFile* source, const iflFileConfig* cfg,
  214.                                  iflFormat* format, iflStatus* status)
  215.           iflStatus iflFileClose(iflFile *obj, int flags)
  216.           iflStatus iflFileFlush(iflFile *obj)
  217.           char* iflFileParseFileName(iflFile *obj, const char* fullname,
  218.                                      char** formatName,
  219.                                      int* index, char** formatArgs)
  220.  
  221.  
  222.    PPPPuuuubbbblllliiiicccc ffffuuuunnnnccccttttiiiioooonnnnssss ttttoooo ggggeeeetttt////sssseeeetttt iiiimmmmaaaaggggeeee ddddaaaattttaaaa
  223.           iflStatus iflFileGetTile(iflFile *obj, int x, int y, int z,
  224.                                    int nx, int ny, int nz, void *data,
  225.                                    const iflConfig* config)
  226.           iflStatus iflFileSetTile(iflFile *obj, int x, int y, int z,
  227.                                    int nx, int ny, int nz, const void *data,
  228.                                    const iflConfig* config)
  229.           iflStatus iflFileGetPage(iflFile *obj, void* data,
  230.                                            int x, int y, int z,
  231.                                            int c, int nx, int ny,
  232.                                            int nz, int nc)
  233.           iflStatus iflFileSetPage(iflFile *obj, const void* data,
  234.                                            int x, int y, int z,
  235.                                            int c, int nx, int ny,
  236.                                            int nz, int nc)
  237.  
  238.  
  239.    MMMMaaaannnniiiippppuuuullllaaaattttiiiinnnngggg tttthhhheeee ccccuuuurrrrrrrreeeennnntttt iiiimmmmaaaaggggeeee iiiinnnnddddeeeexxxx
  240.           int iflFileGetNumImgs(iflFile *obj)
  241.           int iflFileGetCurrentImg(iflFile *obj)
  242.           iflStatus iflFileSetCurrentImg(iflFile *obj, int i)
  243.  
  244.  
  245.    AAAAddddddddiiiinnnngggg iiiimmmmaaaaggggeeeessss
  246.           iflStatus iflFileAppendImg(iflFile *obj, iflFile* source,
  247.                                              iflFileConfig* fc)
  248.  
  249.  
  250.    AAAAttttttttrrrriiiibbbbuuuutttteeee qqqquuuueeeerrrryyyy
  251.           const char* iflFileGetFileName(iflFile *obj)
  252.           int iflFileGetFileDesc(iflFile *obj)
  253.           int iflFileGetFileMode(iflFile *obj)
  254.           iflFormat* iflFileGetFormat(iflFile *obj)
  255.           iflColorModel iflFileGetColorModel(iflFile *obj)
  256.           int* iflFileGetChannelPermutation(iflFile *obj)
  257.           void iflFileGetDimensions(iflFile *obj, iflSize* dimensions)
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  269.  
  270.  
  271.  
  272.           void iflFileGetSize(iflFile *obj, iflSize* sz, iflOrientation toOrientation)
  273.           int iflFileGetZsize(iflFile *obj)
  274.           int iflFileGetCsize(iflFile *obj)
  275.           iflDataType iflFileGetDataType(iflFile *obj)
  276.           iflOrder iflFileGetOrder(iflFile *obj)
  277.           void iflFileGetPageDimensions(iflFile *obj, iflSize* pageDims)
  278.           void iflFileGetPageSize(iflFile *obj, iflSize* sz, iflOrientation toOrientation)
  279.           iflOrientation iflFileGetOrientation(iflFile *obj)
  280.           iflCompression iflFileGetCompression(iflFile *obj)
  281.           iflStatus iflFileGetColormap(iflFile *obj, const iflColormap** cmap)
  282.           iflStatus iflFileGetStatMinMax(iflFile *obj, double* min,
  283.                                                  double* max)
  284.           iflStatus iflFileGetScaleMinMax(iflFile *obj,
  285.                                                   double* min,
  286.                                                   double* max)
  287.           iflStatus iflFileGetItemV(iflFile *obj, int tag,
  288.                                             va_list ap)
  289.           int iflFileHaveAttributesChanged(iflFile *obj)
  290.  
  291.  
  292.    AAAAttttttttrrrriiiibbbbuuuutttteeee sssseeeettttttttiiiinnnngggg
  293.           iflStatus iflFileSetColormap(iflFile *obj, const iflColormap* cmap)
  294.           iflStatus iflFileSetStatMinMax(iflFile *obj, double min,
  295.                                                  double max)
  296.           iflStatus iflFileSetScaleMinMax(iflFile *obj,
  297.                                                   double min,
  298.                                                   double max)
  299.           iflStatus iflFileSetItemV(iflFile *obj, int tag,
  300.                                             va_list ap)
  301.  
  302.  
  303.  
  304.    IIIICCCCCCCC pppprrrrooooffffiiiilllleeee aaaacccccccceeeessssssss
  305.           virtual iflStatus iflFileGetICCProfile(iflFile *obj, int* size,
  306.                                                  void** profile)
  307.           virtual iflStatus iflFileFreeICCProfile(iflFile *obj,
  308.                                                   void* profile)
  309.           virtual iflStatus iflFileSetICCProfile(iflFile *obj, int size,
  310.                                                  const void* profile)
  311.  
  312.  
  313.  
  314. FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNNSSSS
  315.      aaaappppppppeeeennnnddddIIIImmmmgggg(((())))
  316.  
  317.           iflStatus iflFileAppendImg(iflFile *obj, iflFile* source,
  318.                                              iflFileConfig* fc)
  319.  
  320.  
  321.           This virtual member function appends an image to the image file, and
  322.           sets the current image index to the index of the new (last) image.
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  335.  
  336.  
  337.  
  338.           The _s_o_u_r_c_e and _c_f_g parameters are treated the same as in the
  339.           _c_r_e_a_t_e() static member function.
  340.  
  341.           On success, the function returns iflOKAY.  If the operation fails
  342.           for some reason, an IFL error will be thrown via the iiiiffffllllEEEErrrrrrrroooorrrr()
  343.           mechanism, and the file's contents and the object's current index
  344.           will be in an unknown state.
  345.  
  346.      iflStatus iflFileClose(iflFile *obj, int flags)
  347.  
  348.  
  349.  
  350.      This member function flushes any buffered data to the file referred to by
  351.      the object (unless _I_F_L__C_L_O_S_E__D_I_S_C_A_R_D is specified in the flags argument),
  352.      closes the file, and destroys the object.  This is the only way for the
  353.      application to destroy an iflFile object (there is no public destructor).
  354.  
  355.  
  356.      Note that the file descriptor will be closed even if it was opened prior
  357.      to the original iiiiffffllllFFFFiiiilllleeee::::::::ooooppppeeeennnn() or iiiiffffllllFFFFiiiilllleeee::::::::ccccrrrreeeeaaaatttteeee().  If the caller
  358.      wants to keep the file descriptor open, it must dddduuuupppp() the file descriptor
  359.      beforehand and use the resulting file descriptor as the argument to the
  360.      original iiiiffffllllFFFFiiiilllleeee::::::::ooooppppeeeennnn() or iiiiffffllllFFFFiiiilllleeee::::::::ccccrrrreeeeaaaatttteeee().
  361.  
  362.  
  363.      Then _f_l_a_g_s parameter is the bitwise "or" of zero or more of the
  364.      following:
  365.  
  366.      _I_F_L__C_L_O_S_E__D_I_S_C_A_R_D   The default behavior is to call the fffflllluuuusssshhhh() member
  367.                          function before closing the file.  This flag
  368.                          suppresses that call.
  369.  
  370.  
  371.      All three operations (flushing, closing, destroying the object) are
  372.      performed regardless of whether any of them returns failure.  If an error
  373.      is returned from any of them, the first such error value will be returned
  374.      up the caller; otherwise iflOKAY will be returned.
  375.  
  376.      ccccrrrreeeeaaaatttteeee(((())))
  377.  
  378.           iflFile* iflFileCreate(iflFile *obj, const char *filename,
  379.                                  iflFile* source, const iflFileConfig* cfg,
  380.                                  iflFormat* format, iflStatus* status)
  381.           iflFile* iflFileCreateByDescriptor(iflFile *obj,
  382.                                              int fd, const char *filename,
  383.                                              iflFile* source,
  384.                                              const iflFileConfig* cfg,
  385.                                              iflFormat* format,
  386.                                              iflStatus* status)
  387.           iflFile* iflFileCreatePreParsed(iflFile *obj, iflFileDesc* fileDesc,
  388.                                           iflFile* source,
  389.                                           const iflFileConfig* cfg,
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  401.  
  402.  
  403.  
  404.                                           iflStatus* status)
  405.  
  406.  
  407.           This static class member function creates a new image file with the
  408.           specified name and attributes.
  409.  
  410.           The _f_i_l_e_n_a_m_e argument specifies the file name of the file to be
  411.           created.  An existing file descriptor may be given additionally or
  412.           instead using the _f_d parameter, exactly as for ooooppppeeeennnn().
  413.  
  414.           The _f_o_r_m_a_t argument specifies the desired output format.  If this
  415.           argument is NULL, a format is selected by the file typing rules
  416.           using the filename's extension.  If no match is found, the format
  417.           iiiiffffllllFFFFoooorrrrmmmmaaaatttt::::::::ffffiiiinnnnddddBBBByyyyFFFFoooorrrrmmmmaaaattttNNNNaaaammmmeeee("TIFF") is used by default.
  418.  
  419.           The alternate form taking a _f_i_l_e_D_e_s_c argument, encapsulates the _f_d,
  420.           _f_i_l_e_n_a_m_e and _f_o_r_m_a_t arguments in this single argument.  See
  421.           iflFileDesc(3) for more details.
  422.  
  423.           The new image file's dimensions, data type, dimension order, color
  424.           model, orientation, compression, and page dimensions may be
  425.           specified using the _c_f_g parameter; if not, they are copied from the
  426.           _s_o_u_r_c_e iflFile* if one was given (as described below) or defaulted
  427.           to the format's "preferred" value for the respective parameter.
  428.  
  429.           When an existing _s_o_u_r_c_e iflFile* is specified; any parameters not
  430.           specified in the _c_f_g parameter will be copied from this source
  431.           iflFile (if the value is supported by the destination format) or
  432.           heuristically selected to be a supported value most suitable for
  433.           copying data from the source iflFile*.
  434.  
  435.           On successful completion, the function returns a pointer to a
  436.           newly-created object of the appropriate subclass of iflFile, which
  437.           the application should eventually destroy using its cccclllloooosssseeee() method.
  438.  
  439.           On failure, the function returns NULL and, if the _s_t_a_t_u_s argument is
  440.           non-NULL, sets the pointed-to iflStatus value to the appropriate
  441.           error value.
  442.  
  443.      fffflllluuuusssshhhh(((())))
  444.  
  445.           iflStatus iflFileFlush(iflFile *obj)
  446.  
  447.  
  448.           This virtual member function is used to write out any data that is
  449.           buffered in the iflFile object.  It is called automatically by the
  450.           cccclllloooosssseeee() member function (but this can be overridden, see description
  451.           of cccclllloooosssseeee() above).
  452.  
  453.           It should return iflOKAY on success, or an appropriate iflStatus
  454.           error value on failure.
  455.  
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  467.  
  468.  
  469.  
  470.      ffffrrrreeeeeeeeIIIICCCCCCCCPPPPrrrrooooffffiiiilllleeee(((())))
  471.  
  472.           virtual iflStatus iflFileFreeICCProfile(iflFile *obj,
  473.                                                   void* profile)
  474.  
  475.  
  476.           The virtual member function frees the profile returned by
  477.           ggggeeeettttIIIICCCCCCCCPPPPrrrrooooffffiiiilllleeee().
  478.  
  479.      ggggeeeettttCCCChhhhaaaannnnnnnneeeellllPPPPeeeerrrrmmmmuuuuttttaaaattttiiiioooonnnn(((())))
  480.  
  481.           int* iflFileGetChannelPermutation(iflFile *obj)
  482.  
  483.  
  484.           This member function returns an array representing the channel
  485.           permutation of the current image in the image file, or NULL (meaning
  486.           the identity permutation).  It is an array, indexed by memory
  487.           channel, into the channels stored in the file (as accessed by
  488.           ggggeeeettttPPPPaaaaggggeeee()/sssseeeettttPPPPaaaaggggeeee()).  This should be used by callers of
  489.           ggggeeeettttPPPPaaaaggggeeee()/sssseeeettttPPPPaaaaggggeeee() to re-order the data.
  490.  
  491.      ggggeeeettttCCCCoooolllloooorrrrMMMMooooddddeeeellll(((())))
  492.  
  493.           iflColorModel iflFileGetColorModel(iflFile *obj)
  494.  
  495.  
  496.           This member function returns the color model of the current image in
  497.           the image file.
  498.  
  499.      ggggeeeettttCCCCoooolllloooorrrrmmmmaaaapppp(((())))
  500.  
  501.           iflStatus iflFileGetColormap(iflFile *obj, const iflColormap** cmap)
  502.  
  503.  
  504.           Returns the color map associated with the current image in the image
  505.           file.
  506.  
  507.           On successful completion, iflOKAY will be returned and _c_m_a_p will be
  508.           set to point to a colormap stored in the iflFile object.  Note that
  509.           this colormap cannot be assumed to remain valid across calls to
  510.           sssseeeettttCCCCoooolllloooorrrrmmmmaaaapppp(), sssseeeettttCCCCuuuurrrrrrrreeeennnnttttIIIImmmmgggg(), aaaappppppppeeeennnnddddIIIImmmmgggg(), cccclllloooosssseeee(), or calls to
  511.           sssseeeettttIIIItttteeeemmmm() that report modification of the image's attributes.
  512.  
  513.           On failure, the return value is an iflStatus encoding the reason for
  514.           the failure, and the argument _c_m_a_p is undefined.
  515.  
  516.      ggggeeeettttCCCCoooommmmpppprrrreeeessssssssiiiioooonnnn(((())))
  517.  
  518.           iflCompression iflFileGetCompression(iflFile *obj)
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.                                                                         PPPPaaaaggggeeee 8888
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  533.  
  534.  
  535.  
  536.           Returns the compression method used for the current image in the
  537.           image file.
  538.  
  539.      ggggeeeettttCCCCssssiiiizzzzeeee(((())))
  540.  
  541.           int iflFileGetCsize(iflFile *obj)
  542.  
  543.  
  544.           Returns the number of channels in the current image in the image
  545.           file.
  546.  
  547.      ggggeeeettttCCCCuuuurrrrrrrreeeennnnttttIIIImmmmgggg(((())))
  548.  
  549.           int iflFileGetCurrentImg(iflFile *obj)
  550.  
  551.  
  552.           This virtual member function returns the iflFile's current image
  553.           index, i.e. the index into the list of images or resolutions in the
  554.           image file, starting at 0.
  555.  
  556.      ggggeeeettttDDDDaaaattttaaaaTTTTyyyyppppeeee(((())))
  557.  
  558.           iflDataType iflFileGetDataType(iflFile *obj)
  559.  
  560.  
  561.           This member function returns the data type of the current image in
  562.           the image file.
  563.  
  564.      ggggeeeettttDDDDiiiimmmmeeeennnnssssiiiioooonnnnssss(((())))
  565.  
  566.           void iflFileGetDimensions(iflFile *obj, iflSize* dimensions)
  567.  
  568.  
  569.           Returns the dimensions (width,height,z,c) of the current image in
  570.           the image file, expressed with in conventional (x == width, y ==
  571.           height) orientation.
  572.  
  573.      ggggeeeettttFFFFiiiilllleeeeDDDDeeeesssscccc(((())))
  574.  
  575.           int iflFileGetFileDesc(iflFile *obj)
  576.  
  577.  
  578.           This member function returns the file descriptor used to access the
  579.           image file.
  580.  
  581.      ggggeeeettttFFFFiiiilllleeeeMMMMooooddddeeee(((())))
  582.  
  583.           int iflFileGetFileMode(iflFile *obj)
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.                                                                         PPPPaaaaggggeeee 9999
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  599.  
  600.  
  601.  
  602.           This member function returns the access mode by which the file can
  603.           be accessed.  It is _O__R_D_O_N_L_Y, _O__W_R_O_N_L_Y, or _O__R_D_W_R.
  604.  
  605.      ggggeeeettttFFFFiiiilllleeeeNNNNaaaammmmeeee(((())))
  606.  
  607.           const char* iflFileGetFileName(iflFile *obj)
  608.  
  609.  
  610.           This member function returns the file name of the image file, or
  611.           NULL if the name is unknown (e.g. if the file was opened with a file
  612.           descriptor only).  The returned string points to data within the
  613.           object, and will become invalid when the object is destroyed.
  614.  
  615.      ggggeeeettttFFFFoooorrrrmmmmaaaatttt(((())))
  616.  
  617.           iflFormat* iflFileGetFormat(iflFile *obj)
  618.  
  619.  
  620.           Returns a pointer to the file format associated with the file.  The
  621.           pointed-to object is static and valid forever.
  622.  
  623.      ggggeeeettttIIIICCCCCCCCPPPPrrrrooooffffiiiilllleeee(((())))
  624.  
  625.           virtual iflStatus iflFileGetICCProfile(iflFile *obj, int* size,
  626.                                                  void** profile)
  627.  
  628.  
  629.           This virtual member function returns the value of the ICC profile
  630.           associated with the image.  The return value is iflOKAY on success,
  631.           or an appropriate iflStatus error value on failure.
  632.  
  633.      ggggeeeettttIIIItttteeeemmmm(((())))
  634.  
  635.           iflStatus iflFileGetItemV(iflFile *obj, int tag,
  636.                                             va_list ap)
  637.  
  638.  
  639.           Gets the value of an item associated with the current image in the
  640.           image file.
  641.  
  642.           The _t_a_g argument specifies the name of the item to be set; it is
  643.           interpreted by the specific iflFile subclass.  The number and types
  644.           of the remaining arguments are determined the particular subclass of
  645.           iflFile and the tag value.
  646.  
  647.           The return value is iflOKAY on success, or an appropriate iflStatus
  648.           error value on failure.
  649.  
  650.           The second overloaded form of this method is used by libraries that
  651.           are passing along a variable calling sequence in _a_p through some
  652.           wrapper layer.
  653.  
  654.  
  655.  
  656.  
  657.                                                                        PPPPaaaaggggeeee 11110000
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  665.  
  666.  
  667.  
  668.      ggggeeeettttNNNNuuuummmmIIIImmmmggggssss(((())))
  669.  
  670.           int iflFileGetNumImgs(iflFile *obj)
  671.  
  672.  
  673.           This virtual member function returns the number of images contained
  674.           in the image file.
  675.  
  676.      ggggeeeettttOOOOrrrrddddeeeerrrr(((())))
  677.  
  678.           iflOrder iflFileGetOrder(iflFile *obj)
  679.  
  680.  
  681.           Returns the dimension order of the current image in the image file.
  682.  
  683.      ggggeeeettttOOOOrrrriiiieeeennnnttttaaaattttiiiioooonnnn(((())))
  684.  
  685.           iflOrientation iflFileGetOrientation(iflFile *obj)
  686.  
  687.  
  688.           Returns the orientation of the current image in the image file.
  689.  
  690.      ggggeeeettttPPPPaaaaggggeeee(((())))
  691.  
  692.           iflStatus iflFileGetPage(iflFile *obj, void* data,
  693.                                            int x, int y, int z,
  694.                                            int c, int nx, int ny,
  695.                                            int nz, int nc)
  696.  
  697.  
  698.           This virtual member function reads a page of image data from the
  699.           image file.
  700.  
  701.           The _d_a_t_a argument specifies the address of the memory buffer into
  702.           which the data should be placed.
  703.  
  704.           The arguments _x,_y,_z,_n_x,_n_y and _n_z specify the origin and size of the
  705.           desired page within the source image file.  The caller must
  706.           guarantee that _n_x,_n_y,_n_z and _n_c are the image's page size and that
  707.           _x,_y,_z and _c are a multiple of the page size; no checking is done by
  708.           the function.
  709.  
  710.           A successful call to ggggeeeettttPPPPaaaaggggeeee() returns iflOKAY.  If an error occurs,
  711.           an iflStatus value is returned describing the error; in this case
  712.           the buffer's contents are undefined.
  713.  
  714.           If the caller is going to make multiple concurrent calls to
  715.           ggggeeeettttPPPPaaaaggggeeee() and/or sssseeeettttPPPPaaaaggggeeee(), it needs to set I/O callbacks (see the
  716.           description of sssseeeettttBBBBeeeeggggiiiinnnnFFFFiiiilllleeeeIIIIOOOO____CCCCBBBB(), sssseeeettttEEEEnnnnddddFFFFiiiilllleeeeIIIIOOOO____CCCCBBBB() for how to do
  717.           this).
  718.  
  719.  
  720.  
  721.  
  722.  
  723.                                                                        PPPPaaaaggggeeee 11111111
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  731.  
  732.  
  733.  
  734.           This function is required to surround code that must be executed
  735.           atomically by calls to bbbbeeeeggggiiiinnnnFFFFiiiilllleeeeIIIIOOOO() and eeeennnnddddFFFFiiiilllleeeeIIIIOOOO() (see the
  736.           descriptions of these functions for more details and common cases
  737.           where this is necessary).
  738.  
  739.      ggggeeeettttPPPPaaaaggggeeeeDDDDiiiimmmmeeeennnnssssiiiioooonnnnssss(((())))
  740.  
  741.           void iflFileGetPageDimensions(iflFile *obj, iflSize* pageDims)
  742.  
  743.  
  744.           Returns the natural page dimensions of the current image in the
  745.           image file, expressed as x == width, y == height.
  746.  
  747.      ggggeeeettttPPPPaaaaggggeeeeSSSSiiiizzzzeeee(((())))
  748.  
  749.           void iflFileGetPageSize(iflFile *obj, iflSize* sz,
  750.                                         iflOrientation toOrientation)
  751.  
  752.  
  753.           Returns the natural page size of the current image in the image
  754.           file, expressed with respect to the given orientation.
  755.  
  756.      ggggeeeettttSSSSccccaaaalllleeeeMMMMiiiinnnnMMMMaaaaxxxx(((())))
  757.  
  758.           iflStatus iflFileGetScaleMinMax(iflFile *obj,
  759.                                                   double* min,
  760.                                                   double* max)
  761.  
  762.  
  763.           Returns the minimum and maximum value to be used for scaling during
  764.           color conversion on the current image in the image file.
  765.  
  766.           On successful completion, iflOKAY will be returned and the _m_i_n and
  767.           _m_a_x arguments will be set to the appropriate values.
  768.  
  769.           On failure, the return value is an iflStatus encoding the reason for
  770.           the failure, and the arguments are left unmolested.
  771.  
  772.      ggggeeeettttSSSSiiiizzzzeeee(((())))
  773.  
  774.           void iflFileGetSize(iflFile *obj, iflSize* sz, iflOrientation toOrientation)
  775.  
  776.  
  777.           Returns the size (x,y,z,c) of the current image in the image file,
  778.           expressed with respect to the given orientation.
  779.  
  780.           Note that the Z and C dimensions (which do not depend on the
  781.           orientation) can be obtained separately by calling getZSize() and
  782.           getCSize() respectively.
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.                                                                        PPPPaaaaggggeeee 11112222
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  797.  
  798.  
  799.  
  800.      ggggeeeettttSSSSttttaaaattttMMMMiiiinnnnMMMMaaaaxxxx(((())))
  801.  
  802.           iflStatus iflFileGetStatMinMax(iflFile *obj, double* min,
  803.                                                  double* max)
  804.  
  805.  
  806.           Returns the statistical min/max, i.e. the range of values that occur
  807.           in the current image in the image file.
  808.  
  809.           On successful completion, iflOKAY will be returned and the _m_i_n and
  810.           _m_a_x arguments will be set to the appropriate values.
  811.  
  812.           On failure, the return value is an iflStatus encoding the reason for
  813.           the failure, and the arguments are left unmolested.
  814.  
  815.      ggggeeeettttTTTTiiiilllleeee(((())))
  816.  
  817.           iflStatus iflFileGetTile(iflFile *obj, int x, int y, int z,
  818.                                    int nx, int ny, int nz, void *data,
  819.                                    const iflConfig* config)
  820.  
  821.  
  822.           This member function reads an arbitrary rectangular region from the
  823.           image file into memory.  The portions of the memory buffer
  824.           corresponding to area outside the boundaries of the source file
  825.           image are left undisturbed.
  826.  
  827.           The arguments _x,_y,_z,_n_x,_n_y and _n_z specify the origin and size of the
  828.           desired tile within the source image file, in the coordinate space
  829.           indicated in the _c_o_n_f_i_g parameter.
  830.  
  831.           The _d_a_t_a argument specifies the address of the memory buffer into
  832.           which the data should be placed.
  833.  
  834.           The _c_o_n_f_i_g argument describes the configuration of the memory
  835.           buffer, and its orientation also affects the interpretation of
  836.           _x,_y,_z,_n_x,_n_y and _n_z, as described above.  If defaulted, attributes of
  837.           the buffer are assumed to match those of the image.
  838.  
  839.           A successful call to ggggeeeettttTTTTiiiilllleeee() returns iflOKAY.  If an error occurs,
  840.           an iflStatus value is returned describing the error; in this case
  841.           the buffer's contents are undefined.
  842.  
  843.      ggggeeeettttZZZZssssiiiizzzzeeee(((())))
  844.  
  845.           int iflFileGetZsize(iflFile *obj)
  846.  
  847.  
  848.           Returns the Z component of the size of the current image in the
  849.           image file.
  850.  
  851.  
  852.  
  853.  
  854.  
  855.                                                                        PPPPaaaaggggeeee 11113333
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  863.  
  864.  
  865.  
  866.      hhhhaaaavvvveeeeAAAAttttttttrrrriiiibbbbuuuutttteeeessssCCCChhhhaaaannnnggggeeeedddd(((())))
  867.  
  868.           int iflFileHaveAttributesChanged(iflFile *obj)
  869.  
  870.  
  871.           Returns TRUE if any image attributes have changed due to a call to
  872.           sssseeeettttIIIItttteeeemmmm() since last call to this method.
  873.  
  874.      ooooppppeeeennnn(((())))
  875.  
  876.           iflFile* iflFileOpen(iflFile *obj, const char* filename,
  877.                                int mode, iflStatus* status)
  878.           iflFile* iflFileOpenByDescriptor(iflFile *obj,
  879.                                            int fd, const char* filename,
  880.                                            int mode, iflFormat* format,
  881.                                            iflStatus* status)
  882.           iflFile* iflFileOpenPreParsed(iflFile *obj, iflFileDesc* fileDesc,
  883.                                         int mode, iflStatus* status)
  884.  
  885.  
  886.           This static class member function opens an existing image file.
  887.  
  888.           The file is specified via the _f_i_l_e_n_a_m_e and _f_d arguments.  At least
  889.           one of these two arguments must be specified; they are interpreted
  890.           as follows.
  891.  
  892.               if filename != NULL and fd == -1:
  893.                   opens the file with the given filename.
  894.               if filename == NULL and fd != -1:
  895.                   uses the existing open file descriptor.
  896.               if filename != NULL and fd != -1:
  897.                   uses the existing open file descriptor; the filename is
  898.                   stored solely for the getFileName() method and error messages.
  899.  
  900.           The file name may be followed by an optional sub-image index using
  901.           the syntax "filename:index" (see sssseeeettttCCCCuuuurrrrrrrreeeennnnttttIIIImmmmaaaaggggeeee() for how to change
  902.           the sub-image index after the file is opened).
  903.  
  904.           The mode argument specifies the desired access mode; it should be
  905.           either _O__R_D_O_N_L_Y or _O__R_D_W_R.
  906.  
  907.           The _f_o_r_m_a_t argument specifies the desired file format.  The usual
  908.           usage is to use NULL in which case the file format is deduced by the
  909.           file typing rules using the file's contents ("magic number"); this
  910.           mechanism can be bypassed by specifying the format explicitly.
  911.  
  912.           The alternate form taking a _f_i_l_e_D_e_s_c argument, encapsulates the _f_d,
  913.           _f_i_l_e_n_a_m_e and _f_o_r_m_a_t arguments in this single argument.  See
  914.           iflFileDesc(3) for more details.
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.                                                                        PPPPaaaaggggeeee 11114444
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  929.  
  930.  
  931.  
  932.           On successful completion, the function returns a pointer to a
  933.           newly-created object of the appropriate subclass if iflFile, which
  934.           the application should eventually destroy using its cccclllloooosssseeee() method.
  935.  
  936.           On failure, the function returns NULL and, if the _s_t_a_t_u_s argument is
  937.           non-NULL, sets the pointed-to iflStatus value to the appropriate
  938.           error value.
  939.  
  940.      ppppaaaarrrrsssseeeeFFFFiiiilllleeeeNNNNaaaammmmeeee(((())))
  941.  
  942.           char* iflFileParseFileName(iflFile *obj, const char* fullname,
  943.                                      char** formatName,
  944.                                      int* index, char** formatArgs)
  945.  
  946.  
  947.           This static class member function is used to parse a file name for
  948.           IFL. IFL file names have the following syntax:
  949.  
  950.           <file-name>[#<format-name>][:<image-index>][%<format-specific>]
  951.  
  952.  
  953.           The return value is the actual file name and must be delete'd by the
  954.           user.  The format name can be returned via _f_o_r_m_a_t_N_a_m_e if it is non-
  955.           NULL; if no format name is present in the filename then NULL will be
  956.           returned.  The sub-image index can be returned via _i_n_d_e_x if it is
  957.           non-NULL; if no index is present in the filename then -1 will be
  958.           returned.  The format specific argument string can be returned via
  959.           _f_o_r_m_a_t_A_r_g_s if it is non-NULL; if no format specific arguments are
  960.           present in the filename then NULL will be returned.
  961.  
  962.           This function is called automatically by the open() member function.
  963.  
  964.      sssseeeettttCCCCoooolllloooorrrrmmmmaaaapppp(((())))
  965.  
  966.           iflStatus iflFileSetColormap(iflFile *obj, const iflColormap* cmap)
  967.  
  968.  
  969.           Sets the color map associated with the current image to be a copy of
  970.           the colormap pointed to by the argument _c_m_a_p.
  971.  
  972.           On successful completion, the function returns iflOKAY.  On failure,
  973.           the function returns an iflStatus indicating the reason for failure.
  974.  
  975.           Whether or not the function succeeds, the value returned from
  976.           previous calls to getColormap() becomes invalid.
  977.  
  978.      sssseeeettttCCCCuuuurrrrrrrreeeennnnttttIIIImmmmgggg(((())))
  979.  
  980.           iflStatus iflFileSetCurrentImg(iflFile *obj, int i)
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.                                                                        PPPPaaaaggggeeee 11115555
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  995.  
  996.  
  997.  
  998.           This virtual member function sets the current image index (i.e. the
  999.           index into the list of images or resolutions in the image file,
  1000.           starting at 0) to _i_d_x.
  1001.  
  1002.           If the operation is successful, the value iflOKAY is returned and
  1003.           the image index is changed (which may mean the dimensions and
  1004.           attributes subsequently returned by the get...() methods may be
  1005.           changed).
  1006.  
  1007.           If the argument given is out of bounds of the images in the file,
  1008.           the value iiiiffffllllSSSSttttaaaattttuuuussssEEEEnnnnccccooooddddeeee(iflFILEFINDEXOOB) is returned and the
  1009.           image index is left unchanged.
  1010.  
  1011.           If the operation fails for some other reason, an ifl error will be
  1012.           thrown via the iiiiffffllllEEEErrrrrrrroooorrrr() mechanism; if the program continues, and
  1013.           the file's image index may be the old or the new index.
  1014.  
  1015.      virtual iflStatus iflFileSetICCProfile(iflFile *obj, int size,
  1016.                                             const void* profile)
  1017.  
  1018.  
  1019.  
  1020.      This virtual member function sets the value of the ICC profile associated
  1021.      with the image.  The return value is iflOKAY on success, or an
  1022.      appropriate iflStatus error value on failure.
  1023.  
  1024.      sssseeeettttIIIItttteeeemmmm(((())))
  1025.  
  1026.           iflStatus setItem(int tag, ...)
  1027.           iflStatus iflFileSetItemV(iflFile *obj, int tag,
  1028.                                             va_list ap)
  1029.  
  1030.  
  1031.           Sets the value of an item associated with the current image in the
  1032.           image file.
  1033.  
  1034.           Calling sssseeeettttIIIItttteeeemmmm() may change some image attributes.  This can be
  1035.           check by calling hhhhaaaavvvveeeeAAAAttttttttrrrriiiibbbbuuuutttteeeessssCCCChhhhaaaannnnggggeeeedddd() after calling sssseeeettttIIIItttteeeemmmm().
  1036.  
  1037.           The _t_a_g argument specifies the name of the item to be set; it is
  1038.           interpreted by the specific iflFile subclass.  The number and types
  1039.           of the remaining arguments are determined the particular subclass of
  1040.           iflFile and the tag value.
  1041.  
  1042.           The return value is iflOKAY on success, or an appropriate iflStatus
  1043.           error value on failure.
  1044.  
  1045.           The second overloaded form of this method is used by libraries that
  1046.           are passing along a variable calling sequence in _a_p through some
  1047.           wrapper layer.
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.                                                                        PPPPaaaaggggeeee 11116666
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  1061.  
  1062.  
  1063.  
  1064.      sssseeeettttPPPPaaaaggggeeee(((())))
  1065.  
  1066.           iflStatus iflFileSetPage(iflFile *obj, const void* data,
  1067.                                            int x, int y, int z,
  1068.                                            int c, int nx, int ny,
  1069.                                            int nz, int nc)
  1070.  
  1071.  
  1072.           This virtual member function writes a page of image data from the
  1073.           image file.
  1074.  
  1075.           The _d_a_t_a argument specifies the address of the memory buffer
  1076.           containing the data to be written.
  1077.  
  1078.           The arguments _x,_y,_z,_n_x,_n_y and _n_z specify the origin and size of the
  1079.           desired page within the source image file.  The caller must
  1080.           guarantee that _n_x,_n_y,_n_z and _n_c are the image's page size and that
  1081.           _x,_y,_z and _c are a multiple of the page size; no checking is done by
  1082.           the function.
  1083.  
  1084.           A successful call to sssseeeettttPPPPaaaaggggeeee() returns iflOKAY.  If an error occurs,
  1085.           an iflStatus value is returned describing the error; in this case
  1086.           the contents of the file are undefined.
  1087.  
  1088.           The same MP safety issues apply here as for ggggeeeettttPPPPaaaaggggeeee() (see above).
  1089.  
  1090.      sssseeeettttSSSSccccaaaalllleeeeMMMMiiiinnnnMMMMaaaaxxxx(((())))
  1091.  
  1092.           iflStatus iflFileSetScaleMinMax(iflFile *obj,
  1093.                                                   double min,
  1094.                                                   double max)
  1095.  
  1096.  
  1097.           Sets the minimum and maximum value to be used for scaling during
  1098.           color conversion on the current image in the image file.
  1099.  
  1100.           On successful completion, the function returns iflOKAY.  On failure,
  1101.           the function returns an iflStatus indicating the reason for failure.
  1102.  
  1103.      sssseeeettttSSSSttttaaaattttMMMMiiiinnnnMMMMaaaaxxxx(((())))
  1104.  
  1105.           iflStatus iflFileSetStatMinMax(iflFile *obj, double min,
  1106.                                                  double max)
  1107.  
  1108.  
  1109.           Sets the file's notion of the range of values that occur in the
  1110.           current image in the image file.
  1111.  
  1112.           On successful completion, the function returns iflOKAY.  On failure,
  1113.           the function returns an iflStatus indicating the reason for failure.
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.                                                                        PPPPaaaaggggeeee 11117777
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  1127.  
  1128.  
  1129.  
  1130.      sssseeeettttTTTTiiiilllleeee(((())))
  1131.  
  1132.           iflStatus iflFileSetTile(iflFile *obj, int x, int y, int z,
  1133.                                    int nx, int ny, int nz, const void *data,
  1134.                                    const iflConfig* config)
  1135.  
  1136.  
  1137.           This member function writes an arbitrary rectangular region from a
  1138.           memory buffer into the image file.  The portions of the memory
  1139.           buffer corresponding to area outside the boundaries of the source
  1140.           file image are ignored.
  1141.  
  1142.           The arguments _x,_y,_z,_n_x,_n_y and _n_z specify the origin and size of the
  1143.           target tile within the destination image file, in the coordinate
  1144.           space indicated in the _c_o_n_f_i_g parameter.
  1145.  
  1146.           The _d_a_t_a argument specifies the address of the memory buffer
  1147.           containing the data to be written.
  1148.  
  1149.           The _c_o_n_f_i_g argument describes the configuration of the memory
  1150.           buffer, and its orientation also affects the interpretation of
  1151.           _x,_y,_z,_n_x,_n_y and _n_z, as described above.  If defaulted, attributes of
  1152.           the buffer are assumed to match those of the image.
  1153.  
  1154.           A successful call to sssseeeettttTTTTiiiilllleeee() returns iflOKAY.  If an error occurs,
  1155.           an iflStatus value is returned describing the error; in this case
  1156.           the contents of the file are undefined.
  1157.  
  1158.           Note that sssseeeettttTTTTiiiilllleeee() may need to make calls to the subclass's
  1159.           ggggeeeettttPPPPaaaaggggeeee() as well as setPage() in order to write a tile that is not
  1160.           aligned with the file's pages.
  1161.  
  1162. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  1163.      iflFormat(3), iflSize(3), iflFileDesc(3)
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.                                                                        PPPPaaaaggggeeee 11118888
  1186.  
  1187.  
  1188.  
  1189.