+
+extern gfxcolor_t getFillColor(GfxState * state);
+
+char area_is_plain_colored(GfxState*state, SplashBitmap*boolpoly, SplashBitmap*rgbbitmap, int x1, int y1, int x2, int y2)
+{
+ int width = boolpoly->getWidth();
+ int height = boolpoly->getHeight();
+ if(!fixBBox(&x1, &y1, &x2, &y2, width, height)) {
+ return 0;
+ }
+ gfxcolor_t color = getFillColor(state);
+ SplashColorPtr rgb = rgbbitmap->getDataPtr()
+ + (y1*width+x1)*sizeof(SplashColor);
+ int width8 = (width+7)/8;
+ unsigned char*bits = (unsigned char*)boolpoly->getDataPtr()
+ + (y1*width8+x1);
+ int x,y;
+ int w = x2-x1;
+ int h = y2-y1;
+ for(y=0;y<h;y++) {
+ for(x=0;x<w;x++) {
+ if(rgb[x*3+0] != color.r ||
+ rgb[x*3+1] != color.g ||
+ rgb[x*3+2] != color.b)
+ return 0;
+ }
+ rgb += width*sizeof(SplashColor);
+ }
+ return 1;
+}
+