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, setValMethods 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 ofByteProcessorobs- the out-of-bounds strategy to be used (usenullfor default settings)ipm- the interpolation method to be used (usenullfor default settings)
-
-
Method Details
-
getVal
Description copied from class:ScalarAccessorReads and returns the scalar pixel value for the given image position. The value returned for coordinates outside the image boundaries depends on theOutOfBoundsStrategyspecified for thisImageAccessor.- Specified by:
getValin classScalarAccessor- Parameters:
u- the x-coordinatev- the y-coordinate- Returns:
- the pixel value (
float)
-
setVal
Description copied from class:ScalarAccessorWrites a scalar pixel value to the given image position. An exception is thrown if u, v coordinates are outside the image.- Specified by:
setValin classScalarAccessor- Parameters:
u- the x-coordinatev- the y-coordinateval- the new pixel value (float)
-