rev 421 - trunk

[email protected] Wed, 27 Jul 2005 18:00:00 -0700 (PDT)
Newsgroups gmane.comp.printing.ghostscript.jbig2dec.cvs
Message-ID <[email protected]>
Author: giles
Date: 2005-07-27 17:59:59 -0700 (Wed, 27 Jul 2005)
New Revision: 421

Modified:
   trunk/jbig2_image.c
Log:
Warning cleanup. Implement an unoptimized version of the REPLACE image
composition operator.


Modified: trunk/jbig2_image.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/jbig2_image.c	2005-07-27 23:55:54 UTC (rev 420)
+++ trunk/jbig2_image.c	2005-07-28 00:59:59 UTC (rev 421)
@@ -90,8 +90,9 @@
 	    image->data =3D jbig2_realloc(ctx->allocator,
                 image->data, image->stride*height);
             if (image->data =3D=3D NULL) {
-                return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,
+                jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,
                     "could not resize image buffer!");
+		return NULL;
             }
 	    if (height > image->height) {
 		memset(image->data + image->height*image->stride,
@@ -105,7 +106,7 @@
 		"jbig2_image_resize called with a different width (NYI)");
 	}
=20
-	return 0;
+	return NULL;
 }
=20
 /* composite one jbig2_image onto another
@@ -163,6 +164,14 @@
 		}
     	    }
 	    break;
+	case JBIG2_COMPOSE_REPLACE:
+	    for (j =3D 0; j < sh; j++) {
+		for (i =3D 0; i < sw; i++) {
+		    jbig2_image_set_pixel(dst, i+x, j+y,
+			jbig2_image_get_pixel(src, i+sx, j+sy));
+		}
+    	    }
+	    break;
     }
=20
     return 0;
@@ -290,7 +299,7 @@
 {
   const int w =3D image->width;
   const int h =3D image->height;
-  int i, scratch, mask;
+  int scratch, mask;
   int bit, byte;
=20
   if ((x < 0) || (x >=3D w)) return 0;