/// <summary> Advances to the next tile, in standard scan-line order (by rows then /// columns). An NoNextElementException is thrown if the current tile is /// the last one (i.e. there is no next tile). /// /// <P>This default implementation just advances to the next tile in the /// source and re-initializes properly component transformation variables. /// /// </summary> public override void nextTile() { src.nextTile(); tIdx = TileIdx; // index of the current tile // initializations int cttype = ((System.Int32)cts.getTileDef(tIdx)); switch (cttype) { case InvCompTransf.NONE: rb = utrb; break; case InvCompTransf.INV_RCT: rb = InvCompTransf.calcMixedBitDepths(utrb, InvCompTransf.INV_RCT, null); break; case InvCompTransf.INV_ICT: rb = InvCompTransf.calcMixedBitDepths(utrb, InvCompTransf.INV_ICT, null); break; default: throw new System.ArgumentException("Non JPEG 2000 part I " + "component" + " transformation for tile: " + tIdx); } }
/// <summary> Changes the current tile, given the new indexes. An /// IllegalArgumentException is thrown if the indexes do not /// correspond to a valid tile. /// /// <P>This default implementation changes the tile in the source /// and re-initializes properly component transformation variables.. /// /// </summary> /// <param name="x">The horizontal index of the tile. /// /// </param> /// <param name="y">The vertical index of the new tile. /// /// </param> public override void setTile(int x, int y) { src.setTile(x, y); tIdx = TileIdx; // index of the current tile // initializations int cttype = 0; if (((System.Int32)cts.getTileDef(tIdx)) == InvCompTransf.NONE) { cttype = InvCompTransf.NONE; } else { int nc = src.NumComps > 3?3:src.NumComps; int rev = 0; for (int c = 0; c < nc; c++) { rev += (wfs.isReversible(tIdx, c)?1:0); } if (rev == 3) { // All WT are reversible cttype = InvCompTransf.INV_RCT; } else if (rev == 0) { // All WT irreversible cttype = InvCompTransf.INV_ICT; } else { // Error throw new System.ArgumentException("Wavelet transformation " + "and " + "component transformation" + " not coherent in tile" + tIdx); } } switch (cttype) { case InvCompTransf.NONE: rb = utrb; break; case InvCompTransf.INV_RCT: rb = InvCompTransf.calcMixedBitDepths(utrb, InvCompTransf.INV_RCT, null); break; case InvCompTransf.INV_ICT: rb = InvCompTransf.calcMixedBitDepths(utrb, InvCompTransf.INV_ICT, null); break; default: throw new System.ArgumentException("Non JPEG 2000 part I " + "component" + " transformation for tile: " + tIdx); } }