expansion.Set_y(ref_subs.Get_y() / min_subs.Get_y());
for (c = 0; c < channels.Get_num_channels(); c++) {
codestream.Get_subsampling(channels.Get_source_component(c), subs);
if ((((subs.Get_x() * expansion.Get_x()) % ref_subs.Get_x()) != 0) ||
(((subs.Get_y() * expansion.Get_y()) % ref_subs.Get_y()) != 0)) {
Kdu_global.Kdu_print_error("The supplied JP2 file contains color channels "
+ "whose sub-sampling factors are not integer " + "multiples of one another.");
codestream.Apply_input_restrictions(0, 1, 0, 0, null, Kdu_global.KDU_WANT_OUTPUT_COMPONENTS);
channels.Configure(codestream);
expansion = new Kdu_coords(1, 1);