Skip to content

Commit

Permalink
basic-frame: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
astraw committed Jan 12, 2025
1 parent b9f2755 commit 62b3bd8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion basic-frame/src/dynamic_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ impl DynamicFrame {
convert_to_dynamic2!(FMT, new_basic_frame_copy!(frame))
}

// TODO: actually implement the From trait
// TODO: actually implement the From trait. However, this is more difficult
// than it may initially sound because of trait generic stuff.
pub fn from<FRAME, FMT>(frame: FRAME) -> Self
where
FRAME: ImageStride<FMT> + Into<Vec<u8>>,
Expand Down Expand Up @@ -161,6 +162,10 @@ impl DynamicFrame {
/// Return the image as a `BasicFrame` converting the data to the requested
/// pixel format as necessary.
///
/// Note that although this consumes [Self], it does not make sense to
/// implement a variant which takes only a reference because the data must
/// be copied in that case anyway.
///
/// To avoid converting the data, use [Self::as_basic].
pub fn into_pixel_format<FMT>(self) -> Result<BasicFrame<FMT>, convert_image::Error>
where
Expand Down

0 comments on commit 62b3bd8

Please sign in to comment.