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 ShortAccessorcreate(ShortProcessor ip, OutOfBoundsStrategy obs, InterpolationMethod ipm) floatgetVal(int u, int v) Reads and returns the scalar pixel value for the given image position.voidsetVal(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, setValMethods 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 ofShortProcessorobs- the out-of-bounds strategy to be used (usenullfor default settings)ipm- the interpolation method to be used (usenullfor default settings)
-
-
Method Details
-
create
public static ShortAccessor create(ShortProcessor ip, OutOfBoundsStrategy obs, InterpolationMethod ipm) -
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)
-