Spaces:
Running
Running
Update script.js
Browse files
script.js
CHANGED
@@ -33,16 +33,11 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
33 |
let originalImageData = null;
|
34 |
let isApplyingFilters = false;
|
35 |
|
36 |
-
// RGBカーブを適用する関数
|
37 |
const applyRgbCurves = function() {
|
38 |
-
if (!camanInstance) return;
|
39 |
-
|
40 |
-
// カーブデータを準備
|
41 |
const redCurve = createCurveData(redCurvePoints);
|
42 |
const greenCurve = createCurveData(greenCurvePoints);
|
43 |
const blueCurve = createCurveData(blueCurvePoints);
|
44 |
|
45 |
-
// カーブを適用
|
46 |
this.process("rgbCurve", function(rgba) {
|
47 |
rgba.r = redCurve[rgba.r];
|
48 |
rgba.g = greenCurve[rgba.g];
|
@@ -51,10 +46,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
51 |
});
|
52 |
};
|
53 |
|
54 |
-
// 輝度カーブを適用する関数
|
55 |
const applyLuminanceCurve = function() {
|
56 |
-
if (!camanInstance) return;
|
57 |
-
|
58 |
const luminanceCurve = createCurveData(luminanceCurvePoints);
|
59 |
const shadowAmount = parseInt(shadowsSlider.value) / 100 * 50;
|
60 |
const highlightAmount = parseInt(highlightsSlider.value) / 100 * 50;
|
@@ -117,13 +109,15 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
117 |
try {
|
118 |
camanInstance.revert(false);
|
119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
camanInstance.newLayer(function() {
|
121 |
-
|
122 |
-
|
123 |
-
this.saturation(parseInt(saturationSlider.value));
|
124 |
-
|
125 |
-
applyRgbCurves.call(this);
|
126 |
-
applyLuminanceCurve.call(this);
|
127 |
});
|
128 |
|
129 |
camanInstance.render();
|
|
|
33 |
let originalImageData = null;
|
34 |
let isApplyingFilters = false;
|
35 |
|
|
|
36 |
const applyRgbCurves = function() {
|
|
|
|
|
|
|
37 |
const redCurve = createCurveData(redCurvePoints);
|
38 |
const greenCurve = createCurveData(greenCurvePoints);
|
39 |
const blueCurve = createCurveData(blueCurvePoints);
|
40 |
|
|
|
41 |
this.process("rgbCurve", function(rgba) {
|
42 |
rgba.r = redCurve[rgba.r];
|
43 |
rgba.g = greenCurve[rgba.g];
|
|
|
46 |
});
|
47 |
};
|
48 |
|
|
|
49 |
const applyLuminanceCurve = function() {
|
|
|
|
|
50 |
const luminanceCurve = createCurveData(luminanceCurvePoints);
|
51 |
const shadowAmount = parseInt(shadowsSlider.value) / 100 * 50;
|
52 |
const highlightAmount = parseInt(highlightsSlider.value) / 100 * 50;
|
|
|
109 |
try {
|
110 |
camanInstance.revert(false);
|
111 |
|
112 |
+
// 基本調整を直接適用
|
113 |
+
camanInstance.brightness(parseInt(brightnessSlider.value));
|
114 |
+
camanInstance.contrast(parseInt(contrastSlider.value) * 1.5);
|
115 |
+
camanInstance.saturation(parseInt(saturationSlider.value));
|
116 |
+
|
117 |
+
// カーブ調整のみレイヤー処理
|
118 |
camanInstance.newLayer(function() {
|
119 |
+
applyRgbCurves.call(camanInstance);
|
120 |
+
applyLuminanceCurve.call(camanInstance);
|
|
|
|
|
|
|
|
|
121 |
});
|
122 |
|
123 |
camanInstance.render();
|