Class HorizontalPredictor.Integers
java.lang.Object
org.apache.sis.internal.storage.inflater.PixelChannel
org.apache.sis.internal.storage.inflater.PredictorChannel
org.apache.sis.internal.storage.inflater.HorizontalPredictor
org.apache.sis.internal.storage.inflater.HorizontalPredictor.Integers
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Channel
,ReadableByteChannel
- Enclosing class:
- HorizontalPredictor
A horizontal predictor working on 32 bits integer values.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int[]
The trailing values of previous invocation ofHorizontalPredictor.apply(ByteBuffer, int)
.Fields inherited from class org.apache.sis.internal.storage.inflater.HorizontalPredictor
pixelStride
-
Constructor Summary
ConstructorsConstructorDescriptionIntegers
(CompressionChannel input, int samplesPerPixel, int width) Creates a new predictor. -
Method Summary
Modifier and TypeMethodDescription(package private) int
applyOnFirst
(ByteBuffer buffer, int position, int end, int offset) Applies the predictor, usingsavedValues
as the source of previous values.(package private) int
applyOnRow
(ByteBuffer buffer, int position, int end) Applies the predictor on a row of integers.(package private) void
saveLastPixel
(ByteBuffer buffer, int offset, int position) SavesHorizontalPredictor.pixelStride
bytes making the sample values of the last pixel.Methods inherited from class org.apache.sis.internal.storage.inflater.HorizontalPredictor
apply, create, setInputRegion
Methods inherited from class org.apache.sis.internal.storage.inflater.PredictorChannel
close, isOpen, read
-
Field Details
-
savedValues
private final int[] savedValuesThe trailing values of previous invocation ofHorizontalPredictor.apply(ByteBuffer, int)
. After each call toapply(…)
, the last values in the buffer are saved for use by the next invocation. The buffer capacity is exactly one pixel.
-
-
Constructor Details
-
Integers
Integers(CompressionChannel input, int samplesPerPixel, int width) Creates a new predictor.
-
-
Method Details
-
saveLastPixel
SavesHorizontalPredictor.pixelStride
bytes making the sample values of the last pixel. The first sample value to read from the buffer is given byposition
.- Specified by:
saveLastPixel
in classHorizontalPredictor
- Parameters:
buffer
- buffer from which to save sample values.offset
- number of bytes to keep in the currently saved values.position
- position in the buffer of the first byte to save, after the values to keep.
-
applyOnFirst
Applies the predictor, usingsavedValues
as the source of previous values. Used only for the first pixel in a new invocation ofHorizontalPredictor.apply(ByteBuffer, int)
.- Specified by:
applyOnFirst
in classHorizontalPredictor
- Parameters:
buffer
- the buffer on which to apply the predictor.position
- position of the first value to modify in the given buffer.end
- position after the last value to process in thisapply(…)
call.offset
- offset (in bytes) of the first saved value to use.- Returns:
- value of
position
after the last sample values processed by this method.
-
applyOnRow
Applies the predictor on a row of integers.- Specified by:
applyOnRow
in classHorizontalPredictor
- Parameters:
buffer
- the buffer on which to apply the predictor.position
- position of the first value to modify in the given buffer.end
- position after the last value to process in thisapply(…)
call.- Returns:
- value of
position
after the last sample values processed by this method.
-