Class HorizontalDeDifferencingFloatingPointStream
java.lang.Object
java.io.InputStream
com.twelvemonkeys.imageio.plugins.tiff.HorizontalDeDifferencingFloatingPointStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
A decoder for data converted using "floating point horizontal differencing predictor".
- Version:
- $Id: HorizontalDeDifferencingStream.java,v 1.0 11.03.13 14:20 haraldk Exp$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ByteBuffer
private final int
private final ReadableByteChannel
private final int
private final byte[]
private final int
-
Constructor Summary
ConstructorsConstructorDescriptionHorizontalDeDifferencingFloatingPointStream
(InputStream stream, int columns, int samplesPerPixel, int bitsPerSample, ByteOrder byteOrder) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
private void
decodeDeltaBytes
(byte[] bytes, int columns, int samplesPerPixel) private void
decodeFloatingPointDelta
(byte[] input, byte[] output, int columns, int channels, int bytesPerSample, ByteOrder order) private void
private boolean
fetch()
private static boolean
isValidBPS
(int bitsPerSample) int
read()
int
read
(byte[] b, int off, int len) long
skip
(long n) Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skipNBytes, transferTo
-
Field Details
-
columns
private final int columns -
samplesPerPixel
private final int samplesPerPixel -
bytesPerSample
private final int bytesPerSample -
channel
-
buffer
-
fpRow
private final byte[] fpRow
-
-
Constructor Details
-
HorizontalDeDifferencingFloatingPointStream
public HorizontalDeDifferencingFloatingPointStream(InputStream stream, int columns, int samplesPerPixel, int bitsPerSample, ByteOrder byteOrder)
-
-
Method Details
-
isValidBPS
private static boolean isValidBPS(int bitsPerSample) -
fetch
- Throws:
IOException
-
decodeDeltaBytes
private void decodeDeltaBytes(byte[] bytes, int columns, int samplesPerPixel) -
decodeFloatingPointDelta
private void decodeFloatingPointDelta(byte[] input, byte[] output, int columns, int channels, int bytesPerSample, ByteOrder order) -
decodeRow
private void decodeRow() -
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
skip
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-