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 theImageAccessorfor the k-th component; the result is a sub-type ofScalarAccessor.intgetDepth()Returns the depth (number of components) of this image accessor. 1 is returned if the image is scalar-valued.floatgetVal(double x, double y, int k) Returns the interpolated value of the pixel's k-th component at the specified position.floatgetVal(int u, int v, int k) Returns the value of the pixel's k-th component at the specified position.voidsetVal(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:ImageAccessorReturns the depth (number of components) of this image accessor. 1 is returned if the image is scalar-valued.- Specified by:
getDepthin classImageAccessor- Returns:
- the image depth.
-
getComponentAccessor
Description copied from class:ImageAccessorReturns theImageAccessorfor 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:
getComponentAccessorin classImageAccessor- Parameters:
k- the component index- Returns:
- the component accessor.
-
getVal
Description copied from class:ImageAccessorReturns 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:
getValin classImageAccessor- Parameters:
u- the x-coordinatev- the y-coordinatek- the component index- Returns:
- the component value (
float)
-
getVal
Description copied from class:ImageAccessorReturns 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:
getValin classImageAccessor- Parameters:
x- the x-coordinatey- the y-coordinatek- the component index- Returns:
- the interpolated component value (
float[])
-
setVal
Description copied from class:ImageAccessorSets 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:
setValin classImageAccessor- Parameters:
u- the x-coordinatev- the y-coordinatek- the component indexval- the new component value
-