Skip to content

Commit

Permalink
refactor: Rename SingleFrame to PickFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
foresterre committed May 7, 2024
1 parent 288632e commit d13bcfa
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions crates/sic_io/src/preprocessor.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::errors::SicIoError;
use crate::preprocessor::color_type::ColorTypePreprocessor;
use crate::preprocessor::pick_frame::SingleFramePreprocessor;
use crate::preprocessor::pick_frame::PickFramePreprocessor;
use sic_core::{image, SicImage};

pub mod color_type;
Expand All @@ -25,9 +25,9 @@ impl Preprocessors {
self
}

pub fn single_frame_preprocessor(&mut self, image_format: image::ImageFormat) -> &mut Self {
pub fn pick_frame_preprocessor(&mut self, image_format: image::ImageFormat) -> &mut Self {
self.preprocessors
.push(Box::new(SingleFramePreprocessor::new(image_format)));
.push(Box::new(PickFramePreprocessor::new(image_format)));

self
}
Expand Down
6 changes: 3 additions & 3 deletions crates/sic_io/src/preprocessor/pick_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ use crate::errors::SicIoError;
use crate::preprocessor::Preprocess;
use sic_core::{image, SicImage};

pub struct SingleFramePreprocessor {
pub struct PickFramePreprocessor {
image_format: image::ImageFormat,
}

impl SingleFramePreprocessor {
impl PickFramePreprocessor {
pub fn new(image_format: image::ImageFormat) -> Self {
Self { image_format }
}
}

impl Preprocess for SingleFramePreprocessor {
impl Preprocess for PickFramePreprocessor {
type Err = SicIoError;

fn preprocess(&self, image: SicImage) -> Result<SicImage, Self::Err> {
Expand Down
2 changes: 1 addition & 1 deletion src/cli/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ where
// NB: order in which preprocessors are added matters!
let mut preprocessors = Preprocessors::default();

preprocessors.single_frame_preprocessor(dynamic_encoder.image_format());
preprocessors.pick_frame_preprocessor(dynamic_encoder.image_format());

if !config.disable_automatic_color_type_adjustment {
preprocessors.color_type_preprocessor(dynamic_encoder.image_format());
Expand Down
6 changes: 3 additions & 3 deletions tests/cli_convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ mod convert_to_x_by_ff {
jpeg = {"jpeg", image::ImageFormat::Jpeg },
ico = { "ico", image::ImageFormat::Ico },
png = { "png", image::ImageFormat::Png },
// pbm = { "pbm", image::ImageFormat::Pnm },
pbm = { "pbm", image::ImageFormat::Pnm },
// pgm = { "pgm", image::ImageFormat::Pnm },
// ppm = { "ppm", image::ImageFormat::Pnm },
pam = { "pam", image::ImageFormat::Pnm },
Expand Down Expand Up @@ -238,7 +238,7 @@ mod pnm_ascii_and_binary {
}

#[yare::parameterized(
// pbm = { "pbm" },
pbm = { "pbm" },
// pgm = { "pgm" },
// ppm = { "ppm" },
)]
Expand All @@ -247,7 +247,7 @@ mod pnm_ascii_and_binary {
}

#[yare::parameterized(
// pbm = { "pbm" },
pbm = { "pbm" },
// pgm = { "pgm" },
// ppm = { "ppm" },
)]
Expand Down

0 comments on commit d13bcfa

Please sign in to comment.