next up previous contents index
Next: Related file (external) types Up: Color Float Images Previous: Color Float Images   Contents   Index


The structure Cfimage

This memory type is not exactly the same as Ccimage (See section 2.2.1 page [*]): the difference is not only about the RGB fields which are pointers to floating points values and not to unsigned char, but also about the color model. A color model is a specification of a 3D-coordinate system and a subspace within that system where each color is represented by a single point. Whatever the color model, a cfimage is alway made by three planes called red, green and blue. The significance of those planes is given by the value of the model field. The first plane red matches the first letter of the model's name (e.g. R for RGB model, H for HSI model), the second plane green matches the second letter of the model's name (e.g. G for RGB model, S for HSI model), and the third plane blue matches the third letter (e.g. B for RGB model, I for HSI model).

The implemented color models are

Be aware that a MegaWave2 module which takes a cfimage in input performs a statement likely to work for one color model only. One should checks the value of the model field before any statement.

typedef struct cfimage {
  int nrow;        /* Number of rows (dy) */
  int ncol;        /* Number of columns (dx) */
  int model;       /* Model of the colorimetric system */

  float *red;      /* The Red plane if model=MODEL_RGB (may be NULL) or Y/H   */
  float *green;    /* The Green plane if model=MODEL_RGB (may be NULL) or U/S */
  float *blue;     /* The Blue plane if model=MODEL_RGB (may be NULL) or V/I  */

  float scale;     /* Scale of the picture (should be 1 for original pict.) */
  char cmt[mw_cmtsize]; /* Comments */
  char name[mw_namesize]; /* Name of the image */
  
  /* Defines the signifiant part of the picture : */
  int firstcol;    /* index of the first col not affected by left side effect*/
  int lastcol;     /* index of the last col not affected by right side effect*/
  int firstrow;    /* index of the first row not aff. by upper side effect */  
  int lastrow;     /* index of the last row not aff. by lower side effect */  

} *Cfimage;


next up previous contents index
Next: Related file (external) types Up: Color Float Images Previous: Color Float Images   Contents   Index
mw 2004-05-05