[BACK]Return to bitmap.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / gnuplot

Diff for /OpenXM_contrib/gnuplot/Attic/bitmap.c between version 1.1.1.2 and 1.1.1.3

version 1.1.1.2, 2000/01/22 14:15:56 version 1.1.1.3, 2003/09/15 07:09:24
Line 846  unsigned int x, y, value;
Line 846  unsigned int x, y, value;
 }  }
   
   
 /* Currently unused */  
 #if 1 /* HBB 991008: used by PNG, now */  
 /*  /*
  * get pixel (x,y) value   * get pixel (x,y) value
  */   */
Line 857  unsigned int x, y;
Line 855  unsigned int x, y;
 {  {
   register unsigned int row;    register unsigned int row;
   register unsigned char mask;    register unsigned char mask;
   register unsigned char value;    register unsigned char value = 0;
   int i;    int i;
   
   if (b_rastermode) {    if (b_rastermode) {
Line 876  unsigned int x, y;
Line 874  unsigned int x, y;
                 row -= b_psize;                  row -= b_psize;
                 value <<= 1;                  value <<= 1;
         }          }
     return(value);  /* HBB 991123: the missing '>>1' was the 'every second color' problem
   }   * with PNG in 3.8a...*/
   else          return(value>>1);
   {    } else {
 #ifdef BITMAPDEBUG  #ifdef BITMAPDEBUG
     if (b_rastermode)      if (b_rastermode)
       fprintf(stderr, "Warning: getpixel(%d,%d) out of bounds\n",        fprintf(stderr, "Warning: getpixel(%d,%d) out of bounds\n",
Line 890  unsigned int x, y;
Line 888  unsigned int x, y;
     return(0);      return(0);
   }    }
 }  }
 #endif /* 0 */  
   
   
 /*  /*
Line 914  unsigned int x, y, planes;
Line 911  unsigned int x, y, planes;
     b_angle = 0;      b_angle = 0;
     b_rastermode = 0;      b_rastermode = 0;
     /* allocate row pointers */      /* allocate row pointers */
     b_p = (bitmap *) gp_alloc((unsigned long) rows * sizeof(pixels *), "bitmap row buffer");      b_p = (bitmap *) gp_alloc(rows * sizeof(pixels *), "bitmap row buffer");
     memset(b_p, 0, rows * sizeof(pixels *));      memset(b_p, 0, rows * sizeof(pixels *));
     for (j = 0; j < rows; j++) {      for (j = 0; j < rows; j++) {
         /* allocate bitmap buffers */          /* allocate bitmap buffers */
         (*b_p)[j] = (pixels *) gp_alloc((unsigned long) x * sizeof(pixels), (char *) NULL);          (*b_p)[j] = (pixels *) gp_alloc(x * sizeof(pixels), (char *) NULL);
         if ((*b_p)[j] == (pixels *) NULL) {          if ((*b_p)[j] == (pixels *) NULL) {
             b_freebitmap();     /* free what we have already allocated */              b_freebitmap();     /* free what we have already allocated */
             int_error("out of memory for bitmap buffer", NO_CARET);              int_error("out of memory for bitmap buffer", NO_CARET);

Legend:
Removed from v.1.1.1.2  
changed lines
  Added in v.1.1.1.3

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>