Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #183
Summary
Adds native non-destructive Adjustment Layers (
HSB,Color Balance,Curves, andGradient Map) with full support for built-in layer masks, opacity, blend modes, clipping masks, stack reordering, live re-editing, undo/redo, andMerge Down/Flatten.Changes
Engine (
crates/engine)LayerAdjustment(Hsb,ColorBalance,Curves,GradientMap),AdjustmentGradientStop, andLayer::adjustment: Option<LayerAdjustment>withsanitized()validation and serialization incrates/engine/src/document.rs.Document::add_adjustment_layer,Document::set_adjustment, cleanup onDocument::rasterize, and repair sanitization inDocument::repaired.Layerinitializers innative.rs,psd.rs, andproject.rs.adjustment_layers_sanitize_serialize_and_rasterize.GPU Compositing (
crates/gpu)LayerUniformincrates/gpu/src/shaders/composite.wgslandcrates/gpu/src/canvas.rswith anadjustmentflag and addedlayer_weight(p)+fs_blendhandling (mix(backdrop, blended, w)) so semi-transparent backdrops preserve alpha without premultiplied-over darkening.Canvas::composite_adjustment,run_adjustment_filter,adjustment_pass, and per-layer cached 256x1 RGBA8 LUT textures (adjustment_tables) forCurvesandGradientMap.plain(doc, id)cache partitioning andblend_layer_intosoMerge DownandFlattenwork with adjustment layers.crates/gpu/tests/layers.rs:adjustment_layer_hsb_mask_opacity_and_live_editadjustment_layer_curves_and_merge_downCore Session (
crates/core)AdjustmentLayerData,CanvasSession::add_adjustment_layer,CanvasSession::adjust_layer_begin, live parameter updates inadjust_hsb/adjust_color_balance/adjust_curves/adjust_gradient_map, and undo/cancel handling inadjust_end.CanvasSession::adjustment_layer_startincrates/core/src/adjusting.rsto populate UI controls from saved layer parameters.LayerInfo::adjustmentandLayerOption::EditAdjustmentincrates/core/src/layers.rs.Desktop & Android UI (
desktop,android)desktop/src/layers.rs,desktop/src/ui.rs): added adjustment layer creation options to the Layers+menu,Edit Adjustmentoption,ADJthumbnail badge, and live panel opening.CanvasViewModel.kt,LayersPanel.kt): added adjustment layer options to the+menu andLayerOption.EDIT_ADJUSTMENThandling.Verification
cargo fmt --all --check— passedcargo clippy --workspace --all-targets -- -D warnings— passed (0 warnings)procraft-engine: 439 passed, 8 ignored, 0 failedprocraft-gpu --test layers: 32 passed, 0 failedprocraft-core: 849 passed, 16 ignored, 0 failedprocraft-desktop: 105 passed, 2 ignored, 0 failed (test binary exited withSTATUS_ACCESS_VIOLATIONduring Windows driver teardown after all tests passed).\gradlew.bat --no-daemon :app:assembleRelease) — built (arm64-v8a+x86_64)