Mask extends Band { public Mask(String name, int width, int height, ImageType imageType) { super(name, ProductData.TYPE_UINT8, width, height); Assert.notNull(imageType, "imageType"); this.imageType = imageType; this.imageConfigListener = new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (isSourceImageSet()) { getSourceImage().reset(); } fireProductNodeChanged(evt.getPropertyName(), evt.getOldValue(), evt.getNewValue()); } }; this.imageConfig = imageType.createImageConfig(); this.imageConfig.addPropertyChangeListener(imageConfigListener); } Mask(String name, int width, int height, ImageType imageType); ImageType getImageType(); PropertyContainer getImageConfig(); Color getImageColor(); void setImageColor(Color color); double getImageTransparency(); void setImageTransparency(double transparency); @Override void acceptVisitor(ProductVisitor visitor); @Override void dispose(); @Override void updateExpression(final String oldExternalName, final String newExternalName); @Override Shape getValidShape();  }
@Test public void testMask() { Mask.ImageType imageType = new BufferedImageType(); Mask mask = new Mask("WATER", 256, 128, imageType); assertEquals("WATER", mask.getName()); assertEquals(256, mask.getRasterWidth()); assertEquals(128, mask.getRasterHeight()); assertSame(imageType, mask.getImageType()); PropertyContainer imageConfig = mask.getImageConfig(); assertNotNull(imageConfig); assertEquals(Color.RED, mask.getImageConfig().getValue("color")); assertEquals(0.5, (double)mask.getImageConfig().getValue("transparency"), 1.0e-6); MultiLevelImage image = mask.getSourceImage(); assertNotNull(image); assertSame(image, mask.getGeophysicalImage()); assertSame(null, mask.getValidMaskImage()); }