Skip to content

Commit

Permalink
Merge pull request #624 from B-LechCode/609_Channel_Picker_with_shader
Browse files Browse the repository at this point in the history
609 channel picker with shader
  • Loading branch information
woelper authored Jan 28, 2025
2 parents 5cbcad6 + bcac960 commit b134b3e
Show file tree
Hide file tree
Showing 3 changed files with 242 additions and 158 deletions.
21 changes: 1 addition & 20 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -953,25 +953,6 @@ fn drawe(app: &mut App, gfx: &mut Graphics, plugins: &mut Plugins, state: &mut O
state
.current_texture
.set_image(&img, gfx, &state.persistent_settings);

match &state.persistent_settings.current_channel {
// Unpremultiply the image
ColorChannel::Rgb => state.current_texture.set_image(
&unpremult(&img),
gfx,
&state.persistent_settings,
),
// Do nuttin'
ColorChannel::Rgba => (),
// Display the channel
_ => {
state.current_texture.set_image(
&solo_channel(&img, state.persistent_settings.current_channel as usize),
gfx,
&state.persistent_settings,
);
}
}
state.current_image = Some(img);
}
Frame::UpdateTexture => {
Expand All @@ -983,7 +964,7 @@ fn drawe(app: &mut App, gfx: &mut Graphics, plugins: &mut Plugins, state: &mut O
&state.edit_state.result_pixel_op,
gfx,
&state.persistent_settings,
)
);
} else {
// update from image
if let Some(img) = &state.current_image {
Expand Down
Loading

0 comments on commit b134b3e

Please sign in to comment.