Band rgbBand = moreProductsReferences ? null : product.getBand(expression); if (rgbBand == null) { rgbBand = new ProductSceneView.RGBChannel(product, determineWidth(expression, products, elementIndex), determineHeight(expression, products, elementIndex),
if (raster instanceof RGBChannel) { RGBChannel rgbChannel = (RGBChannel) raster; rgbChannel.dispose();
/** * Constructs a new RGB image view band. * * @param product the product which takes the ownership * @param width the width of the image * @param height the height of the image * @param name the band's name * @param expression the expression */ public RGBChannel(final Product product, final int width, final int height, final String name, final String expression) { super(name, ProductData.TYPE_FLOAT32, width, height, expression); deriveRasterPropertiesFromExpression(expression, product); setOwner(product); setModified(false); }
private void deriveRasterPropertiesFromExpression(String expression, Product product) { if (product != null) { try { final RasterDataNode[] refRasters = BandArithmetic.getRefRasters(expression, product); if (refRasters.length > 0) { setGeoCoding(refRasters[0].getGeoCoding()); setImageToModelTransform(refRasters[0].getImageToModelTransform()); setSceneToModelTransform(refRasters[0].getSceneToModelTransform()); setModelToSceneTransform(refRasters[0].getModelToSceneTransform()); } } catch (ParseException e) { // do not set geocoding then } } }