--- src_com_fluendo_jheora_YUVBuffer.java 2009-10-17 01:23:40.000000000 -0400 +++ YUVBuffer2.java 2009-10-17 01:42:59.000000000 -0400 @@ -42,6 +42,11 @@ private int pix_size; private boolean newPixels = true; private ColorModel colorModel = ColorModel.getRGBdefault(); + private ImageProducer filteredThis; + private int crop_x; + private int crop_y; + private int crop_w; + private int crop_h; public void addConsumer(ImageConsumer ic) { } @@ -92,7 +97,19 @@ } public Object getObject(int x, int y, int width, int height) { - return this; + if (x == 0 && y == 0 && width == y_width && height == y_height) { + return this; + } else { + if (x != crop_x || y != crop_y || width != crop_w || height != crop_h) { + crop_x = x; + crop_y = y; + crop_w = width; + crop_h = height; + filteredThis = FilteredImageSource(this, + CropImageFilter(crop_x, crop_y, crop_w, crop_h)); + } + return filteredThis; + } }