java.lang.Object
imagingbook.common.image.access.ImageAccessor
imagingbook.common.image.access.ScalarAccessor
imagingbook.common.image.access.ShortAccessor
Image accessor for scalar images with 16-bit (short) values.
-
Field Summary
Fields inherited from class imagingbook.common.image.access.ImageAccessor
DefaultInterpolationMethod, DefaultOutOfBoundsStrategy, defaultValue, height, indexer, interpolationMethod, ip, outOfBoundsStrategy, width
-
Constructor Summary
ConstructorsConstructorDescriptionShortAccessor
(ShortProcessor ip, OutOfBoundsStrategy obs, InterpolationMethod ipm) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic ShortAccessor
create
(ShortProcessor ip, OutOfBoundsStrategy obs, InterpolationMethod ipm) float
getVal
(int u, int v) Reads and returns the scalar pixel value for the given image position.void
setVal
(int u, int v, float val) Writes a scalar pixel value to the given image position.Methods inherited from class imagingbook.common.image.access.ScalarAccessor
create, getComponentAccessor, getDepth, getPix, getPix, getVal, getVal, getVal, setPix, setVal
Methods inherited from class imagingbook.common.image.access.ImageAccessor
create, getHeight, getInterpolationMethod, getOutOfBoundsStrategy, getProcessor, getWidth
-
Constructor Details
-
ShortAccessor
Constructor. See also the factory methodScalarAccessor.create(ImageProcessor, OutOfBoundsStrategy, InterpolationMethod)
.- Parameters:
ip
- an instance ofShortProcessor
obs
- the out-of-bounds strategy to be used (usenull
for default settings)ipm
- the interpolation method to be used (usenull
for default settings)
-
-
Method Details
-
create
public static ShortAccessor create(ShortProcessor ip, OutOfBoundsStrategy obs, InterpolationMethod ipm) -
getVal
Description copied from class:ScalarAccessor
Reads and returns the scalar pixel value for the given image position. The value returned for coordinates outside the image boundaries depends on theOutOfBoundsStrategy
specified for thisImageAccessor
.- Specified by:
getVal
in classScalarAccessor
- Parameters:
u
- the x-coordinatev
- the y-coordinate- Returns:
- the pixel value (
float
)
-
setVal
Description copied from class:ScalarAccessor
Writes a scalar pixel value to the given image position. An exception is thrown if u, v coordinates are outside the image.- Specified by:
setVal
in classScalarAccessor
- Parameters:
u
- the x-coordinatev
- the y-coordinateval
- the new pixel value (float
)
-