Struct vfxpreopenexr::deep::deep_scan_line_output_file::DeepScanLineOutputFile [−][src]
#[repr(transparent)]pub struct DeepScanLineOutputFile(_);
Implementations
Opens the file and writes the file header.
The file header is also copied into the DeepScanLineOutputFile object,
and can later be accessed via the header()
method.
Dropping this DeepScanLineOutputFile object automatically closes
the file.
Errors
Error::Base
- If the file could not be opened or theHeader
is invalid
Set the current frame buffer – copies the FrameBuffer object into the OutputFile object.
The current frame buffer is the source of the pixel
data written to the file. The current frame buffer
must be set at least once before write_pixels()
is
called. The current frame buffer can be changed
after each call to write_pixels()
.
Errors
Error::InvalidArgument
- If the pixel type of theChannel
s in theHeader
do not match the types in the frame buffer, or if the sampling rates do not match.
Get a reference to the frame buffer.
Write pixel data.
Retrieves the next num_scan_lines
worth of data from
the current frame buffer, starting with the scan line indicated by
current_scan_line()
and stores the data in the output file, and
progressing in the direction indicated by header().line_order()
.
To produce a complete and correct file, exactly m scan lines must
be written, where m is equal to
header().data_window().max.y - header().data_window().min.y + 1
.
Errors
Error::Io
- If an I/O error occurs while writing the image dataError::InvalidArgument
- Ifcurrent_scan_line() + num_scan_lines
is outside the data window.Error::Base
- If any other error occurs.
Safety
This method is wildly unsafe as on the C++ side it’s reading from
pointers offset from the base pointers supplied by the
DeepSlice
in
the DeepFrameBuffer
.
Access to the current scan line:
Returns the y coordinate of the first scan line
that will be read from the current frame buffer during the next
call to write_pixels()
.
If line_order() == LineOrder::IncreasingY
:
The current scan line before the first call to write_pixels() is header().data_window().min.y. After writing each scan line, the current scan line is incremented by 1.
If line_order() == LineOrder::DecreasingY
:
The current scan line before the first call to
write_pixels()
is header().data_window().max.y. After writing each scan line,
the current scan line is decremented by 1.
Shortcut to copy all pixels from a DeepScanLineInputFile
into this file,
without uncompressing and then recompressing the pixel data.
This file’s header must be compatible with the DeepScanLineInputFile
’s
header: The two header’s “dataWindow”, “compression”,
“lineOrder” and “channels” attributes must be the same.
Errors
Error::InvalidArgument
- If the headers do not matchError::LogicError
- If scan lines have already been written to this file.
pub fn copy_pixels_from_part(
&mut self,
file: &mut DeepScanLineInputPart<'_>
) -> Result<(), Error>
pub fn copy_pixels_from_part(
&mut self,
file: &mut DeepScanLineInputPart<'_>
) -> Result<(), Error>
Shortcut to copy all pixels from a DeepScanLineInputPart
into this file,
without uncompressing and then recompressing the pixel data.
This file’s header must be compatible with the DeepScanLineInputPart
’s
header: The two header’s “dataWindow”, “compression”,
“lineOrder” and “channels” attributes must be the same.
Errors
Error::InvalidArgument
- If the headers do not matchError::LogicError
- If scan lines have already been written to this file.
Updating the preview image:
Supplies a new set of pixels for the preview image attribute in the file’s header.
This is necessary because images are often stored in a file incrementally, a few scan lines at a time, while the image is being generated. Since the preview image is an attribute in the file’s header, it gets stored in the file as soon as the file is opened, but we may not know what the preview image should look like until we have written the last scan line of the main image.
Errors
Error::LogicError
- If the header does not contain a preview imageError::Base
- If any other error occurs
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for DeepScanLineOutputFile
impl !Send for DeepScanLineOutputFile
impl !Sync for DeepScanLineOutputFile
impl Unpin for DeepScanLineOutputFile
impl UnwindSafe for DeepScanLineOutputFile