int ref_component = channels.Get_source_component(0);
Kdu_coords ref_expansion = getReferenceExpansion(ref_component, channels, codestream);
Kdu_dims image_dims = new Kdu_dims();
codestream.Get_dims(ref_component, image_dims);
Kdu_coords imageSize = image_dims.Access_size();
Kdu_coords imagePosition = image_dims.Access_pos();
if (useleftDouble)
left = imagePosition.Get_x() + (int) Math.round(leftDouble * imageSize.Get_x());
if (usetopDouble)
top = imagePosition.Get_y() + (int) Math.round(topDouble * imageSize.Get_y());