Kdu_dims new_region = new Kdu_dims();
Kdu_dims incomplete_region = new Kdu_dims();
Kdu_coords viewSize = view_dims.Access_size();
incomplete_region.Assign(image_dims);
int[] imgBuffer = new int[viewSize.Get_x() * viewSize.Get_y()];
int[] kduBuffer = null;
while (decompressor.Process(region_buf, image_dims.Access_pos(), 0, 0, region_buf_size, incomplete_region, new_region)) {
Kdu_coords newOffset = new_region.Access_pos();
Kdu_coords newSize = new_region.Access_size();
newOffset.Subtract(view_dims.Access_pos());