Rename write_tag_value to write_tag_buf
We have not released this yet, let's align these names before it is too late. The decoder adopted the `_buf` suffix and I find it more convincing than the more generic `_value` (that also confusingly shares it with `TiffValue`).
This commit is contained in:
1 parent
d3b777c961
commit
9d409433e8
1 file changed
+15
-15
+15
-15
@@ -291,21 +291,6 @@ impl<'a, W: 'a + Write + Seek, K: TiffKind> DirectoryEncoder<'a, W, K> {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Write a tag-value pair with prepared byte data.
|
|
||||||
///
|
|
||||||
/// Note that the library will _not_ attempt to verify that the data type or the count of the
|
|
||||||
/// buffered value is permissible for the given tag. The data will be associated with the tag
|
|
||||||
/// exactly as-is.
|
|
||||||
///
|
|
||||||
/// An error is returned if the byte order of the presented value does not match the byte order
|
|
||||||
/// of the underlying file (i.e. the [native byte order](`crate::tags::ByteOrder::native`)).
|
|
||||||
pub fn write_tag_value(&mut self, tag: Tag, value: &ValueBuffer) -> TiffResult<()> {
|
|
||||||
let entry = self.write_entry_buf(value)?;
|
|
||||||
self.directory.extend([(tag, entry)]);
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Write a single ifd tag.
|
/// Write a single ifd tag.
|
||||||
pub fn write_tag<T: TiffValue>(&mut self, tag: Tag, value: T) -> TiffResult<()> {
|
pub fn write_tag<T: TiffValue>(&mut self, tag: Tag, value: T) -> TiffResult<()> {
|
||||||
// Encodes the value if necessary. In the current bytes all integers are taken as native
|
// Encodes the value if necessary. In the current bytes all integers are taken as native
|
||||||
@@ -330,6 +315,21 @@ impl<'a, W: 'a + Write + Seek, K: TiffKind> DirectoryEncoder<'a, W, K> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Write a tag-value pair with prepared byte data.
|
||||||
|
///
|
||||||
|
/// Note that the library will _not_ attempt to verify that the data type or the count of the
|
||||||
|
/// buffered value is permissible for the given tag. The data will be associated with the tag
|
||||||
|
/// exactly as-is.
|
||||||
|
///
|
||||||
|
/// An error is returned if the byte order of the presented value does not match the byte order
|
||||||
|
/// of the underlying file (i.e. the [native byte order](`crate::tags::ByteOrder::native`)).
|
||||||
|
pub fn write_tag_buf(&mut self, tag: Tag, value: &ValueBuffer) -> TiffResult<()> {
|
||||||
|
let entry = self.write_entry_buf(value)?;
|
||||||
|
self.directory.extend([(tag, entry)]);
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
/// Write some data to the tiff file, the offset of the data is returned.
|
/// Write some data to the tiff file, the offset of the data is returned.
|
||||||
///
|
///
|
||||||
/// This could be used to write tiff strips. All of the data will be written into the file as a
|
/// This could be used to write tiff strips. All of the data will be written into the file as a
|
||||||
|
|||||||
Reference in new issue
Block a user