/** * {@inheritDoc} */ @Override public void setScaleFactor(final Double newValue) { super.setScaleFactor(newValue); }
/** * Sets the scale factor and offset which have been applied to the cell value. * The transfer function type is declared {@linkplain TransferFunctionType#LINEAR linear} * If a coverage contains more than one band, additional bands can be created by calling * {@link #newSampleDimension()} before to call this method. * Storage location is: * * <ul> * <li>{@code metadata/contentInfo/attributeGroup/attribute/scale}</li> * <li>{@code metadata/contentInfo/attributeGroup/attribute/offset}</li> * <li>{@code metadata/contentInfo/attributeGroup/attribute/transferFunctionType}</li> * </ul> * * @param scale the scale factor which has been applied to the cell value. * @param offset the physical value corresponding to a cell value of zero. */ public final void setTransferFunction(final double scale, final double offset) { if (!Double.isNaN(scale) || !Double.isNaN(offset)) { final DefaultSampleDimension sd = sampleDimension(); if (!Double.isNaN(scale)) sd.setScaleFactor(scale); if (!Double.isNaN(offset)) sd.setOffset(offset); sd.setTransferFunctionType(TransferFunctionType.LINEAR); } }
/** * Sets the scale factor and offset which have been applied to the cell value. * The transfer function type is declared {@linkplain TransferFunctionType#LINEAR linear} * If a coverage contains more than one band, additional bands can be created by calling * {@link #newSampleDimension()} before to call this method. * Storage location is: * * <ul> * <li>{@code metadata/contentInfo/attributeGroup/attribute/scale}</li> * <li>{@code metadata/contentInfo/attributeGroup/attribute/offset}</li> * <li>{@code metadata/contentInfo/attributeGroup/attribute/transferFunctionType}</li> * </ul> * * @param scale the scale factor which has been applied to the cell value. * @param offset the physical value corresponding to a cell value of zero. */ public final void setTransferFunction(final double scale, final double offset) { if (!Double.isNaN(scale) || !Double.isNaN(offset)) { final DefaultSampleDimension sd = sampleDimension(); if (!Double.isNaN(scale)) sd.setScaleFactor(scale); if (!Double.isNaN(offset)) sd.setOffset(offset); sd.setTransferFunctionType(TransferFunctionType.LINEAR); } }