Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamicimage #495

Merged
merged 163 commits into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
9f5a6ca
wip: try alternate zoom option without egui
woelper Oct 27, 2024
7ae7c4a
wip: change rgba image to dynamicimage
woelper Oct 27, 2024
77c58b7
compiles again. Next up is replacing current_image
woelper Oct 27, 2024
10b7d6a
use dynamicimage as edit buffer
woelper Oct 28, 2024
ec9d8ac
pixel operator is now dynamicimage
woelper Oct 29, 2024
9606227
Merge branch 'master' into dynamicimage
woelper Oct 31, 2024
b859357
fix merge issues
woelper Oct 31, 2024
e7c6f41
Suppoer for more image types in pixel operators
woelper Nov 1, 2024
e61d83e
Add colortype operator
woelper Nov 1, 2024
dedcccc
WIP: adding grayscale8 rendering to texture wrapper
Nov 2, 2024
e3e4a3a
Refactoring variable names and removing premult from texture wrapper
Nov 2, 2024
ed09f90
wip fixing texture update
Nov 2, 2024
1225525
render notan zoom image with exact coordinates
Nov 2, 2024
1fe405b
Render a placeholder rectangle with egui, to keep a defined space to …
Nov 3, 2024
4438c58
Change matching to DynamicImage enum directly.
Nov 3, 2024
506d7c5
trying faster image copying.
Nov 4, 2024
9252515
Merge branch 'alternative_zoom' of https://github.com/woelper/oculant…
B-LechCode Nov 4, 2024
4d7ab70
Merge branch 'alternative_zoom' of https://github.com/woelper/oculant…
B-LechCode Nov 4, 2024
480d8b9
Curent non wip: drawing zoom image with notan.
B-LechCode Nov 4, 2024
3183647
wip: rendering zoom image for multiple textures.
Nov 6, 2024
cfe7a67
Preview rendering now works with dynamic image.
B-LechCode Nov 6, 2024
8118088
Sub image creation with memory safe functions.
B-LechCode Nov 6, 2024
54d4682
add resize, blur and rotate for DynamicImage
woelper Nov 6, 2024
c956b6a
Better notifications
woelper Nov 6, 2024
17c3983
Merge branch 'dynamicimage' of github.com:woelper/oculante into dynam…
woelper Nov 6, 2024
3bc34f1
cargo fmt
woelper Nov 6, 2024
456d59a
Streamlined sub-image creation
Nov 9, 2024
5bc4220
Merge branch 'master' into dynamicimage
Stoppedpuma Nov 13, 2024
7d15fbc
Merge branch 'master' into dynamicimage
Stoppedpuma Nov 14, 2024
10e4b47
File cleanup, function extraction for texture parameter query
Nov 14, 2024
4fc7a16
Merge branch 'dynamicimage' of https://github.com/woelper/oculante in…
Nov 14, 2024
d39b79d
feat: enable thumbnails in image browser
woelper Nov 14, 2024
3a071d5
Merge branch 'dynamicimage' into dynamicimage_thumbnails
woelper Nov 14, 2024
153642d
Merge pull request #513 from woelper/dynamicimage_thumbnails
woelper Nov 14, 2024
30890eb
tweaks to filebrowser
woelper Nov 20, 2024
bba38c6
tweak operator UI
woelper Nov 24, 2024
bcb4472
Merge branch 'master' into dynamicimage
woelper Nov 26, 2024
295165f
operator refactor
woelper Nov 28, 2024
35f72b5
Ensure only supported image types are used in texture_wrapper directly.
Dec 5, 2024
8c1ff1c
Truncate buffer it it's too big to prevent texture generation errors.
Dec 5, 2024
746fa3a
Ignore JetBrains IDE stuff
Stoppedpuma Dec 7, 2024
c252a3a
Adjust file manager default_width and inner_margin
Stoppedpuma Dec 7, 2024
a5b0dc7
feat: Support Japanese, Arabic, Chinese
woelper Dec 7, 2024
8d85813
Only render visible thumbnails
woelper Dec 7, 2024
1475720
Merge branch 'master' into dynamicimage
woelper Dec 7, 2024
cd1efd5
Merge branch 'dynamicimage' of github.com:woelper/oculante into dynam…
woelper Dec 9, 2024
672a441
use dng preview
woelper Dec 9, 2024
a87947a
Merge branch 'master' into dynamicimage
woelper Dec 12, 2024
1a96627
use filebrowser captions
woelper Dec 14, 2024
91dc62e
Merge branch 'master' into dynamicimage
woelper Dec 14, 2024
2c2e6f2
update lockfile
woelper Dec 14, 2024
94edf43
fix preview image drawing over file browser
woelper Dec 14, 2024
521f42f
fix div/0, fix warnings, 4:3 thumbs
woelper Dec 14, 2024
857e558
increase favoute length to 12 so the thumbnails are filled
woelper Dec 14, 2024
6ac5e23
reduce caption height
woelper Dec 14, 2024
9777bc5
Allow copy and paste in egui
woelper Dec 14, 2024
06a60ca
fmt
woelper Dec 15, 2024
ee8a031
Show multi-line filepath on hover
woelper Dec 16, 2024
9f642ac
Add alt to default colour channel keybinds
Stoppedpuma Dec 20, 2024
cbf46f2
fix recent menu
woelper Dec 22, 2024
919ddcd
Remove unnecessary hamburger menu width increase
Stoppedpuma Dec 22, 2024
98ebe9e
fix: Prevent application from saving current channel to settings file…
woelper Dec 23, 2024
d723fe0
display message overlay if color mode is not rgba
woelper Dec 23, 2024
c307813
fix expanding edit menu (closes #564)
woelper Dec 23, 2024
7aeb876
fix palette duplicates (fixes #566)
woelper Dec 23, 2024
b118d81
Enable palette sorting, right click removal and ordering (closes #573…
woelper Dec 25, 2024
4279a7d
feat: Copy palette color to clipboard, highlight palette color if con…
woelper Dec 25, 2024
932e9ae
feat: generate palette from image
woelper Dec 25, 2024
4519a13
Prevent preview from drawing over ui elements (fixes #568(
woelper Dec 26, 2024
de8d9a6
Fix palette elements displaying if palette len == 0 (fixes #575)
woelper Dec 26, 2024
b26be1f
fmt
woelper Dec 27, 2024
2d4152b
make image_editing public
woelper Dec 27, 2024
f15e15e
add experimental features
woelper Dec 27, 2024
af08bb5
WIP settings redesign and experimental settings, test measurements
woelper Dec 27, 2024
b5f8187
Further work on settings ui
woelper Dec 27, 2024
f97e425
tweak font offset
woelper Dec 27, 2024
588e3e5
prevent text from being selected in settings
woelper Dec 27, 2024
696539b
tweak caret
woelper Dec 27, 2024
73d0c7b
Show URL on "Check it out" link button
Stoppedpuma Dec 27, 2024
ee4bb63
account for high dpi displays
woelper Dec 27, 2024
067996a
Merge branch 'dynamicimage' of github.com:woelper/oculante into dynam…
woelper Dec 27, 2024
9c91fca
cleanup and color picking speedup
woelper Dec 28, 2024
b9600f7
Align info panel (fixes #443)
woelper Dec 28, 2024
9a409cb
Small preferences resize code quality fix
Stoppedpuma Dec 28, 2024
00858e2
WIP: Prevent image clamping in picker rendering
B-LechCode Dec 28, 2024
51400aa
use slower resizing that is more robust
woelper Dec 29, 2024
7968721
reset exposure value
woelper Dec 29, 2024
bece882
Update icons
Stoppedpuma Dec 29, 2024
5b0cf4e
prevent captions from drawing over ui (fixes #585)
woelper Dec 29, 2024
df8ddea
Merge branch 'dynamicimage' of github.com:woelper/oculante into dynam…
woelper Dec 29, 2024
8191252
List more cargo features in README
Stoppedpuma Dec 29, 2024
b9c4a12
Adjust text color to match redesign
woelper Dec 29, 2024
b3eb9c6
Merge branch 'dynamicimage' of github.com:woelper/oculante into dynam…
woelper Dec 29, 2024
60c7b7c
Fix dropdowns and buttons in panels (fixes #583)
woelper Dec 29, 2024
094b098
set button text == label text
woelper Dec 30, 2024
76835a5
fix warnings
woelper Dec 30, 2024
c587e55
Fix checkbox
woelper Dec 30, 2024
ddf8ec3
improve input spacing
woelper Dec 30, 2024
db5ae70
prevent rgba shortcuts in edit mode
woelper Dec 30, 2024
bc49702
fix search not returning results
woelper Dec 30, 2024
cee83e7
Ensure all images are displayed in file browser, secure range
woelper Dec 30, 2024
e01e468
fix file browser shortcut not working
woelper Dec 30, 2024
c81a9e6
Enable adding loaded images to compare list
woelper Dec 30, 2024
f9aae87
Add large directory tests
Stoppedpuma Dec 31, 2024
551c728
Improve file browser performance
woelper Jan 1, 2025
05c67c2
limit filebrowser processing
woelper Jan 1, 2025
96fed43
cap max processes for thumbnail generation
woelper Jan 1, 2025
f5ea5a8
Sort directories
woelper Jan 1, 2025
8e06a6b
Unwind on panic in release mode
woelper Jan 2, 2025
6f999b3
Recenter colour channel toast
Stoppedpuma Jan 3, 2025
36a2e46
wip listing drives
woelper Jan 4, 2025
58010e5
optional disk on mac, better path component layout
woelper Jan 5, 2025
ab681c5
os-agnostic disk listing
woelper Jan 5, 2025
bf8ad89
show removable disks only on non-windows systems
woelper Jan 5, 2025
1e750c1
Add icon for removable media
Stoppedpuma Jan 5, 2025
08aa7fb
Allow file manager to move freely
Stoppedpuma Jan 5, 2025
203f52b
Render Picker with dummy texture for out of bounds coordinates
B-LechCode Jan 5, 2025
6ea3bac
Merge branch 'dynamicimage' of https://github.com/woelper/oculante in…
B-LechCode Jan 5, 2025
2b149e7
Format code
B-LechCode Jan 5, 2025
3e91e22
Fix zoom crosshair
Stoppedpuma Jan 6, 2025
d8341dc
Round picker coordinates instead of floor
B-LechCode Jan 6, 2025
39b0510
Add eye icons
Stoppedpuma Jan 6, 2025
5843d97
Removing rounding,
B-LechCode Jan 6, 2025
60beaf6
feat: Enable bypassing image filters
woelper Jan 6, 2025
50e5e66
Merge branch 'dynamicimage' of github.com:woelper/oculante into dynam…
woelper Jan 6, 2025
01264bb
chore: Filters are in scrollable list
woelper Jan 6, 2025
e9bf1f3
simplify functions
woelper Jan 7, 2025
8ab1c1c
cleanup
woelper Jan 7, 2025
70cd435
Extending support for 16 Bit images
B-LechCode Jan 7, 2025
78323d8
simplify image byte calculation
B-LechCode Jan 7, 2025
f71af93
Keep filter extension when saving (fixes #597)
woelper Jan 7, 2025
85942a7
Merge branch 'dynamicimage' of github.com:woelper/oculante into dynam…
woelper Jan 7, 2025
11226d6
Remove unnecessary texture pair
B-LechCode Jan 7, 2025
f471310
Display hint text if image is not rgba while editing
woelper Jan 7, 2025
cb3d1ff
fix light mode scroll bars
woelper Jan 7, 2025
2c5f4db
fix operator contrast and overwriting images
woelper Jan 8, 2025
4c44159
refactor modal and display on overwriting images, write thumbnail on …
woelper Jan 8, 2025
88d9694
Fix warnings
woelper Jan 8, 2025
896a49f
cleanup
woelper Jan 8, 2025
eb9a56d
prevent channel message showing
woelper Jan 8, 2025
3053253
fix color channels in edit mode (for real)
woelper Jan 8, 2025
cd3e97d
re-enable rfd
woelper Jan 9, 2025
4dcccf5
Remove outdated and useless comments, update default file manager wid…
Stoppedpuma Jan 9, 2025
c9fc290
When saving an image, reload the directory contents so new images appear
woelper Jan 9, 2025
d1f544c
Improve original and modified buttons
woelper Jan 9, 2025
9552be2
Set correct texture type for images when they are implicitly converted.
B-LechCode Jan 10, 2025
72b43e3
re-generate thumbnails of changed files
woelper Jan 10, 2025
8a1e412
Merge branch 'dynamicimage' of github.com:woelper/oculante into dynam…
woelper Jan 10, 2025
63c5598
remove unix specific import
woelper Jan 10, 2025
f2dbc93
fix windows build
woelper Jan 10, 2025
9fe2ea9
Adding missing image types for tiling
B-LechCode Jan 10, 2025
06e074a
Merge branch 'dynamicimage' into make-colour-channels-require-alt-by-…
Stoppedpuma Jan 10, 2025
64f716e
Merge branch 'extended_lang_support' into dynamicimage
woelper Jan 11, 2025
0851570
feat: Arabic language support
woelper Jan 11, 2025
dfb6b67
feat: Simplified Chinese support
woelper Jan 11, 2025
e46bd96
clippy fixes
woelper Jan 11, 2025
7e9f281
Merge pull request #562 from Stoppedpuma/make-colour-channels-require…
woelper Jan 11, 2025
22d3a0f
revert alt shortcuts: Mac fn key is not a good mapping
woelper Jan 11, 2025
97bbaa8
Auto-upgrade edit files
woelper Jan 11, 2025
69886bd
fmt
woelper Jan 11, 2025
caeade8
migrate legacy config and hide edit panel
woelper Jan 11, 2025
d7cbc21
Auto-shrink file manager
woelper Jan 12, 2025
1fbbc67
fix scroll artifacts
woelper Jan 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ perf.*
flamegraph.svg
.notes
TODO
debug.png
debug.png
.idea
72 changes: 72 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dirs = "5.0"
env_logger = "0.11"
evalexpr = "11.3"
exr = "1.72"
fast_image_resize = "5.0"
fast_image_resize = { version = "5.0", features = ["rayon"] }
gif = "0.13.1"
gif-dispose = "5.0.1"
image = { version = "0.25.4", features = ["hdr"] }
Expand All @@ -39,6 +39,7 @@ notan = { version = "0.12", default-features = false, features = [
"draw",
"drop_files",
"egui",
"clipboard"
] }
egui_plot = "0.27"
palette = "0.7"
Expand Down Expand Up @@ -93,6 +94,7 @@ libblur = "0.13.5"
egui-modal = "0.3.6"
zip = "2.2.0"
ase-swatch = "0.1.0"
quantette = { version = "0.3.0", features = ["threads"] }

[features]
default = [
Expand All @@ -111,6 +113,7 @@ turbo = ["turbojpeg"]
update = ["self_update"]
j2k = ["jpeg2k"]
jxlcms = ["jxl-oxide/lcms2"]
hdr = []


[target.'cfg(target_os = "macos")'.dependencies]
Expand Down
12 changes: 6 additions & 6 deletions src/appstate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ use crate::{
scrubber::Scrubber,
settings::{PersistentSettings, VolatileSettings},
texture_wrapper::TextureWrapperManager,
thumbnails::Thumbnails,
utils::{ExtendedImageInfo, Frame, Player},
};

use egui_notify::Toasts;
use image::RgbaImage;
use image::DynamicImage;
use nalgebra::Vector2;
use notan::{egui::epaint::ahash::HashMap, prelude::Texture, AppState};
use std::{
Expand Down Expand Up @@ -70,7 +71,7 @@ pub struct OculanteState {
//pub current_texture: Option<TexWrap>,
pub current_texture: TextureWrapperManager,
pub current_path: Option<PathBuf>,
pub current_image: Option<RgbaImage>,
pub current_image: Option<DynamicImage>,
pub settings_enabled: bool,
pub image_info: Option<ExtendedImageInfo>,
pub tiling: usize,
Expand All @@ -93,6 +94,7 @@ pub struct OculanteState {
pub first_start: bool,
pub toasts: Toasts,
pub filebrowser_id: Option<String>,
pub thumbnails: Thumbnails,
}

impl<'b> OculanteState {
Expand All @@ -109,10 +111,7 @@ impl<'b> OculanteState {
}

pub fn send_frame(&self, frame: Frame) {
let _ = self
.texture_channel
.0
.send(frame);
let _ = self.texture_channel.0.send(frame);
}
}

Expand Down Expand Up @@ -161,6 +160,7 @@ impl<'b> Default for OculanteState {
first_start: true,
toasts: Toasts::default().with_anchor(egui_notify::Anchor::BottomLeft),
filebrowser_id: None,
thumbnails: Default::default(),
}
}
}
10 changes: 5 additions & 5 deletions src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,31 @@ use std::{
time::Instant,
};

use image::RgbaImage;
use image::DynamicImage;
use log::debug;

#[derive(Debug)]
#[derive(Debug, Default)]
pub struct Cache {
pub data: HashMap<PathBuf, CachedImage>,
pub cache_size: usize,
}

#[derive(Debug)]
pub struct CachedImage {
data: RgbaImage,
data: DynamicImage,
created: Instant,
}

impl Cache {
pub fn get(&self, path: &Path) -> Option<RgbaImage> {
pub fn get(&self, path: &Path) -> Option<DynamicImage> {
self.data.get(path).map(|c| c.data.clone())
}

pub fn clear(&mut self) {
self.data.clear()
}

pub fn insert(&mut self, path: &Path, img: RgbaImage) {
pub fn insert(&mut self, path: &Path, img: DynamicImage) {
self.data.insert(
path.into(),
CachedImage {
Expand Down
20 changes: 13 additions & 7 deletions src/file_encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ use crate::ui::EguiExt;
use anyhow::Result;
use image::codecs::jpeg::JpegEncoder;
use image::codecs::png::{CompressionType, PngEncoder};
use image::DynamicImage;
use image::{DynamicImage, ImageEncoder};
use notan::egui::Ui;
use serde::{Deserialize, Serialize};
use std::fs::File;
use std::io::BufWriter;
use std::path::Path;
use strum::{Display, EnumIter};

Expand Down Expand Up @@ -69,18 +70,23 @@ impl FileEncoder {
JpegEncoder::new_with_quality(w, *quality as u8).encode_image(image)?;
}
FileEncoder::Png { compressionlevel } => {
let w = File::create(path)?;

PngEncoder::new_with_quality(
w,
let file = File::create(path)?;
let writer = BufWriter::new(file);
let encoder = PngEncoder::new_with_quality(
writer,
match compressionlevel {
CompressionLevel::Best => CompressionType::Best,
CompressionLevel::Default => CompressionType::Default,
CompressionLevel::Fast => CompressionType::Fast,
},
image::codecs::png::FilterType::Adaptive,
image::codecs::png::FilterType::default(),
);
image.save_with_format(path, image::ImageFormat::Png)?;
encoder.write_image(
image.as_bytes(),
image.width(),
image.height(),
image::ExtendedColorType::Rgba8,
)?;
}
FileEncoder::Bmp => {
image.save_with_format(path, image::ImageFormat::Bmp)?;
Expand Down
Loading
Loading