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


The structure Ccimage

Beginners should focus on the first five fields only of this structure. You should also consider the fields previous and next if your image is part of a movie. Some fields are not used at this time, such firstcol ...lastrow, but future modules may access to them.

typedef struct ccimage {
  int nrow;        /* Number of rows (dy) */
  int ncol;        /* Number of columns (dx) */

  unsigned char *red;     /* The red level plane (may be NULL) */
  unsigned char *green;   /* The green level plane (may be NULL) */
  unsigned char *blue;    /* The blue level plane (may be NULL) */

  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 */  

  /* For use in Movies only */
  struct ccimage *previous; /* Pointer to the previous image (may be NULL) */
  struct ccimage *next; /* Pointer to the next image (may be NULL) */

} *Ccimage;

Do not change by yourself the content of nrow and ncol: the size of the image has to be modified using functions of the library only (see section 2.2.3 page [*]).

You can put unsigned char values in the arrays red, green, blue at the expressed condition that you do not exceed the maximum value of the index, given by ncol×nrow - 1.

Actually, everything works as for the Cimage structure (see section 2.1.1 page [*]) but you have to deal with three planes instead of only one. That is the proportion between each RGB component that will give you the color. Notice that you can get more than 16 millions of different colors ( 23×8 exactly), so you need appropriate device to see or print such image with fidelity.


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