/******************************************************************************* * * Returns an estimate of the memory allocated by this image. The default * implementation returns the number of pixels multiplied by the number of bands * multiplied the size in bytes of each pixel. Can be overridden for more * accurate implementations. * * @return the memory allocated for this image * ******************************************************************************/ public long getMemorySize() { final EditableImage.DataType dataType = getDataType(); return (dataType == null) ? 0 : ((long)dataType.getSize() * getWidth() * getHeight() * getBandCount()) / 8; }
/******************************************************************************************************************* * * Returns the number of sample bits for each band this EditableImage is * composed of. * * @return the number of bits * ******************************************************************************************************************/ public final int getBitsPerBand() { return getDataType().getSize(); }