Skip to content

Commit

Permalink
namings image format
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarriba committed Sep 27, 2024
1 parent 7c8337c commit f54d0bd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions crates/kornia-image/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ impl From<ImageSize> for [u32; 2] {
/// The format of the image to write to the video file.
pub enum ImageFormat {
/// MONO 8-bit unsigned integer format.
Mono8U,
Mono8,
/// RGB 8-bit unsigned integer format.
Rgb8U,
Rgb8,
}

#[derive(Clone)]
Expand Down
8 changes: 4 additions & 4 deletions crates/kornia-io/src/stream/video.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ impl VideoWriter {

// TODO: Add support for other formats
let format = match format {
ImageFormat::Mono8U => "GRAY8",
ImageFormat::Rgb8U => "RGB",
ImageFormat::Mono8 => "GRAY8",
ImageFormat::Rgb8 => "RGB",
};

let path = path.as_ref().to_owned();
Expand Down Expand Up @@ -218,7 +218,7 @@ mod tests {
let mut writer = VideoWriter::new(
&file_path,
VideoWriterCodec::H264,
ImageFormat::Rgb8U,
ImageFormat::Rgb8,
30,
size,
)?;
Expand Down Expand Up @@ -249,7 +249,7 @@ mod tests {
let mut writer = VideoWriter::new(
&file_path,
VideoWriterCodec::H264,
ImageFormat::Mono8U,
ImageFormat::Mono8,
30,
size,
)?;
Expand Down
2 changes: 1 addition & 1 deletion examples/video_write tasks/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let video_writer = VideoWriter::new(
args.output,
VideoWriterCodec::H264,
ImageFormat::Rgb8U,
ImageFormat::Rgb8,
args.fps,
frame_size,
)?;
Expand Down
2 changes: 1 addition & 1 deletion examples/video_write/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let video_writer = VideoWriter::new(
args.output,
VideoWriterCodec::H264,
ImageFormat::Rgb8U,
ImageFormat::Rgb8,
args.fps,
frame_size,
)?;
Expand Down

0 comments on commit f54d0bd

Please sign in to comment.