Made DecodingBuffer public
Marked `DecodingBuffer` and `read_strip_to_buffer` as public to reduce copies in eventual `TiffReader`.
This commit is contained in:
1 parent
6884558687
commit
6aa5f3add5
1 file changed
+3
-3
+3
-3
@@ -28,7 +28,7 @@ pub enum DecodingResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl DecodingResult {
|
impl DecodingResult {
|
||||||
fn to_buffer(&mut self, start: usize) -> DecodingBuffer {
|
pub fn to_buffer(&mut self, start: usize) -> DecodingBuffer {
|
||||||
match self {
|
match self {
|
||||||
DecodingResult::U8(ref mut buf) => DecodingBuffer::U8(&mut buf[start..]),
|
DecodingResult::U8(ref mut buf) => DecodingBuffer::U8(&mut buf[start..]),
|
||||||
DecodingResult::U16(ref mut buf) => DecodingBuffer::U16(&mut buf[start..]),
|
DecodingResult::U16(ref mut buf) => DecodingBuffer::U16(&mut buf[start..]),
|
||||||
@@ -37,7 +37,7 @@ impl DecodingResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// A buffer for image decoding
|
// A buffer for image decoding
|
||||||
enum DecodingBuffer<'a> {
|
pub enum DecodingBuffer<'a> {
|
||||||
/// A slice of unsigned bytes
|
/// A slice of unsigned bytes
|
||||||
U8(&'a mut [u8]),
|
U8(&'a mut [u8]),
|
||||||
/// A slice of unsigned words
|
/// A slice of unsigned words
|
||||||
@@ -488,7 +488,7 @@ impl<R: Read + Seek> Decoder<R> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn read_strip_to_buffer(&mut self, mut buffer: DecodingBuffer) -> TiffResult<()> {
|
pub fn read_strip_to_buffer(&mut self, mut buffer: DecodingBuffer) -> TiffResult<()> {
|
||||||
self.initialize_strip_decoder()?;
|
self.initialize_strip_decoder()?;
|
||||||
|
|
||||||
let index = self.strip_decoder.as_ref().unwrap().strip_index;
|
let index = self.strip_decoder.as_ref().unwrap().strip_index;
|
||||||
|
|||||||
Reference in new issue
Block a user