Skip to content

Commit

Permalink
Merge branch 'dev-lazpaint' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
circular17 authored Jan 22, 2024
2 parents 7bd8bd1 + 4fb8a17 commit 45a7a47
Show file tree
Hide file tree
Showing 121 changed files with 3,835 additions and 4,354 deletions.
45 changes: 27 additions & 18 deletions lazpaint/dialog/color/uadjustcurves.lfm
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
object FAdjustCurves: TFAdjustCurves
Left = 439
Height = 326
Height = 345
Top = 193
Width = 432
BorderIcons = [biSystemMenu, biMinimize]
Caption = 'Adjust curves'
ClientHeight = 326
ClientHeight = 345
ClientWidth = 432
KeyPreview = True
OnCloseQuery = FormCloseQuery
Expand All @@ -15,7 +15,7 @@ object FAdjustCurves: TFAdjustCurves
OnKeyDown = FormKeyDown
OnShow = FormShow
Position = poOwnerFormCenter
LCLVersion = '1.8.2.0'
LCLVersion = '2.2.4.0'
object TabControl1: TTabControl
Left = 0
Height = 289
Expand All @@ -33,12 +33,11 @@ object FAdjustCurves: TFAdjustCurves
'Alpha'
)
Align = alClient
Anchors = [akLeft, akTop, akRight, akBottom]
TabOrder = 0
object vsChart: TBGRAVirtualScreen
Left = 2
Height = 230
Top = 57
Height = 239
Top = 48
Width = 428
OnRedraw = vsChartRedraw
Align = alClient
Expand All @@ -53,7 +52,7 @@ object FAdjustCurves: TFAdjustCurves
object Panel2: TPanel
Left = 2
Height = 25
Top = 32
Top = 23
Width = 428
Align = alTop
ClientHeight = 25
Expand All @@ -65,7 +64,6 @@ object FAdjustCurves: TFAdjustCurves
Top = 0
Width = 90
Align = alNone
Anchors = [akTop, akLeft]
EdgeBorders = []
Images = FMain.ImageList16
ParentShowHint = False
Expand Down Expand Up @@ -98,50 +96,61 @@ object FAdjustCurves: TFAdjustCurves
end
object Panel1: TPanel
Left = 0
Height = 37
Height = 56
Top = 289
Width = 432
Align = alBottom
BevelOuter = bvNone
ClientHeight = 37
ClientHeight = 56
ClientWidth = 432
TabOrder = 1
object Button_Cancel: TButton
Left = 213
Height = 22
Top = 7
Top = 26
Width = 72
Anchors = [akLeft, akBottom]
Cancel = True
Caption = 'Cancel'
Caption = 'rsCancel'
ModalResult = 2
TabOrder = 0
end
object Button_OK: TButton
Left = 149
Height = 22
Top = 7
Top = 26
Width = 59
Anchors = [akLeft, akBottom]
Caption = 'OK'
Caption = 'rsOK'
Default = True
ModalResult = 1
OnClick = Button_OKClick
TabOrder = 1
end
object CheckBox_Preview: TCheckBox
Left = 8
Height = 19
Top = 0
Width = 70
Caption = 'rsPreview'
Checked = True
OnChange = CheckBox_PreviewChange
State = cbChecked
TabOrder = 2
end
end
object Timer_Thread: TTimer
Enabled = False
Interval = 200
OnTimer = Timer_ThreadTimer
left = 62
top = 466
Left = 62
Top = 466
end
object Timer_Chart: TTimer
Enabled = False
Interval = 20
OnTimer = Timer_ChartTimer
left = 123
top = 467
Left = 123
Top = 467
end
end
5 changes: 3 additions & 2 deletions lazpaint/dialog/color/uadjustcurves.lrj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{"hash":26714085,"name":"tfadjustcurves.toolbutton_newcurve.hint","sourcebytes":[68,105,115,99,97,114,100,32,99,117,114,114,101,110,116,32,99,117,114,118,101,32,97,110,100,32,115,116,97,114,116,32,97,32,110,101,119,32,111,110,101],"value":"Discard current curve and start a new one"},
{"hash":1994857,"name":"tfadjustcurves.toolbutton_removepoint.hint","sourcebytes":[82,101,109,111,118,101,32,115,101,108,101,99,116,101,100,32,112,111,105,110,116,32,40,68,101,108,41],"value":"Remove selected point (Del)"},
{"hash":179103845,"name":"tfadjustcurves.toolbutton_posterize.hint","sourcebytes":[80,111,115,116,101,114,105,122,101],"value":"Posterize"},
{"hash":77089212,"name":"tfadjustcurves.button_cancel.caption","sourcebytes":[67,97,110,99,101,108],"value":"Cancel"},
{"hash":1339,"name":"tfadjustcurves.button_ok.caption","sourcebytes":[79,75],"value":"OK"}
{"hash":127421996,"name":"tfadjustcurves.button_cancel.caption","sourcebytes":[114,115,67,97,110,99,101,108],"value":"rsCancel"},
{"hash":497723,"name":"tfadjustcurves.button_ok.caption","sourcebytes":[114,115,79,75],"value":"rsOK"},
{"hash":126662215,"name":"tfadjustcurves.checkbox_preview.caption","sourcebytes":[114,115,80,114,101,118,105,101,119],"value":"rsPreview"}
]}
51 changes: 50 additions & 1 deletion lazpaint/dialog/color/uadjustcurves.pas
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ interface
{ TFAdjustCurves }

TFAdjustCurves = class(TForm)
CheckBox_Preview: TCheckBox;
Panel2: TPanel;
Timer_Chart: TTimer;
Timer_Thread: TTimer;
Expand All @@ -38,6 +39,7 @@ TFAdjustCurves = class(TForm)
Panel1: TPanel;
TabControl1: TTabControl;
procedure Button_OKClick(Sender: TObject);
procedure CheckBox_PreviewChange(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
procedure FormDestroy(Sender: TObject);
procedure FormHide(Sender: TObject);
Expand Down Expand Up @@ -104,6 +106,11 @@ TFAdjustCurves = class(TForm)
procedure DiscardHistogram;
procedure QueryHistogramRedraw;
procedure OnTaskEvent({%H-}ASender: TObject; AEvent: TThreadManagerEvent);
private
FInitializingGui: boolean;
FComputedImage: TBGRABitmap;
procedure DisplayComputedImage;
procedure StoreComputedImage;
public
{ public declarations }
function ShowModal: integer; override;
Expand Down Expand Up @@ -336,6 +343,13 @@ procedure TFAdjustCurves.FormShow(Sender: TObject);
begin
vsChart.DiscardBitmap;
DiscardHistogram;

FInitializingGui := True;
Button_OK.Caption := rsOK;
Button_Cancel.Caption := rsCancel;
CheckBox_Preview.Caption := rsPreview;
CheckBox_Preview.Checked := True;
FInitializingGui := False;
end;

procedure TFAdjustCurves.TabControl1Change(Sender: TObject);
Expand Down Expand Up @@ -428,14 +442,29 @@ procedure TFAdjustCurves.FormDestroy(Sender: TObject);
begin
FreeAndNil(FGraphBackgroundLeft);
FreeAndNil(FGraphBackgroundBottom);
FreeAndNil(FComputedImage);
end;

procedure TFAdjustCurves.Button_OKClick(Sender: TObject);
begin
if not CheckBox_Preview.Checked then DisplayComputedImage;

if not FFilterConnector.ActionDone then FFilterConnector.ValidateAction;
ModalResult := mrOK;
end;

procedure TFAdjustCurves.CheckBox_PreviewChange(Sender: TObject);
begin
if FInitializingGui then exit;
if CheckBox_Preview.Checked then
DisplayComputedImage
else
begin
StoreComputedImage;
FFilterConnector.RestoreBackup;
end;
end;

procedure TFAdjustCurves.FormCloseQuery(Sender: TObject; var CanClose: boolean);
begin
FThreadManager.Quit;
Expand Down Expand Up @@ -947,18 +976,38 @@ procedure TFAdjustCurves.OnTaskEvent(ASender: TObject;
if FThreadManager.ReadyToClose then
Close
else
if AEvent = tmeCompletedTask then Button_OK.Enabled := true;
if AEvent = tmeCompletedTask then begin
Button_OK.Enabled := true;
CheckBox_Preview.Enabled := true;
end;
end;
tmeStartingNewTask:
begin
Timer_Thread.Enabled := false;
Timer_Thread.Interval := 100;
Timer_Thread.Enabled := true;
Button_OK.Enabled := false;
FInitializingGui := True;
CheckBox_Preview.Enabled := false;
CheckBox_Preview.Checked := True;
FreeAndNil(FComputedImage);
FInitializingGui := False;
end;
end;
end;

procedure TFAdjustCurves.DisplayComputedImage;
begin
if FComputedImage <> nil then
FFilterConnector.PutImage(FComputedImage, false, false);
end;

procedure TFAdjustCurves.StoreComputedImage;
begin
if FComputedImage = nil then
FComputedImage := FFilterConnector.ActiveLayer.Duplicate;
end;

function TFAdjustCurves.ShowModal: integer;
begin
if (FFilterConnector = nil) or (FFilterConnector.ActiveLayer = nil) then
Expand Down
37 changes: 22 additions & 15 deletions lazpaint/dialog/color/ucolorintensity.lfm
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
object FColorIntensity: TFColorIntensity
Left = 405
Height = 109
Height = 128
Top = 187
Width = 472
BorderIcons = [biSystemMenu]
BorderStyle = bsDialog
Caption = 'Intensity'
ClientHeight = 109
ClientHeight = 128
ClientWidth = 472
Font.Height = -12
OnCreate = FormCreate
OnShow = FormShow
Position = poOwnerFormCenter
LCLVersion = '1.0.10.0'
LCLVersion = '2.2.4.0'
object Label_Multiply: TLabel
Left = 8
Height = 16
Height = 15
Top = 46
Width = 45
Width = 44
Caption = 'Multiply'
ParentColor = False
end
object Label_Shift: TLabel
Left = 8
Height = 16
Height = 15
Top = 13
Width = 25
Width = 24
Caption = 'Shift'
ParentColor = False
end
Expand All @@ -50,9 +50,9 @@ object FColorIntensity: TFColorIntensity
object Button_OK: TButton
Left = 165
Height = 22
Top = 80
Top = 96
Width = 59
Caption = 'OK'
Caption = 'rsOK'
Default = True
ModalResult = 1
OnClick = Button_OKClick
Expand All @@ -61,10 +61,10 @@ object FColorIntensity: TFColorIntensity
object Button_Cancel: TButton
Left = 229
Height = 22
Top = 80
Top = 96
Width = 72
Cancel = True
Caption = 'Cancel'
Caption = 'rsCancel'
ModalResult = 2
TabOrder = 3
end
Expand All @@ -74,24 +74,31 @@ object FColorIntensity: TFColorIntensity
Top = 8
Width = 72
DecimalPlaces = 3
Increment = 1
MaxValue = 1
MinValue = -1
OnChange = FloatSpinEdit_ShiftChange
TabOrder = 4
Value = 0
end
object FloatSpinEdit_Factor: TFloatSpinEdit
Left = 392
Height = 23
Top = 43
Width = 72
DecimalPlaces = 3
Increment = 1
MaxValue = 2
MinValue = -2
OnChange = FloatSpinEdit_FactorChange
TabOrder = 5
Value = 0
end
object CheckBox_Preview: TCheckBox
Left = 8
Height = 19
Top = 80
Width = 70
Caption = 'rsPreview'
Checked = True
OnChange = CheckBox_PreviewChange
State = cbChecked
TabOrder = 6
end
end
5 changes: 3 additions & 2 deletions lazpaint/dialog/color/ucolorintensity.lrj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{"hash":180736233,"name":"tfcolorintensity.caption","sourcebytes":[73,110,116,101,110,115,105,116,121],"value":"Intensity"},
{"hash":205194361,"name":"tfcolorintensity.label_multiply.caption","sourcebytes":[77,117,108,116,105,112,108,121],"value":"Multiply"},
{"hash":5894100,"name":"tfcolorintensity.label_shift.caption","sourcebytes":[83,104,105,102,116],"value":"Shift"},
{"hash":1339,"name":"tfcolorintensity.button_ok.caption","sourcebytes":[79,75],"value":"OK"},
{"hash":77089212,"name":"tfcolorintensity.button_cancel.caption","sourcebytes":[67,97,110,99,101,108],"value":"Cancel"}
{"hash":497723,"name":"tfcolorintensity.button_ok.caption","sourcebytes":[114,115,79,75],"value":"rsOK"},
{"hash":127421996,"name":"tfcolorintensity.button_cancel.caption","sourcebytes":[114,115,67,97,110,99,101,108],"value":"rsCancel"},
{"hash":126662215,"name":"tfcolorintensity.checkbox_preview.caption","sourcebytes":[114,115,80,114,101,118,105,101,119],"value":"rsPreview"}
]}
Loading

0 comments on commit 45a7a47

Please sign in to comment.