Class FillValues
java.lang.Object
org.apache.sis.internal.coverage.j2d.FillValues
Helper class for handling the fill values of a raster. A value can be specified for each band.
- Since:
- 1.2
- Version:
- 1.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Object
The fill values as an array of primitive type:int[]
,float[]
ordouble[]
.final boolean
true
if all values inasPrimitiveArray
are positive 0. -
Constructor Summary
ConstructorsConstructorDescriptionFillValues
(SampleModel model, Number[] values, boolean allowFloat) Stores the given fill values as an array of primitive type. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares this object with given object for equality.void
fill
(WritableRaster tile) Fills the given raster with the fill value.void
fill
(WritableRenderedImage image) Fills the given image with the fill value.int
hashCode()
Returns a hash code for the fill values.
-
Field Details
-
asPrimitiveArray
The fill values as an array of primitive type:int[]
,float[]
ordouble[]
. No other type is allowed. This field is never null and the array length is the number of bands. -
isFullyZero
public final boolean isFullyZerotrue
if all values inasPrimitiveArray
are positive 0. This is the value of newly constructed Java arrays orinvalid reference
Raster
fill(WritableRaster)
can be skipped if the raster is new and this flag istrue
.
-
-
Constructor Details
-
FillValues
Stores the given fill values as an array of primitive type. If the given array isnull
, or if any element in the given array isnull
, then the default fill value is NaN for floating point data types or zero for integer data types. If the array is shorter than the number of bands, then above-cited default values are used for missing values. If longer than the number of bands, extraneous values are ignored.- Parameters:
model
- the sample model of the image for which to prepare fill values.values
- the fill values, ornull
for the default values.allowFloat
- whether to allowasPrimitiveArray
to befloat[]
. Iffalse
, thenasPrimitiveArray
can only bedouble[]
orint[]
.
-
-
Method Details
-
fill
Fills the given raster with the fill value. The raster sample model should be the same than the sample model specified at construction time of thisFillValues
object.Implementation note
This method fills the raster using its API, without direct access to the backing array. We do not use direct array access because it would disable Java2D hardware acceleration in subsequent operations.- Parameters:
tile
- the raster to fill.- See Also:
-
fill
Fills the given image with the fill value. The image sample model should be the same than the sample model specified at construction time of thisFillValues
object.- Parameters:
image
- the image to fill.
-
equals
Compares this object with given object for equality. -
hashCode
public int hashCode()Returns a hash code for the fill values.
-