@Test public void testTiePointFlipping_WithSubset() throws IOException { final ProductSubsetDef subsetDef = new ProductSubsetDef(); subsetDef.setRegion(2, 2, 10, 10); subsetDef.setSubSampling(2, 2); final Product sub = ProductSubsetBuilder.createProductSubset(product, subsetDef, "s", "s"); final TiePointGrid sFlippedT1 = sub.getTiePointGrid("t1"); assertEquals(-0.75, sFlippedT1.getOffsetX(), 1.0e-6); assertEquals(-0.75, sFlippedT1.getOffsetY(), 1.0e-6); assertEquals(2.5, sFlippedT1.getSubSamplingX(), 1.0e-6); assertEquals(2.5, sFlippedT1.getSubSamplingY(), 1.0e-6); final TiePointGrid sFlippedT2 = sub.getTiePointGrid("t3"); assertEquals(-0.25, sFlippedT2.getOffsetX(), 1.0e-6); assertEquals(-0.25, sFlippedT2.getOffsetY(), 1.0e-6); assertEquals(1.5, sFlippedT2.getSubSamplingX(), 1.0e-6); assertEquals(1.5, sFlippedT2.getSubSamplingY(), 1.0e-6); final Product sv = ProductFlipper.createFlippedProduct(sub, ProductFlipper.FLIP_VERTICAL, "sv", "v"); final TiePointGrid svFlippedT1 = sv.getTiePointGrid("t1"); assertEquals(-0.75, svFlippedT1.getOffsetX(), 1.0e-6); assertEquals(0.75, svFlippedT1.getOffsetY(), 1.0e-6); assertEquals(2.5, svFlippedT1.getSubSamplingX(), 1.0e-6); assertEquals(2.5, svFlippedT1.getSubSamplingY(), 1.0e-6); final TiePointGrid svFlippedT2 = sv.getTiePointGrid("t3"); assertEquals(-0.25, svFlippedT2.getOffsetX(), 1.0e-6); assertEquals(2.25, svFlippedT2.getOffsetY(), 1.0e-6); assertEquals(1.5, svFlippedT2.getSubSamplingX(), 1.0e-6); assertEquals(1.5, svFlippedT2.getSubSamplingY(), 1.0e-6); final Product sh = ProductFlipper.createFlippedProduct(sub, ProductFlipper.FLIP_HORIZONTAL, "sh", "vh"); final TiePointGrid shFlippedT1 = sh.getTiePointGrid("t1"); assertEquals(0.75, shFlippedT1.getOffsetX(), 1.0e-6); assertEquals(-0.75, shFlippedT1.getOffsetY(), 1.0e-6); assertEquals(2.5, shFlippedT1.getSubSamplingX(), 1.0e-6); assertEquals(2.5, shFlippedT1.getSubSamplingY(), 1.0e-6); final TiePointGrid shFlippedT2 = sh.getTiePointGrid("t3"); assertEquals(2.25, shFlippedT2.getOffsetX(), 1.0e-6); assertEquals(-0.25, shFlippedT2.getOffsetY(), 1.0e-6); assertEquals(1.5, shFlippedT2.getSubSamplingX(), 1.0e-6); assertEquals(1.5, shFlippedT2.getSubSamplingY(), 1.0e-6); final Product sb = ProductFlipper.createFlippedProduct(sub, ProductFlipper.FLIP_BOTH, "sb", "sb"); final TiePointGrid sbFlippedT1 = sb.getTiePointGrid("t1"); assertEquals(0.75, sbFlippedT1.getOffsetX(), 1.0e-6); assertEquals(0.75, sbFlippedT1.getOffsetY(), 1.0e-6); assertEquals(2.5, sbFlippedT1.getSubSamplingX(), 1.0e-6); assertEquals(2.5, sbFlippedT1.getSubSamplingY(), 1.0e-6); final TiePointGrid sbFlippedT2 = sb.getTiePointGrid("t3"); assertEquals(2.25, sbFlippedT2.getOffsetX(), 1.0e-6); assertEquals(2.25, sbFlippedT2.getOffsetY(), 1.0e-6); assertEquals(1.5, sbFlippedT2.getSubSamplingX(), 1.0e-6); assertEquals(1.5, sbFlippedT2.getSubSamplingY(), 1.0e-6); }
public static Product createFlippedProduct(Product sourceProduct, int flipType, String name, String desc) throws IOException { return createFlippedProduct(sourceProduct, false, flipType, name, desc); }
ProductFlipper extends AbstractProductBuilder { public static Product createFlippedProduct(Product sourceProduct, int flipType, String name, String desc) throws IOException { return createFlippedProduct(sourceProduct, false, flipType, name, desc); } }
ProductFlipper extends AbstractProductBuilder { public static Product createFlippedProduct(Product sourceProduct, int flipType, String name, String desc) throws IOException { return createFlippedProduct(sourceProduct, false, flipType, name, desc); } ProductFlipper(int flipType);  ProductFlipper(int flipType, boolean sourceProductOwner); }
ProductFlipper extends AbstractProductBuilder { public static Product createFlippedProduct(Product sourceProduct, int flipType, String name, String desc) throws IOException { return createFlippedProduct(sourceProduct, false, flipType, name, desc); } ProductFlipper(int flipType);  ProductFlipper(int flipType, boolean sourceProductOwner); static Product createFlippedProduct(Product sourceProduct, int flipType, String name, String desc); static Product createFlippedProduct(Product sourceProduct, boolean sourceProductOwner, int flipType,
                                               String name, String desc); int getFlipType(); @Override void close(); @Override void readBandRasterData(Band destBand,
                                   int destOffsetX,
                                   int destOffsetY,
                                   int destWidth,
                                   int destHeight,
                                   ProductData destBuffer,
                                   ProgressMonitor pm); }
ProductFlipper extends AbstractProductBuilder { public static Product createFlippedProduct(Product sourceProduct, int flipType, String name, String desc) throws IOException { return createFlippedProduct(sourceProduct, false, flipType, name, desc); } ProductFlipper(int flipType);  ProductFlipper(int flipType, boolean sourceProductOwner); static Product createFlippedProduct(Product sourceProduct, int flipType, String name, String desc); static Product createFlippedProduct(Product sourceProduct, boolean sourceProductOwner, int flipType,
                                               String name, String desc); int getFlipType(); @Override void close(); @Override void readBandRasterData(Band destBand,
                                   int destOffsetX,
                                   int destOffsetY,
                                   int destWidth,
                                   int destHeight,
                                   ProductData destBuffer,
                                   ProgressMonitor pm); static final int FLIP_HORIZONTAL; static final int FLIP_VERTICAL; static final int FLIP_BOTH; }