]> git.imager.perl.org - imager.git/blobdiff - img8.c
hopefully avoid coverity complaining about a float vs int comparison
[imager.git] / img8.c
diff --git a/img8.c b/img8.c
index c64a4cee54041cddc1f430e1322f342c9eebbdfe..2893a486c378c8faee115fb4650a4efbc7c5f7f7 100644 (file)
--- a/img8.c
+++ b/img8.c
@@ -82,10 +82,10 @@ static i_img IIM_base_8bit_direct =
   }*/
 
 /*
-=item i_img_8_new(x, y, ch)
-
+=item im_img_8_new(ctx, x, y, ch)
+X<im_img_8_new API>X<i_img_8_new API>
 =category Image creation/destruction
-
+=synopsis i_img *img = im_img_8_new(aIMCTX, width, height, channels);
 =synopsis i_img *img = i_img_8_new(width, height, channels);
 
 Creates a new image object I<x> pixels wide, and I<y> pixels high with
@@ -94,7 +94,6 @@ I<ch> channels.
 =cut
 */
 
-
 i_img *
 im_img_8_new(pIMCTX, i_img_dim x,i_img_dim y,int ch) {
   i_img *im;
@@ -108,41 +107,6 @@ im_img_8_new(pIMCTX, i_img_dim x,i_img_dim y,int ch) {
   return im;
 }
 
-#if 0
-/* 
-=item i_img_new()
-
-Create new image reference - notice that this isn't an object yet and
-this should be fixed asap.
-
-=cut
-*/
-
-
-i_img *
-i_img_new() {
-  i_img *im;
-  
-  mm_log((1,"i_img_struct()\n"));
-
-  im = i_img_alloc();
-  
-  *im = IIM_base_8bit_direct;
-  im->xsize=0;
-  im->ysize=0;
-  im->channels=3;
-  im->ch_mask=MAXINT;
-  im->bytes=0;
-  im->idata=NULL;
-
-  i_img_init(im);
-  
-  mm_log((1,"(%p) <- i_img_struct\n",im));
-  return im;
-}
-
-#endif
-
 /* 
 =item i_img_empty(im, x, y)
 
@@ -209,10 +173,10 @@ im_img_empty_ch(pIMCTX, i_img *im,i_img_dim x,i_img_dim y,int ch) {
   im->xsize    = x;
   im->ysize    = y;
   im->channels = ch;
-  im->ch_mask  = MAXINT;
+  im->ch_mask  = ~0U;
   im->bytes=bytes;
   if ( (im->idata=mymalloc(im->bytes)) == NULL) 
-    i_fatal(2,"malloc() error\n"); 
+    im_fatal(aIMCTX, 2,"malloc() error\n"); 
   memset(im->idata,0,(size_t)im->bytes);
   
   im->ext_data = NULL;
@@ -263,7 +227,7 @@ Internal function.
 This is the function kept in the i_f_gpix member of an i_img object.
 It does normal retrieval of a pixel from the image with range checking.
 
-Returns 0 if the pixel could be set, -1 otherwise.
+Returns 0 if the pixel could be retrieved, -1 otherwise.
 
 =cut
 */