Package org.esa.snap.core.util
Class BitRaster
- java.lang.Object
-
- org.esa.snap.core.util.BitRaster
-
public final class BitRaster extends Object
A pixel mask provides a boolean value for a given pixel position. It is used to identify valid pixels in a raster.- Since:
- 4.1
-
-
Constructor Summary
Constructors Constructor Description BitRaster(int width, int height)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear(int pixelIndex)
byte[]
createBytePackedBitmaskRasterData()
Creates a byte-packed bitmask as array of bytes.int
getBytePackedBitmaskRasterWidth()
Gets the width of this raster in byte-packed formint
getHeight()
int
getWidth()
boolean
isSet(int pixelIndex)
boolean
isSet(int x, int y)
void
set(int pixelIndex)
void
set(int pixelIndex, boolean value)
void
set(int x, int y, boolean value)
-
-
-
Method Detail
-
getWidth
public int getWidth()
-
getHeight
public int getHeight()
-
set
public void set(int x, int y, boolean value)
-
set
public void set(int pixelIndex, boolean value)
-
isSet
public boolean isSet(int x, int y)
-
isSet
public boolean isSet(int pixelIndex)
-
set
public void set(int pixelIndex)
-
clear
public void clear(int pixelIndex)
-
createBytePackedBitmaskRasterData
public byte[] createBytePackedBitmaskRasterData()
Creates a byte-packed bitmask as array of bytes.This method is used to provide backward API compatibility with BEAM versions prior 4.1. Its use is discouraged.
- Returns:
- an array of bytes of size
getBytePackedBitmaskRasterWidth()
*
getHeight()
- See Also:
getBytePackedBitmaskRasterWidth()
-
getBytePackedBitmaskRasterWidth
public final int getBytePackedBitmaskRasterWidth()
Gets the width of this raster in byte-packed formThis method is used to provide backward API compatibility with BEAM versions prior 4.1. Its use is discouraged.
- Returns:
- the width of this raster in byte-packed form
- See Also:
createBytePackedBitmaskRasterData()
-
-