java.lang.Object
imagingbook.common.image.access.ImageAccessor
imagingbook.common.image.access.VectorAccessor
- Direct Known Subclasses:
RgbAccessor
Accessor for vector-valued images with arbitrary depth (number of components).
-
Field Summary
Fields inherited from class imagingbook.common.image.access.ImageAccessor
DefaultInterpolationMethod, DefaultOutOfBoundsStrategy, defaultValue, height, indexer, interpolationMethod, ip, outOfBoundsStrategy, width
-
Method Summary
Modifier and TypeMethodDescriptiongetComponentAccessor
(int k) Returns theImageAccessor
for the k-th component; the result is a sub-type ofScalarAccessor
.int
getDepth()
Returns the depth (number of components) of this image accessor.float
getVal
(double x, double y, int k) Returns the interpolated value of the pixel's k-th component at the specified position.float
getVal
(int u, int v, int k) Returns the value of the pixel's k-th component at the specified position.void
setVal
(int u, int v, int k, float val) Sets the value of the pixel's k-th component at the specified position.Methods inherited from class imagingbook.common.image.access.ImageAccessor
create, create, getHeight, getInterpolationMethod, getOutOfBoundsStrategy, getPix, getPix, getProcessor, getWidth, setPix
-
Method Details
-
getDepth
Description copied from class:ImageAccessor
Returns the depth (number of components) of this image accessor. 1 is returned if the image is scalar-valued.- Specified by:
getDepth
in classImageAccessor
- Returns:
- the image depth.
-
getComponentAccessor
Description copied from class:ImageAccessor
Returns theImageAccessor
for the k-th component; the result is a sub-type ofScalarAccessor
. In the case of a scalar-valued image, THIS object is returned.- Specified by:
getComponentAccessor
in classImageAccessor
- Parameters:
k
- the component index- Returns:
- the component accessor.
-
getVal
Description copied from class:ImageAccessor
Returns the value of the pixel's k-th component at the specified position. If the associated image is scalar-valued, this is equivalent to component 0. See alsoImageAccessor.getDepth()
.- Specified by:
getVal
in classImageAccessor
- Parameters:
u
- the x-coordinatev
- the y-coordinatek
- the component index- Returns:
- the component value (
float
)
-
getVal
Description copied from class:ImageAccessor
Returns the interpolated value of the pixel's k-th component at the specified position. If the associated image is scalar-valued, this is equivalent to component 0. See alsoImageAccessor.getDepth()
.- Specified by:
getVal
in classImageAccessor
- Parameters:
x
- the x-coordinatey
- the y-coordinatek
- the component index- Returns:
- the interpolated component value (
float[]
)
-
setVal
Description copied from class:ImageAccessor
Sets the value of the pixel's k-th component at the specified position. If the associated image is scalar-valued, this is equivalent to component 0. See alsoImageAccessor.getDepth()
.- Specified by:
setVal
in classImageAccessor
- Parameters:
u
- the x-coordinatev
- the y-coordinatek
- the component indexval
- the new component value
-