
ByteConverter(UI)    Cube Reference Manual    ByteConverter(UI)

NAME
     ByteConverter - base class for doing byte convertion

SYNOPSIS
     #include <Cube/converter.h>

DESCRIPTION
     A ByteConverter transforms an array of float into  an  array
     of  unsigned  char  ready  for  a  raster representation.  A
     ByteConverter is an  element  of  a  SepData  object.   This
     object  stores  internally variables to determined the plot-
     ting parameters such as the percentage  of  clip,  the  tpow
     value, the gpow half way percentile phalf.

PUBLIC OPERATIONS
     ByteConverter(int n,float o,float d,int n2)
          Construct a byte converter object with  the  definition
          of  the  time  axis and the number of element along the
          second axis.

     unsigned char * Byte(int zoPix,int ndPix,int pcPix,
                          int ncPix,float *d)
     unsigned char * Byte(float *d)
          Do the convertion of the input data float into unsigned
          char.  The  pixels  value corresponding to the non data
          value, to the zero data value,  to  the  positive  clip
          value, to the negative clip value may be arguments.

     void SetTpow(float)
     float GetTpow()
          Set or get the tpow value.  The clip, gpow  depends  on
          the  current  tpow  value and are recomputed if tpow is
          changed.

     void SetClip(float)
     float GetClip()
          Set or Get the absolute  clip  value.  A  default  clip
          value is computed from the pclip.

     void SetPclip(float)
     float GetPclip()
          Set or Get the  percentage  of  clipping.  The  default
          value of the clip is 99%.

     void SetGpow(float)
     float GetGpow()
          Set or Get the absolute gpow value.  A  gpow  value  is
          computed from the gpow half way percentile (phalf).

     void SetPhalf(float)
     float GetPhalf()
          Set or Get the gpow half way  percentile.  The  initial

ByteConverter(UI)    Cube Reference Manual    ByteConverter(UI)

          value of the phalf is 85%.

PROTECTED OPERATIONS
     void FindExtrem(float *d,int n)
          Find minimum and maximum of the input data.

     void FindMean(float *d,int n)
          Find the absolute mean value.

     void FindClip(float *d,int n)
          Find the absolute clip value from the pclip value  from
          the input data.  The input data must have been multiply
          by the tpow table and symetrized around the mean.

     void FindGpow(float *d,int n)
          Find the gpow value from the parameter phalf, from  the
          clip value clip with the input data.

     void FindTpow()
          Set the tpow value to .

     void BuildGpowTable(int *gpowTable,int ngpow,int zp,
                         int pcp,int ncp)
          Build a gpow table of dimension ngpow  with  the  input
          pixels  value:  zp  zero  pixel value, pcp positif clip
          pixel value, ncp negative clip pixel value.

     void BuildTpowTable(float *tpowTable,int n,float o,float d)
          Build a tpow table of dimension n with the data  origin
          o  and the data increment of d. The tpow value has been
          set by using the function SetTpow.

     void SubSample(int n,int n2,int n3,float *d,float *sd,
                    int nn,int nn2,int nn3,int j,
                    int j2,int j3,int f,int f2,int f3)
          Subsample  the  data  d  beginning  at  j,j2,j3  every
          j,j2,j3 samples and output nn,nn2,nn3 samples.

     void TpowSubSample(float *ind,float *out,int n,int n2,
                        int j,int j2,float *tpow)
          Compute an subsample array out from the input array ind
          multiplying elements by a tpow table.

     float Cent(float pcent,float *data,int n)
          Compute the centile of the input data.

PROTECTED VARIABLES
     o,d,n,n2
          Description of the data

     in tzoPix, ndPix, pCPix, nCPix
          anchor pixel values

ByteConverter(UI)    Cube Reference Manual    ByteConverter(UI)

     float * tpowTable, *gpowTable
          Intern convertion table.

     float dmin,dmax,dmean:
          data maxima. data mean.

     float clip, pclip:
          clip value.  clip percentile.

     float gpow, float phalf, float half:
          half way value for gpow.  signed power.  gpow half  way
          percentile.

     float tpow:
          coordinate scale factor.

     SepMask flags:
          flags recording user definitions and computation stage.

SEE ALSO
     Seplib, intro

