java.lang.Object
imagingbook.common.image.access.ImageAccessor
imagingbook.common.image.access.ScalarAccessor
imagingbook.common.image.access.ByteAccessor
Image accessor for scalar images with 8-bit (byte) values.
- Version:
- 2022/09/22
-
Field Summary
Fields inherited from class imagingbook.common.image.access.ImageAccessor
DefaultInterpolationMethod, DefaultOutOfBoundsStrategy, defaultValue, height, indexer, interpolationMethod, ip, outOfBoundsStrategy, width
-
Constructor Summary
ConstructorsConstructorDescriptionByteAccessor
(ByteProcessor ip, OutOfBoundsStrategy obs, InterpolationMethod ipm) Constructor. -
Method Summary
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
-
ByteAccessor
Constructor. See also the factory methodScalarAccessor.create(ImageProcessor, OutOfBoundsStrategy, InterpolationMethod)
.- Parameters:
ip
- an instance ofByteProcessor
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
-
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
)
-