[jbig2-cvs] rev 421 - trunk

giles at ghostscript.com giles at ghostscript.com
Wed Jul 27 18:00:00 PDT 2005


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
===================================================================
--- 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 = jbig2_realloc(ctx->allocator,
                 image->data, image->stride*height);
             if (image->data == 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)");
 	}
 
-	return 0;
+	return NULL;
 }
 
 /* composite one jbig2_image onto another
@@ -163,6 +164,14 @@
 		}
     	    }
 	    break;
+	case JBIG2_COMPOSE_REPLACE:
+	    for (j = 0; j < sh; j++) {
+		for (i = 0; i < sw; i++) {
+		    jbig2_image_set_pixel(dst, i+x, j+y,
+			jbig2_image_get_pixel(src, i+sx, j+sy));
+		}
+    	    }
+	    break;
     }
 
     return 0;
@@ -290,7 +299,7 @@
 {
   const int w = image->width;
   const int h = image->height;
-  int i, scratch, mask;
+  int scratch, mask;
   int bit, byte;
 
   if ((x < 0) || (x >= w)) return 0;



More information about the jbig2-cvs mailing list