Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ iflLut(3) — IRIX 6.5.3f

Media Vault

Software Library

Restoration Projects

Artifacts Sought



iflLut(3)         Image Format Library C++ Reference Manual          iflLut(3)



NAME
     iflLut - base class for defining look-up tables


INHERITS FROM
     This is a base class with no inheritance.


HEADER FILE
     #include <il/iflLut.h>


CLASS DESCRIPTION
     iflLut is a base class used for accessing and manipulating look-up
     tables. The class definition provides the necessary data structure for
     defining and accessing the look-up table.

     A look-up table is defined by the number of channels, the range of input
     values it expects (the domain), the data type, and the actual look-up
     table data.  There is a table for each channel and the size and data type
     of each table is the same.  The look-up table data is stored in
     iflSequential format. In other words, the table for each channel is
     stored contiguously.  The tables for each channel are packed together
     into a single array.

   Using iflLut
     The iflLut object can either be used to allocate a look-up table whose
     values are filled in by calls to the setVal() function, or it can be used
     to wrap an object definition around an existing array of lut values.
     Constructors are provided for both of these usages.  When the iflLut
     allocates the tables, it frees them when it is deleted.  If the tables
     are passed to the constructor, then the caller is responsible for the
     management of the table memory.  Once an iflLut is constructed, its table
     can be completely replaced using the setData() function, or it can be
     modified an entry at a time with setVal().

     The values in the lut can be accesed by getting a pointer to the table
     with getData(), getChan() or getOrigin().  The pointer returned must be
     cast to match the internal type of the table as returned by
     getDataType().  Alternatively, individual entries in the table can be
     accesed using the getVal() function.  While less efficient, this function
     is easier to use since getVal() automatically converts to double so that
     the data type of the table can be ignored. It also automatically deals
     with and scaling necessary to deal with a domain that is not a one to one
     mapping onto the number of entries in the look up tables.

     The range of values contained in the tables can be interrogated by
     getRange().  The range of values the lut expects as input can be accessed
     with getDomain().






                                                                        Page 1





iflLut(3)         Image Format Library C++ Reference Manual          iflLut(3)



CLASS MEMBER FUNCTION SUMMARY
     Constructor

          iflLut()
          iflLut(int numChan, iflDataType dtype, double min, double max,
                 int length=0)
          iflLut(void* table, int numChan, iflDataType dtype, double min,
                 double max, int length=0)
          iflLut(const iflLut& other)

     Basic attributes

          int getNumChans()
          iflDataType getDataType()
          int getLength()

     Entry access

          double getVal(double domainIdx, int chan=0)
          iflStatus setVal(double val, double domainIdx, int chan=0)

     Direct table access

          void* getOrigin(int chan)
          void* getChan(int chan)
          void* getData()
          void setData(void* dataPnt)

     Domain and range control

          void getDomain(double& min, double& max)
          double getDomainMin()
          double getDomainMax()
          double getDomainStep()
          void getRange(double& min, double& max)
          iflStatus setDomain(double min, double max)

     Comparison

          int isDiff(const iflLut& from)

     Initialization

          void operator=(const iflLut& from)
          void init(void* table, int tabChannels, iflDataType tabType,
                    double min, double max, int length=0)   protected









                                                                        Page 2





iflLut(3)         Image Format Library C++ Reference Manual          iflLut(3)



FUNCTION DESCRIPTIONS
     iflLut()

          iflLut()
          iflLut(const iflLut& other)
          iflLut(int numChan, iflDataType dtype, double min, double max,
                 int length=0)
          iflLut(void* table, int numChan, iflDataType dtype, double min,
                 double max, int length=0)


          Constructors for the iflLut class.  The number of tables or channels
          in the lut is specified by numChan and the LUT data type is
          specified by dtype.  The domain of values the table handles is from
          min to max.  The length of each table is either max-min+1 if length
          is 0, otherwise it is given by length.  A constructor is also
          provided that creates an iflLut whose look-up table data is  pointed
          to by table. Another constructor is provided that copies the tables
          and attributes from the iflLut specified by other into this object
          The default constructor generates an empty iflLut.  This can be
          useful in conjuction with the assigment operator.

     getChan()

          void* getChan(int chan)


          Returns a pointer to the beginning of the table for channel number
          chan.

     getData()

          void* getData()


          Returns a pointer to the overall beginning of the tables for all
          channels.  If returns the same value as getChan(0).

     getDataType()

          iflDataType getDataType()


          Returns the data type of the entries in the look-up table.

     getDomain()

          void getDomain(double& min, double& max)







                                                                        Page 3





iflLut(3)         Image Format Library C++ Reference Manual          iflLut(3)



          Returns the domain, in min and max, that the look-up table handles
          as input.

     getDomainMax()

          double getDomainMax()


          Returns the maximum value that the look-up table handles as input.

     getDomainMin()

          double getDomainMin()


          Returns the minimum value that the look-up table handles as input.

     getDomainStep()

          double getDomainStep()


          Returns the incremental step in the domain space between adjacent
          entries in the look-up table.

     getLength()

          int getLength()


          Returns the length of a table for an individual channel.

     getNumChans()

          int getNumChans()


          Returns the number of channels in the look-up table.

     getOrigin()

          void* getOrigin(int chan)


          Returns a pointer to the entry for value zero of the table for
          channel number chan.

     getRange()

          void getRange(double& min, double& max)





                                                                        Page 4





iflLut(3)         Image Format Library C++ Reference Manual          iflLut(3)



          Returns the range of values that the look-up table contains in min
          and max.

     getVal()

          double getVal(double domainIdx, int chan=0)


          Returns the look-up table entry for channel, chan, and input value,
          domainidx.  The domain index is scaled as needed to map onto the
          actual table entries when the table length does not map one to one
          onto the domain.

     init()

          void init(void* table, int tabChannels, iflDataType tabType,
                    double min, double max, int length=0)   protected


          This method fully initializes this object with the specified
          attributes, the interpreation of the parameters is the same as for
          the constructors.

     isDiff()

          int isDiff(const iflLut& from)


          The method returns TRUE if the the this lut is not identical, in
          attributes and tables contents, to the lut specified by from; FALSE
          is returned if the luts are the same.

     operator=()

          void operator=(const iflLut& from)


          This function makes a copy of the look-up table (including all of
          its tables) specified by from.

     setData()

          void setData(void* dataPnt)


          This function replaces the array of all the tables in the lut with
          the data pointed to be data.  The array of data is not copied, nor
          is it deallocated when the iflLut is deleted.  The format of the
          data must match the data type, length, and number of channels in the
          iflLut.  See the Class Description section for details on the layout
          of the look-up table data.




                                                                        Page 5





iflLut(3)         Image Format Library C++ Reference Manual          iflLut(3)



     setDomain()

          iflStatus setDomain(double min, double max)


          Sets the range of values that this lut expects to min and max.  If
          max-min+1 exceeds the current length of the table, a status of
          iflBADPARAMS is returned; iflOKAY is returned if the operation is
          successful.

     setVal()

          iflStatus setVal(double val, double domainIdx, int chan=0)


          This function sets the look-up table entry for channel, chan, and
          input value, domainidx.  The value given by val is converted to the
          internal data type of the table.  If the entry indicated is not
          contained in the iflLut, a value of iflBADPARAMS is returned;
          iflOKAY is returned if the operation is successful.  The domain
          index is scaled as needed to map onto the actual table entries when
          the table length does not map one to one onto the domain.

SEE ALSO
     iflColormap, iflSGIColormap






























                                                                        Page 6



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026