pub trait VideoWriterTrait: VideoWriterTraitConst {
// Required method
fn as_raw_mut_VideoWriter(&mut self) -> *mut c_void;
// Provided methods
fn open(
&mut self,
filename: &str,
fourcc: i32,
fps: f64,
frame_size: Size,
is_color: bool,
) -> Result<bool> { ... }
fn open_def(
&mut self,
filename: &str,
fourcc: i32,
fps: f64,
frame_size: Size,
) -> Result<bool> { ... }
fn open_with_backend(
&mut self,
filename: &str,
api_preference: i32,
fourcc: i32,
fps: f64,
frame_size: Size,
is_color: bool,
) -> Result<bool> { ... }
fn open_with_backend_def(
&mut self,
filename: &str,
api_preference: i32,
fourcc: i32,
fps: f64,
frame_size: Size,
) -> Result<bool> { ... }
fn open_1(
&mut self,
filename: &str,
fourcc: i32,
fps: f64,
frame_size: Size,
params: &Vector<i32>,
) -> Result<bool> { ... }
fn open_2(
&mut self,
filename: &str,
api_preference: i32,
fourcc: i32,
fps: f64,
frame_size: Size,
params: &Vector<i32>,
) -> Result<bool> { ... }
fn release(&mut self) -> Result<()> { ... }
fn write(&mut self, image: &impl ToInputArray) -> Result<()> { ... }
fn set(&mut self, prop_id: i32, value: f64) -> Result<bool> { ... }
}
Expand description
Mutable methods for crate::videoio::VideoWriter
Required Methods§
fn as_raw_mut_VideoWriter(&mut self) -> *mut c_void
Provided Methods§
Sourcefn open(
&mut self,
filename: &str,
fourcc: i32,
fps: f64,
frame_size: Size,
is_color: bool,
) -> Result<bool>
fn open( &mut self, filename: &str, fourcc: i32, fps: f64, frame_size: Size, is_color: bool, ) -> Result<bool>
Initializes or reinitializes video writer.
The method opens video writer. Parameters are the same as in the constructor VideoWriter::VideoWriter.
§Returns
true
if video writer has been successfully initialized
The method first calls VideoWriter::release to close the already opened file.
§C++ default parameters
- is_color: true
Sourcefn open_def(
&mut self,
filename: &str,
fourcc: i32,
fps: f64,
frame_size: Size,
) -> Result<bool>
fn open_def( &mut self, filename: &str, fourcc: i32, fps: f64, frame_size: Size, ) -> Result<bool>
Initializes or reinitializes video writer.
The method opens video writer. Parameters are the same as in the constructor VideoWriter::VideoWriter.
§Returns
true
if video writer has been successfully initialized
The method first calls VideoWriter::release to close the already opened file.
§Note
This alternative version of VideoWriterTrait::open function uses the following default values for its arguments:
- is_color: true
Sourcefn open_with_backend(
&mut self,
filename: &str,
api_preference: i32,
fourcc: i32,
fps: f64,
frame_size: Size,
is_color: bool,
) -> Result<bool>
fn open_with_backend( &mut self, filename: &str, api_preference: i32, fourcc: i32, fps: f64, frame_size: Size, is_color: bool, ) -> Result<bool>
Initializes or reinitializes video writer.
The method opens video writer. Parameters are the same as in the constructor VideoWriter::VideoWriter.
§Returns
true
if video writer has been successfully initialized
The method first calls VideoWriter::release to close the already opened file.
§Overloaded parameters
§C++ default parameters
- is_color: true
Sourcefn open_with_backend_def(
&mut self,
filename: &str,
api_preference: i32,
fourcc: i32,
fps: f64,
frame_size: Size,
) -> Result<bool>
fn open_with_backend_def( &mut self, filename: &str, api_preference: i32, fourcc: i32, fps: f64, frame_size: Size, ) -> Result<bool>
@overload
§Note
This alternative version of VideoWriterTrait::open_with_backend function uses the following default values for its arguments:
- is_color: true
Sourcefn open_1(
&mut self,
filename: &str,
fourcc: i32,
fps: f64,
frame_size: Size,
params: &Vector<i32>,
) -> Result<bool>
fn open_1( &mut self, filename: &str, fourcc: i32, fps: f64, frame_size: Size, params: &Vector<i32>, ) -> Result<bool>
Initializes or reinitializes video writer.
The method opens video writer. Parameters are the same as in the constructor VideoWriter::VideoWriter.
§Returns
true
if video writer has been successfully initialized
The method first calls VideoWriter::release to close the already opened file.
§Overloaded parameters
Sourcefn open_2(
&mut self,
filename: &str,
api_preference: i32,
fourcc: i32,
fps: f64,
frame_size: Size,
params: &Vector<i32>,
) -> Result<bool>
fn open_2( &mut self, filename: &str, api_preference: i32, fourcc: i32, fps: f64, frame_size: Size, params: &Vector<i32>, ) -> Result<bool>
Initializes or reinitializes video writer.
The method opens video writer. Parameters are the same as in the constructor VideoWriter::VideoWriter.
§Returns
true
if video writer has been successfully initialized
The method first calls VideoWriter::release to close the already opened file.
§Overloaded parameters
Sourcefn release(&mut self) -> Result<()>
fn release(&mut self) -> Result<()>
Closes the video writer.
The method is automatically called by subsequent VideoWriter::open and by the VideoWriter destructor.
Sourcefn write(&mut self, image: &impl ToInputArray) -> Result<()>
fn write(&mut self, image: &impl ToInputArray) -> Result<()>
Writes the next video frame
§Parameters
- image: The written frame. In general, color images are expected in BGR format.
The function/method writes the specified image to video file. It must have the same size as has been specified when opening the video writer.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.