Juliette ELSASS преди 1 година
родител
ревизия
33c4c35fbb
променени са 38 файла, в които са добавени 2631 реда и са изтрити 46 реда
  1. 30 29
      lazpaint/dialog/filter/uhypocycloid.lfm
  2. 4 0
      lazpaint/dialog/filter/uhypocycloid.pas
  3. 337 0
      lazpaint/dialog/filter/usuperformula.lfm
  4. 17 0
      lazpaint/dialog/filter/usuperformula.lrj
  5. 428 0
      lazpaint/dialog/filter/usuperformula.pas
  6. 3 2
      lazpaint/image/uimagediff.pas
  7. 9 1
      lazpaint/lazpaint.lpi
  8. 1 1
      lazpaint/lazpaint.lpr
  9. 12 0
      lazpaint/lazpaintdialogs.inc
  10. 2 1
      lazpaint/lazpaintinstance.pas
  11. 5 0
      lazpaint/lazpaintmainform.lfm
  12. 1 0
      lazpaint/lazpaintmainform.pas
  13. 4 3
      lazpaint/lazpainttype.pas
  14. 63 0
      lazpaint/release/bin/i18n/lazpaint.ar.po
  15. 63 0
      lazpaint/release/bin/i18n/lazpaint.bg.po
  16. 63 0
      lazpaint/release/bin/i18n/lazpaint.cs.po
  17. 63 0
      lazpaint/release/bin/i18n/lazpaint.de.po
  18. 63 0
      lazpaint/release/bin/i18n/lazpaint.es.po
  19. 63 0
      lazpaint/release/bin/i18n/lazpaint.fi.po
  20. 63 0
      lazpaint/release/bin/i18n/lazpaint.fr.po
  21. 62 1
      lazpaint/release/bin/i18n/lazpaint.it.po
  22. 62 2
      lazpaint/release/bin/i18n/lazpaint.ja.po
  23. 63 0
      lazpaint/release/bin/i18n/lazpaint.kab.po
  24. 63 0
      lazpaint/release/bin/i18n/lazpaint.lv.po
  25. 63 0
      lazpaint/release/bin/i18n/lazpaint.nl.po
  26. 63 0
      lazpaint/release/bin/i18n/lazpaint.pl.po
  27. 59 0
      lazpaint/release/bin/i18n/lazpaint.pot
  28. 63 0
      lazpaint/release/bin/i18n/lazpaint.pt_BR.po
  29. 63 0
      lazpaint/release/bin/i18n/lazpaint.ru.po
  30. 63 0
      lazpaint/release/bin/i18n/lazpaint.sv.po
  31. 63 0
      lazpaint/release/bin/i18n/lazpaint.tr.po
  32. 63 0
      lazpaint/release/bin/i18n/lazpaint.zh_CN.po
  33. 13 0
      lazpaint/uconfig.pas
  34. 5 3
      lazpaint/ufilters.pas
  35. 1 1
      lazpaint/umenu.pas
  36. 5 1
      lazpaintcontrols/lazpaintcontrols.lpk
  37. 2 1
      lazpaintcontrols/lazpaintcontrols.pas
  38. 561 0
      lazpaintcontrols/lcsuperformulaoriginal.pas

+ 30 - 29
lazpaint/dialog/filter/uhypocycloid.lfm

@@ -1,8 +1,8 @@
 object FHypocycloid: TFHypocycloid
   Left = 989
-  Height = 90
+  Height = 180
   Top = 156
-  Width = 203
+  Width = 464
   AutoSize = True
   BorderIcons = [biSystemMenu]
   BorderStyle = bsDialog
@@ -13,40 +13,41 @@ object FHypocycloid: TFHypocycloid
   ChildSizing.VerticalSpacing = 8
   ChildSizing.Layout = cclLeftToRightThenTopToBottom
   ChildSizing.ControlsPerLine = 1
-  ClientHeight = 90
-  ClientWidth = 203
+  ClientHeight = 180
+  ClientWidth = 464
+  DesignTimePPI = 192
   OnCreate = FormCreate
   OnHide = FormHide
   OnShow = FormShow
   Position = poScreenCenter
-  LCLVersion = '2.2.6.0'
+  LCLVersion = '3.4.0.0'
   object Panel1: TPanel
     Left = 8
-    Height = 21
+    Height = 40
     Top = 8
-    Width = 130
+    Width = 206
     BevelOuter = bvNone
     ChildSizing.HorizontalSpacing = 8
     ChildSizing.Layout = cclLeftToRightThenTopToBottom
     ChildSizing.ControlsPerLine = 2
-    ClientHeight = 21
-    ClientWidth = 130
+    ClientHeight = 40
+    ClientWidth = 206
     TabOrder = 0
     object Label_Amount: TLabel
       Left = 0
-      Height = 21
+      Height = 40
       Top = 0
-      Width = 42
+      Width = 68
       Caption = 'Cusps:'
       Layout = tlCenter
       ParentColor = False
     end
     object SpinEdit_CuspCount: TSpinEdit
-      Left = 50
-      Height = 21
+      Left = 76
+      Height = 40
       Top = 0
-      Width = 65
-      Constraints.MinWidth = 65
+      Width = 130
+      Constraints.MinWidth = 130
       MaxValue = 20
       MinValue = 1
       OnChange = SpinEdit_CuspCountChange
@@ -56,47 +57,47 @@ object FHypocycloid: TFHypocycloid
   end
   object Panel2: TPanel
     Left = 8
-    Height = 20
-    Top = 37
-    Width = 130
+    Height = 42
+    Top = 56
+    Width = 206
     BevelOuter = bvNone
     ChildSizing.HorizontalSpacing = 8
     ChildSizing.Layout = cclLeftToRightThenTopToBottom
     ChildSizing.ControlsPerLine = 2
-    ClientHeight = 20
-    ClientWidth = 130
+    ClientHeight = 42
+    ClientWidth = 206
     TabOrder = 1
     object Button_OK: TButton
       Left = 0
-      Height = 20
+      Height = 42
       Top = 0
-      Width = 50
+      Width = 76
       AutoSize = True
       Caption = 'rsOK'
       Default = True
       Enabled = False
       ModalResult = 1
-      OnClick = Button_OKClick
       TabOrder = 0
+      OnClick = Button_OKClick
     end
     object Button_Cancel: TButton
-      Left = 58
-      Height = 20
+      Left = 84
+      Height = 42
       Top = 0
-      Width = 72
+      Width = 115
       AutoSize = True
       Cancel = True
       Caption = 'rsCancel'
       ModalResult = 2
-      OnClick = Button_CancelClick
       TabOrder = 1
+      OnClick = Button_CancelClick
     end
   end
   object TimerDisplay: TTimer
     Enabled = False
     Interval = 200
     OnTimer = TimerDisplayTimer
-    Left = 152
-    Top = 24
+    Left = 304
+    Top = 48
   end
 end

+ 4 - 0
lazpaint/dialog/filter/uhypocycloid.pas

@@ -150,6 +150,8 @@ procedure TFHypocycloid.Button_OKClick(Sender: TObject);
 begin
   TimerDisplay.Enabled := false;
   if not FPreviewDone then DisplayShape;
+
+  FInstance.Config.SetDefaultCuspCount(SpinEdit_CuspCount.Value);
 end;
 
 procedure TFHypocycloid.Button_CancelClick(Sender: TObject);
@@ -224,6 +226,8 @@ end;
 
 procedure TFHypocycloid.NeedPreview;
 begin
+  if FInitializing then exit;
+
   TimerDisplay.Enabled := false;
   TimerDisplay.Enabled := true;
   FPreviewDone := false;

+ 337 - 0
lazpaint/dialog/filter/usuperformula.lfm

@@ -0,0 +1,337 @@
+object FSuperformula: TFSuperformula
+  Left = 649
+  Height = 372
+  Top = 269
+  Width = 1100
+  AutoSize = True
+  Caption = 'Superformula'
+  ClientHeight = 372
+  ClientWidth = 1100
+  DesignTimePPI = 192
+  OnCreate = FormCreate
+  OnHide = FormHide
+  OnShow = FormShow
+  LCLVersion = '3.4.0.0'
+  object Panel_Parameters: TPanel
+    Left = 0
+    Height = 222
+    Top = 0
+    Width = 1100
+    Align = alTop
+    AutoSize = True
+    ChildSizing.LeftRightSpacing = 16
+    ChildSizing.TopBottomSpacing = 16
+    ChildSizing.HorizontalSpacing = 32
+    ChildSizing.VerticalSpacing = 8
+    ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
+    ChildSizing.Layout = cclLeftToRightThenTopToBottom
+    ChildSizing.ControlsPerLine = 6
+    ClientHeight = 222
+    ClientWidth = 1100
+    ParentFont = False
+    TabOrder = 0
+    object Label_PenColor: TLabel
+      Left = 17
+      Height = 44
+      Top = 17
+      Width = 189
+      Caption = 'Pen color'
+      ParentColor = False
+      ParentFont = False
+    end
+    object ColorButton_PenColor: TColorButton
+      Left = 238
+      Height = 44
+      Top = 17
+      Width = 145
+      BorderWidth = 4
+      ButtonColorSize = 32
+      ButtonColor = 8404992
+      Constraints.MinHeight = 44
+      OnColorChanged = ColorButton_PenColorColorChanged
+      ParentFont = False
+    end
+    object Label_Width: TLabel
+      Left = 415
+      Height = 44
+      Top = 17
+      Width = 131
+      Caption = 'Width'
+      ParentColor = False
+      ParentFont = False
+    end
+    object SpinEdit_Width: TFloatSpinEdit
+      Left = 578
+      Height = 44
+      Top = 17
+      Width = 145
+      DecimalPlaces = 0
+      Increment = 10
+      MaxValue = 1000
+      OnChange = SpinEdit_WidthChange
+      ParentFont = False
+      TabOrder = 7
+      Value = 80
+    end
+    object Label_BackColor: TLabel
+      Left = 755
+      Height = 44
+      Top = 17
+      Width = 154
+      Caption = 'Back color'
+      ParentColor = False
+      ParentFont = False
+    end
+    object ColorButton_BackColor: TColorButton
+      Left = 941
+      Height = 44
+      Top = 17
+      Width = 142
+      BorderWidth = 4
+      ButtonColorSize = 32
+      ButtonColor = 12615680
+      OnColorChanged = ColorButton_BackColorColorChanged
+      ParentFont = False
+    end
+    object Label_SpikeCount: TLabel
+      Left = 17
+      Height = 40
+      Top = 69
+      Width = 189
+      Caption = 'Spike count'
+      ParentColor = False
+      ParentFont = False
+    end
+    object SpinEdit_M: TFloatSpinEdit
+      Left = 238
+      Height = 40
+      Top = 69
+      Width = 145
+      Increment = 0.2
+      MaxValue = 100
+      MinValue = 0.01
+      OnChange = SpinEdit_MChange
+      ParentFont = False
+      TabOrder = 2
+      Value = 8
+    end
+    object Label_Rational: TLabel
+      Left = 415
+      Height = 40
+      Top = 69
+      Width = 131
+      Caption = 'Rational'
+    end
+    object CheckBox_MRational: TCheckBox
+      Left = 578
+      Height = 40
+      Top = 69
+      Width = 145
+      Checked = True
+      State = cbChecked
+      TabOrder = 8
+      OnChange = CheckBox_MRationalChange
+    end
+    object Label_Size: TLabel
+      Left = 755
+      Height = 40
+      Top = 69
+      Width = 154
+      Caption = 'Size'
+      ParentColor = False
+      ParentFont = False
+    end
+    object SpinEdit_Size: TFloatSpinEdit
+      Left = 941
+      Height = 40
+      Top = 69
+      Width = 142
+      DecimalPlaces = 0
+      Increment = 25
+      MaxValue = 1000000
+      MinValue = 1
+      OnChange = SpinEdit_SizeChange
+      ParentFont = False
+      TabOrder = 6
+      Value = 200
+    end
+    object Label_N1: TLabel
+      Left = 17
+      Height = 40
+      Top = 117
+      Width = 189
+      Caption = 'n1'
+      ParentColor = False
+      ParentFont = False
+    end
+    object SpinEdit_N1: TFloatSpinEdit
+      Left = 238
+      Height = 40
+      Top = 117
+      Width = 145
+      DecimalPlaces = 3
+      Increment = 0.05
+      MaxValue = 1000000
+      MinValue = 0.01
+      OnChange = SpinEdit_N1Change
+      ParentFont = False
+      TabOrder = 3
+      Value = 1
+    end
+    object Label_N2: TLabel
+      Left = 415
+      Height = 40
+      Top = 117
+      Width = 131
+      Caption = 'n2'
+      ParentColor = False
+      ParentFont = False
+    end
+    object SpinEdit_N2: TFloatSpinEdit
+      Left = 578
+      Height = 40
+      Top = 117
+      Width = 145
+      DecimalPlaces = 3
+      Increment = 0.05
+      MaxValue = 1000000
+      MinValue = 0.1
+      OnChange = SpinEdit_N2Change
+      ParentFont = False
+      TabOrder = 4
+      Value = 2
+    end
+    object Label_N3: TLabel
+      Left = 755
+      Height = 40
+      Top = 117
+      Width = 154
+      Caption = 'n3'
+      ParentColor = False
+      ParentFont = False
+    end
+    object SpinEdit_N3: TFloatSpinEdit
+      Left = 941
+      Height = 40
+      Top = 117
+      Width = 142
+      DecimalPlaces = 3
+      Increment = 0.05
+      MaxValue = 1000000
+      MinValue = 0.1
+      OnChange = SpinEdit_N3Change
+      ParentFont = False
+      TabOrder = 5
+      Value = 1
+    end
+    object Label_SpikeOverlap: TLabel
+      Left = 17
+      Height = 40
+      Top = 165
+      Width = 189
+      Caption = 'Spike overlap'
+    end
+    object CheckBox_SpikeOverlap: TCheckBox
+      Left = 238
+      Height = 40
+      Top = 165
+      Width = 145
+      Checked = True
+      State = cbChecked
+      TabOrder = 9
+      OnChange = CheckBox_SpikeOverlapChange
+    end
+    object Label_A: TLabel
+      Left = 415
+      Height = 40
+      Top = 165
+      Width = 131
+      Caption = 'a'
+      ParentColor = False
+      ParentFont = False
+    end
+    object SpinEdit_A: TFloatSpinEdit
+      Left = 578
+      Height = 40
+      Top = 165
+      Width = 145
+      DecimalPlaces = 3
+      Increment = 0.05
+      MaxValue = 1000000
+      MinValue = 0.1
+      OnChange = SpinEdit_AChange
+      ParentFont = False
+      TabOrder = 0
+      Value = 1
+    end
+    object Label_B: TLabel
+      Left = 755
+      Height = 40
+      Top = 165
+      Width = 154
+      Caption = 'b'
+      ParentColor = False
+      ParentFont = False
+    end
+    object SpinEdit_B: TFloatSpinEdit
+      Left = 941
+      Height = 40
+      Top = 165
+      Width = 142
+      DecimalPlaces = 3
+      Increment = 0.05
+      MaxValue = 1000000
+      MinValue = 0.1
+      OnChange = SpinEdit_BChange
+      ParentFont = False
+      TabOrder = 1
+      Value = 1
+    end
+  end
+  object Panel_Buttons: TPanel
+    Left = 0
+    Height = 42
+    Top = 222
+    Width = 1100
+    Align = alTop
+    BevelOuter = bvNone
+    ChildSizing.HorizontalSpacing = 8
+    ChildSizing.Layout = cclLeftToRightThenTopToBottom
+    ChildSizing.ControlsPerLine = 2
+    ClientHeight = 42
+    ClientWidth = 1100
+    TabOrder = 1
+    object Button_OK: TButton
+      Left = 0
+      Height = 42
+      Top = 0
+      Width = 76
+      AutoSize = True
+      Caption = 'rsOK'
+      Default = True
+      Enabled = False
+      ModalResult = 1
+      TabOrder = 0
+      OnClick = Button_OKClick
+    end
+    object Button_Cancel: TButton
+      Left = 84
+      Height = 42
+      Top = 0
+      Width = 115
+      AutoSize = True
+      Cancel = True
+      Caption = 'rsCancel'
+      ModalResult = 2
+      TabOrder = 1
+      OnClick = Button_CancelClick
+    end
+  end
+  object TimerDisplay: TTimer
+    Enabled = False
+    Interval = 200
+    OnTimer = TimerDisplayTimer
+    Left = 456
+    Top = 208
+  end
+end

+ 17 - 0
lazpaint/dialog/filter/usuperformula.lrj

@@ -0,0 +1,17 @@
+{"version":1,"strings":[
+{"hash":180693153,"name":"tfsuperformula.caption","sourcebytes":[83,117,112,101,114,102,111,114,109,117,108,97],"value":"Superformula"},
+{"hash":6952354,"name":"tfsuperformula.label_pencolor.caption","sourcebytes":[80,101,110,32,99,111,108,111,114],"value":"Pen color"},
+{"hash":6159272,"name":"tfsuperformula.label_width.caption","sourcebytes":[87,105,100,116,104],"value":"Width"},
+{"hash":225371890,"name":"tfsuperformula.label_backcolor.caption","sourcebytes":[66,97,99,107,32,99,111,108,111,114],"value":"Back color"},
+{"hash":120855620,"name":"tfsuperformula.label_spikecount.caption","sourcebytes":[83,112,105,107,101,32,99,111,117,110,116],"value":"Spike count"},
+{"hash":145777148,"name":"tfsuperformula.label_rational.caption","sourcebytes":[82,97,116,105,111,110,97,108],"value":"Rational"},
+{"hash":368901,"name":"tfsuperformula.label_size.caption","sourcebytes":[83,105,122,101],"value":"Size"},
+{"hash":1809,"name":"tfsuperformula.label_n1.caption","sourcebytes":[110,49],"value":"n1"},
+{"hash":1810,"name":"tfsuperformula.label_n2.caption","sourcebytes":[110,50],"value":"n2"},
+{"hash":1811,"name":"tfsuperformula.label_n3.caption","sourcebytes":[110,51],"value":"n3"},
+{"hash":213689792,"name":"tfsuperformula.label_spikeoverlap.caption","sourcebytes":[83,112,105,107,101,32,111,118,101,114,108,97,112],"value":"Spike overlap"},
+{"hash":97,"name":"tfsuperformula.label_a.caption","sourcebytes":[97],"value":"a"},
+{"hash":98,"name":"tfsuperformula.label_b.caption","sourcebytes":[98],"value":"b"},
+{"hash":497723,"name":"tfsuperformula.button_ok.caption","sourcebytes":[114,115,79,75],"value":"rsOK"},
+{"hash":127421996,"name":"tfsuperformula.button_cancel.caption","sourcebytes":[114,115,67,97,110,99,101,108],"value":"rsCancel"}
+]}

+ 428 - 0
lazpaint/dialog/filter/usuperformula.pas

@@ -0,0 +1,428 @@
+unit USuperformula;
+
+{$mode ObjFPC}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls,
+  LazPaintType, LCSuperformulaOriginal, UScripting, Spin, UStateType;
+
+type
+  TFSuperformula = class(TForm)
+    Button_Cancel: TButton;
+    Button_OK: TButton;
+    ColorButton_BackColor: TColorButton;
+    ColorButton_PenColor: TColorButton;
+    CheckBox_MRational: TCheckBox;
+    CheckBox_SpikeOverlap: TCheckBox;
+    SpinEdit_Width: TFloatSpinEdit;
+    SpinEdit_Size: TFloatSpinEdit;
+    SpinEdit_A: TFloatSpinEdit;
+    SpinEdit_B: TFloatSpinEdit;
+    SpinEdit_M: TFloatSpinEdit;
+    SpinEdit_N1: TFloatSpinEdit;
+    SpinEdit_N2: TFloatSpinEdit;
+    SpinEdit_N3: TFloatSpinEdit;
+    Label_Rational: TLabel;
+    Label_SpikeOverlap: TLabel;
+    Label_BackColor: TLabel;
+    Label_PenColor: TLabel;
+    Label_Width: TLabel;
+    Label_Size: TLabel;
+    Label_A: TLabel;
+    Label_B: TLabel;
+    Label_SpikeCount: TLabel;
+    Label_N1: TLabel;
+    Label_N2: TLabel;
+    Label_N3: TLabel;
+    Panel_Buttons: TPanel;
+    Panel_Parameters: TPanel;
+    TimerDisplay: TTimer;
+    procedure Button_CancelClick(Sender: TObject);
+    procedure Button_OKClick(Sender: TObject);
+    procedure CheckBox_MRationalChange(Sender: TObject);
+    procedure CheckBox_SpikeOverlapChange(Sender: TObject);
+    procedure ColorButton_BackColorColorChanged(Sender: TObject);
+    procedure ColorButton_PenColorColorChanged(Sender: TObject);
+    procedure FormCreate(Sender: TObject);
+    procedure FormHide(Sender: TObject);
+    procedure FormShow(Sender: TObject);
+    procedure SpinEdit_AChange(Sender: TObject);
+    procedure SpinEdit_BChange(Sender: TObject);
+    procedure SpinEdit_N1Change(Sender: TObject);
+    procedure SpinEdit_N2Change(Sender: TObject);
+    procedure SpinEdit_N3Change(Sender: TObject);
+    procedure SpinEdit_SizeChange(Sender: TObject);
+    procedure SpinEdit_MChange(Sender: TObject);
+    procedure SpinEdit_WidthChange(Sender: TObject);
+    procedure TimerDisplayTimer(Sender: TObject);
+  private
+    FComposeShape: TComposedImageDifference;
+    FInitializing: boolean;
+    FInstance: TLazPaintCustomInstance;
+    FParameters: TVariableSet;
+    FPreviewDone: boolean;
+    FUpdateLayer: Boolean;
+    function GetCorrespondingOriginal: TSuperformulaOriginal;
+    procedure ExtractOriginalParameters(AOriginal: TSuperformulaOriginal; AParameters: TVariableSet);
+    procedure NeedPreview;
+    procedure UpdateOriginalParameters(AOriginal: TSuperformulaOriginal);
+
+  public
+    procedure DisplayShape;
+    procedure InitParams;
+  end;
+
+function ShowSuperformulaDlg(AInstance: TLazPaintCustomInstance; AParameters: TVariableSet): TScriptResult;
+
+implementation
+
+{$R *.lfm}
+
+uses UMac, LCScaleDPI, UResourceStrings, UImageAction, UImageDiff, BGRABitmapTypes, BGRATransform;
+
+function ShowSuperformulaDlg(AInstance: TLazPaintCustomInstance;
+  AParameters: TVariableSet): TScriptResult;
+var
+  FSuperformula: TFSuperformula;
+  doFound, somethingDone: boolean;
+begin
+  FSuperformula:= TFSuperformula.create(nil);
+  FSuperformula.FInstance := AInstance;
+  FSuperformula.FParameters := AParameters;
+  try
+    TImageActions(AInstance.ImageAction).Deselect;
+
+    if Assigned(AParameters) and
+      AParameters.Booleans['Validate'] then
+    begin
+      AInstance.Image.DoBegin;
+      FSuperformula.InitParams;
+      FSuperformula.DisplayShape;
+      AInstance.Image.DoEnd(doFound, somethingDone);
+      result := srOk;
+    end else
+    begin
+      if FSuperformula.showModal = mrOk then result := srOk
+      else result := srCancelledByUser;
+    end;
+  finally
+    FSuperformula.free;
+  end;
+end;
+
+{ TFSuperformula }
+
+procedure TFSuperformula.FormCreate(Sender: TObject);
+begin
+  ScaleControl(Self,OriginalDPI);
+
+  Button_OK.Caption := rsOK;
+  Button_Cancel.Caption := rsCancel;
+
+  CheckOKCancelBtns(Button_OK{,Button_Cancel});
+  CheckFloatSpinEdit(SpinEdit_Width);
+  CheckFloatSpinEdit(SpinEdit_M);
+  CheckFloatSpinEdit(SpinEdit_Size);
+  CheckFloatSpinEdit(SpinEdit_N1);
+  CheckFloatSpinEdit(SpinEdit_N2);
+  CheckFloatSpinEdit(SpinEdit_N3);
+  CheckFloatSpinEdit(SpinEdit_A);
+  CheckFloatSpinEdit(SpinEdit_B);
+
+  FPreviewDone := false;
+end;
+
+procedure TFSuperformula.FormHide(Sender: TObject);
+begin
+  if Assigned(FComposeShape) then
+  begin
+    If ModalResult <> mrOk then
+       FInstance.Image.Undo;
+    FComposeShape := nil;
+  end;
+end;
+
+procedure TFSuperformula.FormShow(Sender: TObject);
+begin
+  InitParams;
+  NeedPreview;
+end;
+
+procedure TFSuperformula.SpinEdit_AChange(Sender: TObject);
+begin
+  NeedPreview;
+end;
+
+procedure TFSuperformula.SpinEdit_BChange(Sender: TObject);
+begin
+  NeedPreview;
+end;
+
+procedure TFSuperformula.SpinEdit_N1Change(Sender: TObject);
+begin
+  NeedPreview;
+end;
+
+procedure TFSuperformula.SpinEdit_N2Change(Sender: TObject);
+begin
+  NeedPreview;
+end;
+
+procedure TFSuperformula.SpinEdit_N3Change(Sender: TObject);
+begin
+  NeedPreview;
+end;
+
+procedure TFSuperformula.SpinEdit_SizeChange(Sender: TObject);
+begin
+  NeedPreview;
+end;
+
+procedure TFSuperformula.SpinEdit_MChange(Sender: TObject);
+begin
+  NeedPreview;
+end;
+
+procedure TFSuperformula.SpinEdit_WidthChange(Sender: TObject);
+begin
+  NeedPreview;
+end;
+
+procedure TFSuperformula.TimerDisplayTimer(Sender: TObject);
+begin
+  TimerDisplay.Enabled:= false;
+  DisplayShape;
+end;
+
+procedure TFSuperformula.InitParams;
+var
+  original: TSuperformulaOriginal;
+  params: TVariableSet;
+begin
+  FInitializing := true;
+
+  // default parameters
+  if not Assigned(FParameters) then
+  begin
+    params := TVariableSet.Create('', FInstance.Config.DefaultSuperformulaParameters);
+  end else
+    params := FParameters.Duplicate;
+
+  // parameters from current layer
+  original := GetCorrespondingOriginal;
+  if Assigned(original) then
+  begin
+    ExtractOriginalParameters(original, params);
+    FUpdateLayer:= true;
+  end
+  else
+    FUpdateLayer:= false;
+
+  // apply parameters
+  if params.IsDefined('PenColor') then
+     ColorButton_PenColor.ButtonColor := params.Pixels['PenColor'].ToColor;
+  if params.IsDefined('LineWidth') then
+     SpinEdit_Width.Value := params.Floats['LineWidth'] * 10;
+  if params.IsDefined('BackColor') then
+     ColorButton_BackColor.ButtonColor := params.Pixels['BackColor'].ToColor;
+
+  if params.IsDefined('M') then
+     SpinEdit_M.Value := params.Floats['M'];
+  if params.IsDefined('MRational') then
+     CheckBox_MRational.Checked := params.Booleans['MRational'];
+  if params.IsDefined('Size') then
+     SpinEdit_Size.Value := params.Floats['Size'];
+
+  if params.IsDefined('N1') then
+     SpinEdit_N1.Value := params.Floats['N1'];
+  if params.IsDefined('N2') then
+     SpinEdit_N2.Value := params.Floats['N2'];
+  if params.IsDefined('N3') then
+     SpinEdit_N3.Value := params.Floats['N3'];
+
+  if params.IsDefined('SpikeOverlap') then
+     CheckBox_SpikeOverlap.Checked := params.Booleans['SpikeOverlap'];
+  if params.IsDefined('A') then
+     SpinEdit_A.Value := params.Floats['A'];
+  if params.IsDefined('B') then
+     SpinEdit_B.Value := params.Floats['B'];
+
+  params.Free;
+  FInitializing := false;
+end;
+
+procedure TFSuperformula.NeedPreview;
+begin
+  TimerDisplay.Enabled := false;
+  TimerDisplay.Enabled := true;
+  FPreviewDone := false;
+  Button_OK.Enabled := false;
+end;
+
+procedure TFSuperformula.UpdateOriginalParameters(
+  AOriginal: TSuperformulaOriginal);
+begin
+  AOriginal.PenColor := ColorToBGRA(ColorButton_PenColor.ButtonColor);
+  AOriginal.LineWidth := SpinEdit_Width.Value / 10;
+  AOriginal.BackColor := ColorToBGRA(ColorButton_BackColor.ButtonColor);
+
+  AOriginal.N1 := SpinEdit_N1.Value;
+  AOriginal.N2 := SpinEdit_N2.Value;
+  AOriginal.N3 := SpinEdit_N3.Value;
+
+  AOriginal.SpikeOverlap:= CheckBox_SpikeOverlap.Checked;
+  AOriginal.A := SpinEdit_A.Value;
+  AOriginal.B := SpinEdit_B.Value;
+
+  AOriginal.M := SpinEdit_M.Value;
+  AOriginal.mRational:= CheckBox_MRational.Checked;
+  // size is the last value to set, because it is computed accoridng to other parameters
+  AOriginal.Size:= SpinEdit_Size.Value;
+end;
+
+procedure TFSuperformula.DisplayShape;
+var
+  original: TSuperformulaOriginal;
+  curIndex: Integer;
+begin
+  FPreviewDone := true;
+
+  // cancel the preview
+  if Assigned(FComposeShape) then
+  begin
+    FInstance.Image.Undo;
+    FComposeShape := nil;
+  end;
+
+  // make a new preview
+  FComposeShape := FInstance.Image.DoBegin;
+  try
+    // if there is already a corresponding layer
+    if FUpdateLayer then
+    begin
+      original := GetCorrespondingOriginal;
+      if Assigned(original) then
+      begin
+        // record changes made inside the original
+        FInstance.Image.CurrentState.DiscardOriginalDiff:= false;
+        UpdateOriginalParameters(original);
+        FInstance.Image.CurrentState.DiscardOriginalDiff:= true;
+      end;
+    end else
+    begin
+      // create a new layer
+      original := TSuperformulaOriginal.Create;
+      UpdateOriginalParameters(original);
+
+      // if current layer is empty, replace it
+      if FInstance.Image.CurrentLayerEmpty then
+      begin
+        curIndex := FInstance.Image.CurrentLayerIndex;
+        FInstance.Image.AddUndo(
+          TReplaceLayerByCustomOriginalDifference.Create(FInstance.Image.CurrentState,
+            FInstance.Image.CurrentLayerIndex, true, original));
+        FInstance.Image.ImageMayChangeCompletely;
+        FInstance.Image.LayerOriginalMatrix[curIndex] :=
+          AffineMatrixTranslation(FInstance.Image.Width/2, FInstance.Image.Height/2);
+        FInstance.Image.LayerName[curIndex] := Caption;
+      end
+      else
+      begin
+        // otherwise add the new layer
+        FInstance.Image.AddNewLayer(original, Caption, boTransparent,
+          AffineMatrixTranslation(FInstance.Image.Width/2, FInstance.Image.Height/2));
+        curIndex := FInstance.Image.CurrentLayerIndex;
+      end;
+    end;
+
+    Button_OK.Enabled := true;
+  finally
+    FInstance.Image.DoEnd(FComposeShape);
+  end;
+end;
+
+function TFSuperformula.GetCorrespondingOriginal: TSuperformulaOriginal;
+var
+  curIndex: Integer;
+begin
+  curIndex := FInstance.Image.CurrentLayerIndex;
+  if FInstance.Image.LayerOriginalClass[curIndex] = TSuperformulaOriginal then
+    result := TSuperformulaOriginal(FInstance.Image.LayerOriginal[curIndex])
+  else
+    result := nil;
+end;
+
+procedure TFSuperformula.ExtractOriginalParameters(
+  AOriginal: TSuperformulaOriginal; AParameters: TVariableSet);
+begin
+  AParameters.AddPixel('PenColor', AOriginal.PenColor);
+  AParameters.AddFloat('LineWidth', AOriginal.LineWidth);
+  AParameters.AddPixel('BackColor', AOriginal.BackColor);
+
+  AParameters.AddFloat('M', AOriginal.m);
+  AParameters.AddBoolean('MRational', AOriginal.mRational);
+  AParameters.AddFloat('Size', AOriginal.Size);
+
+  AParameters.AddFloat('N1', AOriginal.n1);
+  AParameters.AddFloat('N2', AOriginal.n2);
+  AParameters.AddFloat('N3', AOriginal.n3);
+
+  AParameters.AddBoolean('SpikeOverlap', AOriginal.SpikeOverlap);
+  AParameters.AddFloat('A', AOriginal.a);
+  AParameters.AddFloat('B', AOriginal.b);
+end;
+
+procedure TFSuperformula.Button_OKClick(Sender: TObject);
+var
+  original: TSuperformulaOriginal;
+  params: TVariableSet;
+begin
+  TimerDisplay.Enabled := false;
+  if not FPreviewDone then DisplayShape;
+  original := GetCorrespondingOriginal;
+  if Assigned(original) then
+  begin
+    params := TVariableSet.Create('', '');
+    try
+      ExtractOriginalParameters(original, params);
+      FInstance.Config.SetDefaultSuperformulaParameters(params.VariablesAsString);
+    finally
+      params.Free;
+    end;
+  end
+end;
+
+procedure TFSuperformula.CheckBox_MRationalChange(Sender: TObject);
+begin
+  NeedPreview;
+end;
+
+procedure TFSuperformula.CheckBox_SpikeOverlapChange(Sender: TObject);
+begin
+  NeedPreview;
+end;
+
+procedure TFSuperformula.ColorButton_BackColorColorChanged(Sender: TObject);
+begin
+  NeedPreview;
+end;
+
+procedure TFSuperformula.ColorButton_PenColorColorChanged(Sender: TObject);
+begin
+  NeedPreview;
+end;
+
+procedure TFSuperformula.Button_CancelClick(Sender: TObject);
+begin
+  TimerDisplay.Enabled := false;
+  if Assigned(FComposeShape) then
+  begin
+    FInstance.Image.Undo;
+    FComposeShape := nil;
+  end;
+end;
+
+end.
+

+ 3 - 2
lazpaint/image/uimagediff.pas

@@ -556,7 +556,7 @@ implementation
 
 uses BGRAWriteLzp, BGRAReadLzp, BGRAStreamLayers, BGRALzpCommon, ugraph, Types,
   BGRATransform, zstream, LCVectorRectShapes, BGRAPen, LCVectorialFill,
-  BGRAGradientOriginal;
+  BGRAGradientOriginal, LCSuperformulaOriginal;
 
 function IsInverseImageDiff(ADiff1, ADiff2: TCustomImageDifference): boolean;
 begin
@@ -2673,7 +2673,8 @@ begin
     self.duplicateId := LayeredBitmap.ProduceLayerUniqueId;
     self.duplicateOriginal := useOriginal and
       ((LayeredBitmap.LayerOriginalClass[SelectedImageLayerIndex]=TVectorOriginal) or
-       (LayeredBitmap.LayerOriginalClass[SelectedImageLayerIndex]=TBGRALayerGradientOriginal));
+       (LayeredBitmap.LayerOriginalClass[SelectedImageLayerIndex]=TBGRALayerGradientOriginal) or
+       (LayeredBitmap.LayerOriginalClass[SelectedImageLayerIndex]=TSuperformulaOriginal));
     if self.duplicateOriginal then
       CreateGUID(duplicateGuid);
   end;

+ 9 - 1
lazpaint/lazpaint.lpi

@@ -434,7 +434,7 @@
         <PackageName Value="LCL"/>
       </Item5>
     </RequiredPackages>
-    <Units Count="108">
+    <Units Count="109">
       <Unit0>
         <Filename Value="lazpaint.lpr"/>
         <IsPartOfProject Value="True"/>
@@ -1068,6 +1068,14 @@
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
       </Unit107>
+      <Unit108>
+        <Filename Value="dialog\filter\usuperformula.pas"/>
+        <IsPartOfProject Value="True"/>
+        <ComponentName Value="FSuperformula"/>
+        <HasResources Value="True"/>
+        <ResourceBaseClass Value="Form"/>
+        <UnitName Value="USuperformula"/>
+      </Unit108>
     </Units>
   </ProjectOptions>
   <CompilerOptions>

+ 1 - 1
lazpaint/lazpaint.lpr

@@ -40,7 +40,7 @@ uses
   URainType, UFormRain, UPaletteToolbar, uselectionhighlight,
   UImagePreview, UPreviewDialog, UQuestion, UTiff, UImageView,
   UDarkTheme, URaw, UProcessAuto, UPython, UImageBackup, ULayerStackInterface,
-  UChooseColorInterface, UIconCache, uhypocycloid;
+  UChooseColorInterface, UIconCache, uhypocycloid, USuperformula;
 
 //sometimes LResources disappear in the uses clause
 

+ 12 - 0
lazpaint/lazpaintdialogs.inc

@@ -593,4 +593,16 @@ begin
   self.ShowTopmost(top);
 end;
 
+function TLazPaintInstance.ShowSuperformulaDlg(AInstance: TLazPaintCustomInstance; AParameters: TVariableSet): TScriptResult;
+var oldSelectionNormal: boolean;
+    top: TTopMostInfo;
+begin
+  top := self.HideTopmost;
+  oldSelectionNormal := ShowSelectionNormal;
+  ShowSelectionNormal := true;
+  result := USuperformula.ShowSuperformulaDlg(AInstance, AParameters);
+  ShowSelectionNormal := oldSelectionNormal;
+  self.ShowTopmost(top);
+end;
+
 

+ 2 - 1
lazpaint/lazpaintinstance.pas

@@ -263,6 +263,7 @@ type
     function ShowSharpenDlg(AFilterConnector: TObject): TScriptResult; override;
     function ShowPosterizeDlg(AParameters: TVariableSet): TScriptResult; override;
     function ShowHypocycloidDlg(AInstance: TLazPaintCustomInstance; AParameters: TVariableSet): TScriptResult; override;
+    function ShowSuperformulaDlg(AInstance: TLazPaintCustomInstance; AParameters: TVariableSet): TScriptResult; override;
     procedure ShowPrintDlg; override;
     function HideTopmost: TTopMostInfo; override;
     procedure ShowTopmost(AInfo: TTopMostInfo); override;
@@ -304,7 +305,7 @@ uses Types, Dialogs, FileUtil, StdCtrls, LCLIntf, BGRAUTF8, UTranslation,
 
      URadialBlur, UMotionBlur, UEmboss, UTwirl, UWaveDisplacement,
      unewimage, uresample, UPixelate, unoisefilter, ufilters,
-     USharpen, uposterize, uhypocycloid, UPhongFilter, UFilterFunction,
+     USharpen, uposterize, uhypocycloid, USuperformula, UPhongFilter, UFilterFunction,
      uprint, USaveOption, UFormRain,
      {$IFDEF DARWIN}Graphics, BGRAGraphics,{$ENDIF}
 

+ 5 - 0
lazpaint/lazpaintmainform.lfm

@@ -5641,6 +5641,11 @@ object FMain: TFMain
       Caption = 'Hypocycloid...'
       OnExecute = RenderAnyExecute
     end
+    object RenderSuperformula: TAction
+      Category = 'Render'
+      Caption = 'SuperFormula...'
+      OnExecute = RenderAnyExecute
+    end
   end
   object ColorDialog1: TColorDialog
     Title = 'Choose color'

+ 1 - 0
lazpaint/lazpaintmainform.pas

@@ -26,6 +26,7 @@ type
 
   TFMain = class(TForm)
     RenderHypocycloid: TAction;
+    RenderSuperformula: TAction;
     FileQuickSave: TAction;
     SVGRasterImageList1: TBGRAImageList;
     Panel_TextMore: TPanel;

+ 4 - 3
lazpaint/lazpainttype.pas

@@ -74,7 +74,7 @@ type
                     pfSphere, pfTwirl, pfWaveDisplacement, pfCylinder, pfPlane,
                     pfPerlinNoise,pfCyclicPerlinNoise,pfClouds,pfCustomWater,pfWater,pfRain,pfWood,pfWoodVertical,pfPlastik,pfMetalFloor,pfCamouflage,
                     pfSnowPrint,pfStone,pfRoundStone,pfMarble,
-                    pfHypocycloid);
+                    pfHypocycloid, pfSuperformula);
 
 const
   PictureFilterStr : array[TPictureFilter] of string =
@@ -85,7 +85,7 @@ const
                     'Sphere', 'Twirl', 'WaveDisplacement', 'Cylinder', 'Plane',
                     'PerlinNoise','CyclicPerlinNoise','Clouds','CustomWater','Water','Rain','Wood','WoodVertical','Plastik','MetalFloor','Camouflage',
                     'SnowPrint','Stone','RoundStone','Marble',
-                    'Hypocycloid');
+                    'Hypocycloid', 'Superformula');
 
   IsColoredFilter: array[TPictureFilter] of boolean =
                    (false,
@@ -95,7 +95,7 @@ const
                     false, false, false, false, false,
                     false,false,true,true,true,true,true,true,true,true,true,
                     true,true,true,true,
-                    true);
+                    true, true);
 
 const
   MinZoomForGrid = 4;
@@ -295,6 +295,7 @@ type
     function ShowSharpenDlg(AFilterConnector: TObject): TScriptResult; virtual; abstract;
     function ShowPosterizeDlg(AParameters: TVariableSet): TScriptResult; virtual; abstract;
     function ShowHypocycloidDlg(AInstance: TLazPaintCustomInstance; AParameters: TVariableSet): TScriptResult; virtual; abstract;
+    function ShowSuperformulaDlg(AInstance: TLazPaintCustomInstance; AParameters: TVariableSet): TScriptResult; virtual; abstract;
     procedure ShowPrintDlg; virtual; abstract;
     function OpenImage (FileName: string; AddToRecent: Boolean= True): boolean; virtual; abstract;
     procedure AddToImageList(const FileNames: array of String); virtual; abstract;

+ 63 - 0
lazpaint/release/bin/i18n/lazpaint.ar.po

@@ -2301,6 +2301,7 @@ msgid "Saturation"
 msgstr "التشبيع"
 
 #: tfphongfilter.radio_usebackcolor.caption
+msgctxt "tfphongfilter.radio_usebackcolor.caption"
 msgid "Back color"
 msgstr "لون الخلفية"
 
@@ -2309,6 +2310,7 @@ msgid "Keep"
 msgstr "احتفظ"
 
 #: tfphongfilter.radio_usepencolor.caption
+msgctxt "tfphongfilter.radio_usepencolor.caption"
 msgid "Pen color"
 msgstr "لون القلم"
 
@@ -2597,6 +2599,66 @@ msgctxt "TFSHIFTCOLORS.LABEL2.CAPTION"
 msgid "Saturation"
 msgstr "التشبيع"
 
+#: tfsuperformula.caption
+msgid "Superformula"
+msgstr ""
+
+#: tfsuperformula.label_a.caption
+msgid "a"
+msgstr ""
+
+#: tfsuperformula.label_b.caption
+msgid "b"
+msgstr ""
+
+#: tfsuperformula.label_backcolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_backcolor.caption"
+msgid "Back color"
+msgstr "لون الخلفية"
+
+#: tfsuperformula.label_n1.caption
+msgid "n1"
+msgstr ""
+
+#: tfsuperformula.label_n2.caption
+msgid "n2"
+msgstr ""
+
+#: tfsuperformula.label_n3.caption
+msgid "n3"
+msgstr ""
+
+#: tfsuperformula.label_pencolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_pencolor.caption"
+msgid "Pen color"
+msgstr "لون القلم"
+
+#: tfsuperformula.label_rational.caption
+msgid "Rational"
+msgstr "رقم منطقي"
+
+#: tfsuperformula.label_size.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_size.caption"
+msgid "Size"
+msgstr "حجم"
+
+#: tfsuperformula.label_spikecount.caption
+msgid "Spike count"
+msgstr "عدد ارتفاع"
+
+#: tfsuperformula.label_spikeoverlap.caption
+msgid "Spike overlap"
+msgstr "تداخل سبايك"
+
+#: tfsuperformula.label_width.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_width.caption"
+msgid "Width"
+msgstr "عرض"
+
 #: tftoolbox.caption
 msgctxt "tftoolbox.caption"
 msgid "Tools"
@@ -2964,6 +3026,7 @@ msgid "File not saved"
 msgstr "الملف لم يحفظ"
 
 #: uresourcestrings.rsfilesize
+msgctxt "uresourcestrings.rsfilesize"
 msgid "Size"
 msgstr "حجم"
 

+ 63 - 0
lazpaint/release/bin/i18n/lazpaint.bg.po

@@ -2288,6 +2288,7 @@ msgid "Saturation"
 msgstr "Насищане"
 
 #: tfphongfilter.radio_usebackcolor.caption
+msgctxt "tfphongfilter.radio_usebackcolor.caption"
 msgid "Back color"
 msgstr "Подцветка"
 
@@ -2296,6 +2297,7 @@ msgid "Keep"
 msgstr "Запазване"
 
 #: tfphongfilter.radio_usepencolor.caption
+msgctxt "tfphongfilter.radio_usepencolor.caption"
 msgid "Pen color"
 msgstr "Цвят на молива"
 
@@ -2585,6 +2587,66 @@ msgctxt "TFSHIFTCOLORS.LABEL2.CAPTION"
 msgid "Saturation"
 msgstr "Насищане"
 
+#: tfsuperformula.caption
+msgid "Superformula"
+msgstr "Суперформула"
+
+#: tfsuperformula.label_a.caption
+msgid "a"
+msgstr ""
+
+#: tfsuperformula.label_b.caption
+msgid "b"
+msgstr ""
+
+#: tfsuperformula.label_backcolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_backcolor.caption"
+msgid "Back color"
+msgstr "Подцветка"
+
+#: tfsuperformula.label_n1.caption
+msgid "n1"
+msgstr ""
+
+#: tfsuperformula.label_n2.caption
+msgid "n2"
+msgstr ""
+
+#: tfsuperformula.label_n3.caption
+msgid "n3"
+msgstr ""
+
+#: tfsuperformula.label_pencolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_pencolor.caption"
+msgid "Pen color"
+msgstr "Цвят на молива"
+
+#: tfsuperformula.label_rational.caption
+msgid "Rational"
+msgstr "Рационално"
+
+#: tfsuperformula.label_size.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_size.caption"
+msgid "Size"
+msgstr "Размер"
+
+#: tfsuperformula.label_spikecount.caption
+msgid "Spike count"
+msgstr "Брой шипове"
+
+#: tfsuperformula.label_spikeoverlap.caption
+msgid "Spike overlap"
+msgstr "Припокриване на шипове"
+
+#: tfsuperformula.label_width.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_width.caption"
+msgid "Width"
+msgstr "Ширина"
+
 #: tftoolbox.caption
 msgctxt "TFTOOLBOX.CAPTION"
 msgid "Tools"
@@ -2950,6 +3012,7 @@ msgid "File not saved"
 msgstr "Файлът не е съхранен"
 
 #: uresourcestrings.rsfilesize
+msgctxt "uresourcestrings.rsfilesize"
 msgid "Size"
 msgstr "Размер"
 

+ 63 - 0
lazpaint/release/bin/i18n/lazpaint.cs.po

@@ -2153,6 +2153,7 @@ msgid "Saturation"
 msgstr "Barevnost"
 
 #: tfphongfilter.radio_usebackcolor.caption
+msgctxt "tfphongfilter.radio_usebackcolor.caption"
 msgid "Back color"
 msgstr "Barva pozadí"
 
@@ -2161,6 +2162,7 @@ msgid "Keep"
 msgstr "Ponechat"
 
 #: tfphongfilter.radio_usepencolor.caption
+msgctxt "tfphongfilter.radio_usepencolor.caption"
 msgid "Pen color"
 msgstr "Barva pera"
 
@@ -2443,6 +2445,66 @@ msgctxt "tfshiftcolors.label2.caption"
 msgid "Saturation"
 msgstr "Barevnost"
 
+#: tfsuperformula.caption
+msgid "Superformula"
+msgstr "Superformule"
+
+#: tfsuperformula.label_a.caption
+msgid "a"
+msgstr ""
+
+#: tfsuperformula.label_b.caption
+msgid "b"
+msgstr ""
+
+#: tfsuperformula.label_backcolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_backcolor.caption"
+msgid "Back color"
+msgstr "Barva pozadí"
+
+#: tfsuperformula.label_n1.caption
+msgid "n1"
+msgstr ""
+
+#: tfsuperformula.label_n2.caption
+msgid "n2"
+msgstr ""
+
+#: tfsuperformula.label_n3.caption
+msgid "n3"
+msgstr ""
+
+#: tfsuperformula.label_pencolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_pencolor.caption"
+msgid "Pen color"
+msgstr "Barva pera"
+
+#: tfsuperformula.label_rational.caption
+msgid "Rational"
+msgstr "Racionální"
+
+#: tfsuperformula.label_size.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_size.caption"
+msgid "Size"
+msgstr "Velikost"
+
+#: tfsuperformula.label_spikecount.caption
+msgid "Spike count"
+msgstr "Spike počítat"
+
+#: tfsuperformula.label_spikeoverlap.caption
+msgid "Spike overlap"
+msgstr "Překrytí hrotů"
+
+#: tfsuperformula.label_width.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_width.caption"
+msgid "Width"
+msgstr "Šířka"
+
 #: tftoolbox.caption
 msgctxt "tftoolbox.caption"
 msgid "Tools"
@@ -2804,6 +2866,7 @@ msgid "File not saved"
 msgstr "Neuložený soubor"
 
 #: uresourcestrings.rsfilesize
+msgctxt "uresourcestrings.rsfilesize"
 msgid "Size"
 msgstr "Velikost"
 

+ 63 - 0
lazpaint/release/bin/i18n/lazpaint.de.po

@@ -2312,6 +2312,7 @@ msgid "Saturation"
 msgstr "Sättigung"
 
 #: tfphongfilter.radio_usebackcolor.caption
+msgctxt "tfphongfilter.radio_usebackcolor.caption"
 msgid "Back color"
 msgstr "Hintergrundfarbe"
 
@@ -2320,6 +2321,7 @@ msgid "Keep"
 msgstr "Behalten"
 
 #: tfphongfilter.radio_usepencolor.caption
+msgctxt "tfphongfilter.radio_usepencolor.caption"
 msgid "Pen color"
 msgstr "Stiftfarbe"
 
@@ -2608,6 +2610,66 @@ msgctxt "TFSHIFTCOLORS.LABEL2.CAPTION"
 msgid "Saturation"
 msgstr "Sättigung"
 
+#: tfsuperformula.caption
+msgid "Superformula"
+msgstr "Superformel"
+
+#: tfsuperformula.label_a.caption
+msgid "a"
+msgstr ""
+
+#: tfsuperformula.label_b.caption
+msgid "b"
+msgstr ""
+
+#: tfsuperformula.label_backcolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_backcolor.caption"
+msgid "Back color"
+msgstr "Hintergrundfarbe"
+
+#: tfsuperformula.label_n1.caption
+msgid "n1"
+msgstr ""
+
+#: tfsuperformula.label_n2.caption
+msgid "n2"
+msgstr ""
+
+#: tfsuperformula.label_n3.caption
+msgid "n3"
+msgstr ""
+
+#: tfsuperformula.label_pencolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_pencolor.caption"
+msgid "Pen color"
+msgstr "Stiftfarbe"
+
+#: tfsuperformula.label_rational.caption
+msgid "Rational"
+msgstr "Rational"
+
+#: tfsuperformula.label_size.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_size.caption"
+msgid "Size"
+msgstr "Größe"
+
+#: tfsuperformula.label_spikecount.caption
+msgid "Spike count"
+msgstr "Spike-Zählung"
+
+#: tfsuperformula.label_spikeoverlap.caption
+msgid "Spike overlap"
+msgstr "Spike-Überlappung"
+
+#: tfsuperformula.label_width.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_width.caption"
+msgid "Width"
+msgstr "Breite"
+
 #: tftoolbox.caption
 msgctxt "tftoolbox.caption"
 msgid "Tools"
@@ -2975,6 +3037,7 @@ msgid "File not saved"
 msgstr "Datei nicht gespeichert"
 
 #: uresourcestrings.rsfilesize
+msgctxt "uresourcestrings.rsfilesize"
 msgid "Size"
 msgstr "Größe"
 

+ 63 - 0
lazpaint/release/bin/i18n/lazpaint.es.po

@@ -2294,6 +2294,7 @@ msgid "Saturation"
 msgstr "Saturación"
 
 #: tfphongfilter.radio_usebackcolor.caption
+msgctxt "tfphongfilter.radio_usebackcolor.caption"
 msgid "Back color"
 msgstr "Color de fondo"
 
@@ -2302,6 +2303,7 @@ msgid "Keep"
 msgstr "Mantener"
 
 #: tfphongfilter.radio_usepencolor.caption
+msgctxt "tfphongfilter.radio_usepencolor.caption"
 msgid "Pen color"
 msgstr "Color de pluma"
 
@@ -2590,6 +2592,66 @@ msgctxt "TFSHIFTCOLORS.LABEL2.CAPTION"
 msgid "Saturation"
 msgstr "Saturación"
 
+#: tfsuperformula.caption
+msgid "Superformula"
+msgstr "Superfórmula"
+
+#: tfsuperformula.label_a.caption
+msgid "a"
+msgstr ""
+
+#: tfsuperformula.label_b.caption
+msgid "b"
+msgstr ""
+
+#: tfsuperformula.label_backcolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_backcolor.caption"
+msgid "Back color"
+msgstr "Color de fondo"
+
+#: tfsuperformula.label_n1.caption
+msgid "n1"
+msgstr ""
+
+#: tfsuperformula.label_n2.caption
+msgid "n2"
+msgstr ""
+
+#: tfsuperformula.label_n3.caption
+msgid "n3"
+msgstr ""
+
+#: tfsuperformula.label_pencolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_pencolor.caption"
+msgid "Pen color"
+msgstr "Color de pluma"
+
+#: tfsuperformula.label_rational.caption
+msgid "Rational"
+msgstr "Racional"
+
+#: tfsuperformula.label_size.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_size.caption"
+msgid "Size"
+msgstr "Tamaño"
+
+#: tfsuperformula.label_spikecount.caption
+msgid "Spike count"
+msgstr "Recuento de picos"
+
+#: tfsuperformula.label_spikeoverlap.caption
+msgid "Spike overlap"
+msgstr "Superposición de picos"
+
+#: tfsuperformula.label_width.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_width.caption"
+msgid "Width"
+msgstr "Ancho"
+
 #: tftoolbox.caption
 msgctxt "tftoolbox.caption"
 msgid "Tools"
@@ -2963,6 +3025,7 @@ msgid "File not saved"
 msgstr "Fichero no guardado"
 
 #: uresourcestrings.rsfilesize
+msgctxt "uresourcestrings.rsfilesize"
 msgid "Size"
 msgstr "Tamaño"
 

+ 63 - 0
lazpaint/release/bin/i18n/lazpaint.fi.po

@@ -2293,6 +2293,7 @@ msgid "Saturation"
 msgstr "Kylläisyys"
 
 #: tfphongfilter.radio_usebackcolor.caption
+msgctxt "tfphongfilter.radio_usebackcolor.caption"
 msgid "Back color"
 msgstr "Taustan väri"
 
@@ -2301,6 +2302,7 @@ msgid "Keep"
 msgstr "Säilytä värit"
 
 #: tfphongfilter.radio_usepencolor.caption
+msgctxt "tfphongfilter.radio_usepencolor.caption"
 msgid "Pen color"
 msgstr "Kynän väri"
 
@@ -2590,6 +2592,66 @@ msgctxt "TFSHIFTCOLORS.LABEL2.CAPTION"
 msgid "Saturation"
 msgstr "Kylläisyys"
 
+#: tfsuperformula.caption
+msgid "Superformula"
+msgstr "Superkaava"
+
+#: tfsuperformula.label_a.caption
+msgid "a"
+msgstr ""
+
+#: tfsuperformula.label_b.caption
+msgid "b"
+msgstr ""
+
+#: tfsuperformula.label_backcolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_backcolor.caption"
+msgid "Back color"
+msgstr "Taustan väri"
+
+#: tfsuperformula.label_n1.caption
+msgid "n1"
+msgstr ""
+
+#: tfsuperformula.label_n2.caption
+msgid "n2"
+msgstr ""
+
+#: tfsuperformula.label_n3.caption
+msgid "n3"
+msgstr ""
+
+#: tfsuperformula.label_pencolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_pencolor.caption"
+msgid "Pen color"
+msgstr "Kynän väri"
+
+#: tfsuperformula.label_rational.caption
+msgid "Rational"
+msgstr "Rationaalinen"
+
+#: tfsuperformula.label_size.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_size.caption"
+msgid "Size"
+msgstr "Koko"
+
+#: tfsuperformula.label_spikecount.caption
+msgid "Spike count"
+msgstr "Piikkien määrä"
+
+#: tfsuperformula.label_spikeoverlap.caption
+msgid "Spike overlap"
+msgstr "Piikkien päällekkäisyys"
+
+#: tfsuperformula.label_width.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_width.caption"
+msgid "Width"
+msgstr "Leveys"
+
 #: tftoolbox.caption
 msgctxt "TFTOOLBOX.CAPTION"
 msgid "Tools"
@@ -2956,6 +3018,7 @@ msgid "File not saved"
 msgstr "Tiedostoa ei tallennettu"
 
 #: uresourcestrings.rsfilesize
+msgctxt "uresourcestrings.rsfilesize"
 msgid "Size"
 msgstr "Koko"
 

+ 63 - 0
lazpaint/release/bin/i18n/lazpaint.fr.po

@@ -2307,6 +2307,7 @@ msgid "Saturation"
 msgstr "Saturation"
 
 #: tfphongfilter.radio_usebackcolor.caption
+msgctxt "tfphongfilter.radio_usebackcolor.caption"
 msgid "Back color"
 msgstr "Couleur de fond"
 
@@ -2315,6 +2316,7 @@ msgid "Keep"
 msgstr "Conserver"
 
 #: tfphongfilter.radio_usepencolor.caption
+msgctxt "tfphongfilter.radio_usepencolor.caption"
 msgid "Pen color"
 msgstr "Couleur de crayon"
 
@@ -2603,6 +2605,66 @@ msgctxt "TFSHIFTCOLORS.LABEL2.CAPTION"
 msgid "Saturation"
 msgstr "Saturation"
 
+#: tfsuperformula.caption
+msgid "Superformula"
+msgstr "Superformule"
+
+#: tfsuperformula.label_a.caption
+msgid "a"
+msgstr ""
+
+#: tfsuperformula.label_b.caption
+msgid "b"
+msgstr ""
+
+#: tfsuperformula.label_backcolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_backcolor.caption"
+msgid "Back color"
+msgstr "Couleur de fond"
+
+#: tfsuperformula.label_n1.caption
+msgid "n1"
+msgstr ""
+
+#: tfsuperformula.label_n2.caption
+msgid "n2"
+msgstr ""
+
+#: tfsuperformula.label_n3.caption
+msgid "n3"
+msgstr ""
+
+#: tfsuperformula.label_pencolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_pencolor.caption"
+msgid "Pen color"
+msgstr "Couleur de crayon"
+
+#: tfsuperformula.label_rational.caption
+msgid "Rational"
+msgstr "Rationnel"
+
+#: tfsuperformula.label_size.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_size.caption"
+msgid "Size"
+msgstr "Taille"
+
+#: tfsuperformula.label_spikecount.caption
+msgid "Spike count"
+msgstr "Nombre de pics"
+
+#: tfsuperformula.label_spikeoverlap.caption
+msgid "Spike overlap"
+msgstr "Superposition des pics"
+
+#: tfsuperformula.label_width.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_width.caption"
+msgid "Width"
+msgstr "Largeur"
+
 #: tftoolbox.caption
 msgctxt "tftoolbox.caption"
 msgid "Tools"
@@ -2978,6 +3040,7 @@ msgid "File not saved"
 msgstr "Fichier non enregistré"
 
 #: uresourcestrings.rsfilesize
+msgctxt "uresourcestrings.rsfilesize"
 msgid "Size"
 msgstr "Taille"
 

+ 62 - 1
lazpaint/release/bin/i18n/lazpaint.it.po

@@ -2290,6 +2290,7 @@ msgid "Saturation"
 msgstr "Saturazione"
 
 #: tfphongfilter.radio_usebackcolor.caption
+msgctxt "tfphongfilter.radio_usebackcolor.caption"
 msgid "Back color"
 msgstr ""
 
@@ -2298,6 +2299,7 @@ msgid "Keep"
 msgstr "Acquisisci"
 
 #: tfphongfilter.radio_usepencolor.caption
+msgctxt "tfphongfilter.radio_usepencolor.caption"
 msgid "Pen color"
 msgstr "Colore della penna"
 
@@ -2587,6 +2589,64 @@ msgctxt "TFSHIFTCOLORS.LABEL2.CAPTION"
 msgid "Saturation"
 msgstr "Saturazione"
 
+#: tfsuperformula.caption
+msgid "Superformula"
+msgstr "Superformula"
+
+#: tfsuperformula.label_a.caption
+msgid "a"
+msgstr ""
+
+#: tfsuperformula.label_b.caption
+msgid "b"
+msgstr ""
+
+#: tfsuperformula.label_backcolor.caption
+msgctxt "tfsuperformula.label_backcolor.caption"
+msgid "Back color"
+msgstr ""
+
+#: tfsuperformula.label_n1.caption
+msgid "n1"
+msgstr ""
+
+#: tfsuperformula.label_n2.caption
+msgid "n2"
+msgstr ""
+
+#: tfsuperformula.label_n3.caption
+msgid "n3"
+msgstr ""
+
+#: tfsuperformula.label_pencolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_pencolor.caption"
+msgid "Pen color"
+msgstr "Colore della penna"
+
+#: tfsuperformula.label_rational.caption
+msgid "Rational"
+msgstr "Razionale"
+
+#: tfsuperformula.label_size.caption
+msgctxt "tfsuperformula.label_size.caption"
+msgid "Size"
+msgstr "Dimensione"
+
+#: tfsuperformula.label_spikecount.caption
+msgid "Spike count"
+msgstr "Conteggio dei picchi"
+
+#: tfsuperformula.label_spikeoverlap.caption
+msgid "Spike overlap"
+msgstr "Sovrapposizione dei picchi"
+
+#: tfsuperformula.label_width.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_width.caption"
+msgid "Width"
+msgstr "Larghezza"
+
 #: tftoolbox.caption
 msgctxt "tftoolbox.caption"
 msgid "Tools"
@@ -2962,8 +3022,9 @@ msgid "File not saved"
 msgstr "File non salvato"
 
 #: uresourcestrings.rsfilesize
+msgctxt "uresourcestrings.rsfilesize"
 msgid "Size"
-msgstr ""
+msgstr "Dimensione"
 
 #: uresourcestrings.rsfilesystem
 msgid "File system"

+ 62 - 2
lazpaint/release/bin/i18n/lazpaint.ja.po

@@ -2299,16 +2299,18 @@ msgid "Saturation"
 msgstr "濃淡"
 
 #: tfphongfilter.radio_usebackcolor.caption
+msgctxt "tfphongfilter.radio_usebackcolor.caption"
 msgid "Back color"
-msgstr ""
+msgstr "バックカラー"
 
 #: tfphongfilter.radio_usekeep.caption
 msgid "Keep"
 msgstr ""
 
 #: tfphongfilter.radio_usepencolor.caption
+msgctxt "tfphongfilter.radio_usepencolor.caption"
 msgid "Pen color"
-msgstr ""
+msgstr "ペンの色"
 
 #: tfphongfilter.radio_usetexture.caption
 msgctxt "tfphongfilter.radio_usetexture.caption"
@@ -2595,6 +2597,63 @@ msgctxt "TFSHIFTCOLORS.LABEL2.CAPTION"
 msgid "Saturation"
 msgstr "濃淡"
 
+#: tfsuperformula.caption
+msgid "Superformula"
+msgstr ""
+
+#: tfsuperformula.label_a.caption
+msgid "a"
+msgstr ""
+
+#: tfsuperformula.label_b.caption
+msgid "b"
+msgstr ""
+
+#: tfsuperformula.label_backcolor.caption
+msgctxt "tfsuperformula.label_backcolor.caption"
+msgid "Back color"
+msgstr "バックカラー"
+
+#: tfsuperformula.label_n1.caption
+msgid "n1"
+msgstr ""
+
+#: tfsuperformula.label_n2.caption
+msgid "n2"
+msgstr ""
+
+#: tfsuperformula.label_n3.caption
+msgid "n3"
+msgstr ""
+
+#: tfsuperformula.label_pencolor.caption
+msgctxt "tfsuperformula.label_pencolor.caption"
+msgid "Pen color"
+msgstr "ペンの色"
+
+#: tfsuperformula.label_rational.caption
+msgid "Rational"
+msgstr "有理数"
+
+#: tfsuperformula.label_size.caption
+msgctxt "tfsuperformula.label_size.caption"
+msgid "Size"
+msgstr "サイズ"
+
+#: tfsuperformula.label_spikecount.caption
+msgid "Spike count"
+msgstr "スパイク数"
+
+#: tfsuperformula.label_spikeoverlap.caption
+msgid "Spike overlap"
+msgstr "スパイクの重なり"
+
+#: tfsuperformula.label_width.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_width.caption"
+msgid "Width"
+msgstr "幅"
+
 #: tftoolbox.caption
 msgctxt "tftoolbox.caption"
 msgid "Tools"
@@ -2962,6 +3021,7 @@ msgid "File not saved"
 msgstr ""
 
 #: uresourcestrings.rsfilesize
+msgctxt "uresourcestrings.rsfilesize"
 msgid "Size"
 msgstr ""
 

+ 63 - 0
lazpaint/release/bin/i18n/lazpaint.kab.po

@@ -2303,6 +2303,7 @@ msgid "Saturation"
 msgstr "Tawant"
 
 #: tfphongfilter.radio_usebackcolor.caption
+msgctxt "tfphongfilter.radio_usebackcolor.caption"
 msgid "Back color"
 msgstr "Ini n ugilal"
 
@@ -2311,6 +2312,7 @@ msgid "Keep"
 msgstr "Ḥrez"
 
 #: tfphongfilter.radio_usepencolor.caption
+msgctxt "tfphongfilter.radio_usepencolor.caption"
 msgid "Pen color"
 msgstr "Ini n yimru"
 
@@ -2599,6 +2601,66 @@ msgctxt "TFSHIFTCOLORS.LABEL2.CAPTION"
 msgid "Saturation"
 msgstr "Tawant"
 
+#: tfsuperformula.caption
+msgid "Superformula"
+msgstr ""
+
+#: tfsuperformula.label_a.caption
+msgid "a"
+msgstr ""
+
+#: tfsuperformula.label_b.caption
+msgid "b"
+msgstr ""
+
+#: tfsuperformula.label_backcolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_backcolor.caption"
+msgid "Back color"
+msgstr "Ini n ugilal"
+
+#: tfsuperformula.label_n1.caption
+msgid "n1"
+msgstr ""
+
+#: tfsuperformula.label_n2.caption
+msgid "n2"
+msgstr ""
+
+#: tfsuperformula.label_n3.caption
+msgid "n3"
+msgstr ""
+
+#: tfsuperformula.label_pencolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_pencolor.caption"
+msgid "Pen color"
+msgstr "Ini n yimru"
+
+#: tfsuperformula.label_rational.caption
+msgid "Rational"
+msgstr ""
+
+#: tfsuperformula.label_size.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_size.caption"
+msgid "Size"
+msgstr "Tiddi"
+
+#: tfsuperformula.label_spikecount.caption
+msgid "Spike count"
+msgstr ""
+
+#: tfsuperformula.label_spikeoverlap.caption
+msgid "Spike overlap"
+msgstr ""
+
+#: tfsuperformula.label_width.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_width.caption"
+msgid "Width"
+msgstr "Tehri"
+
 #: tftoolbox.caption
 msgctxt "tftoolbox.caption"
 msgid "Tools"
@@ -2974,6 +3036,7 @@ msgid "File not saved"
 msgstr "Afaylu ur yeklis ara"
 
 #: uresourcestrings.rsfilesize
+msgctxt "uresourcestrings.rsfilesize"
 msgid "Size"
 msgstr "Tiddi"
 

+ 63 - 0
lazpaint/release/bin/i18n/lazpaint.lv.po

@@ -2307,6 +2307,7 @@ msgid "Saturation"
 msgstr "Piesātinājums"
 
 #: tfphongfilter.radio_usebackcolor.caption
+msgctxt "tfphongfilter.radio_usebackcolor.caption"
 msgid "Back color"
 msgstr "Pamatnes krāsa"
 
@@ -2315,6 +2316,7 @@ msgid "Keep"
 msgstr "Saglabāt"
 
 #: tfphongfilter.radio_usepencolor.caption
+msgctxt "tfphongfilter.radio_usepencolor.caption"
 msgid "Pen color"
 msgstr "Otas krāsa"
 
@@ -2603,6 +2605,66 @@ msgctxt "TFSHIFTCOLORS.LABEL2.CAPTION"
 msgid "Saturation"
 msgstr "Piesātinājums"
 
+#: tfsuperformula.caption
+msgid "Superformula"
+msgstr "Superformulė"
+
+#: tfsuperformula.label_a.caption
+msgid "a"
+msgstr ""
+
+#: tfsuperformula.label_b.caption
+msgid "b"
+msgstr ""
+
+#: tfsuperformula.label_backcolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_backcolor.caption"
+msgid "Back color"
+msgstr "Pamatnes krāsa"
+
+#: tfsuperformula.label_n1.caption
+msgid "n1"
+msgstr ""
+
+#: tfsuperformula.label_n2.caption
+msgid "n2"
+msgstr ""
+
+#: tfsuperformula.label_n3.caption
+msgid "n3"
+msgstr ""
+
+#: tfsuperformula.label_pencolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_pencolor.caption"
+msgid "Pen color"
+msgstr "Otas krāsa"
+
+#: tfsuperformula.label_rational.caption
+msgid "Rational"
+msgstr "Racionalus"
+
+#: tfsuperformula.label_size.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_size.caption"
+msgid "Size"
+msgstr "Izmērs"
+
+#: tfsuperformula.label_spikecount.caption
+msgid "Spike count"
+msgstr "Smailių skaičius"
+
+#: tfsuperformula.label_spikeoverlap.caption
+msgid "Spike overlap"
+msgstr "Spyglių sutapimas"
+
+#: tfsuperformula.label_width.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_width.caption"
+msgid "Width"
+msgstr "Platums"
+
 #: tftoolbox.caption
 msgctxt "tftoolbox.caption"
 msgid "Tools"
@@ -2978,6 +3040,7 @@ msgid "File not saved"
 msgstr "Datne netika saglabāts"
 
 #: uresourcestrings.rsfilesize
+msgctxt "uresourcestrings.rsfilesize"
 msgid "Size"
 msgstr "Izmērs"
 

+ 63 - 0
lazpaint/release/bin/i18n/lazpaint.nl.po

@@ -2300,6 +2300,7 @@ msgid "Saturation"
 msgstr "Verzadiging"
 
 #: tfphongfilter.radio_usebackcolor.caption
+msgctxt "tfphongfilter.radio_usebackcolor.caption"
 msgid "Back color"
 msgstr "Achtergrondkleur"
 
@@ -2308,6 +2309,7 @@ msgid "Keep"
 msgstr "Behouden"
 
 #: tfphongfilter.radio_usepencolor.caption
+msgctxt "tfphongfilter.radio_usepencolor.caption"
 msgid "Pen color"
 msgstr "Penkleur"
 
@@ -2596,6 +2598,66 @@ msgctxt "TFSHIFTCOLORS.LABEL2.CAPTION"
 msgid "Saturation"
 msgstr "Verzadiging"
 
+#: tfsuperformula.caption
+msgid "Superformula"
+msgstr "Superformule"
+
+#: tfsuperformula.label_a.caption
+msgid "a"
+msgstr ""
+
+#: tfsuperformula.label_b.caption
+msgid "b"
+msgstr ""
+
+#: tfsuperformula.label_backcolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_backcolor.caption"
+msgid "Back color"
+msgstr "Achtergrondkleur"
+
+#: tfsuperformula.label_n1.caption
+msgid "n1"
+msgstr ""
+
+#: tfsuperformula.label_n2.caption
+msgid "n2"
+msgstr ""
+
+#: tfsuperformula.label_n3.caption
+msgid "n3"
+msgstr ""
+
+#: tfsuperformula.label_pencolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_pencolor.caption"
+msgid "Pen color"
+msgstr "Penkleur"
+
+#: tfsuperformula.label_rational.caption
+msgid "Rational"
+msgstr "Rationaal"
+
+#: tfsuperformula.label_size.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_size.caption"
+msgid "Size"
+msgstr "Grootte"
+
+#: tfsuperformula.label_spikecount.caption
+msgid "Spike count"
+msgstr "Spike telling"
+
+#: tfsuperformula.label_spikeoverlap.caption
+msgid "Spike overlap"
+msgstr "Spike-overlap"
+
+#: tfsuperformula.label_width.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_width.caption"
+msgid "Width"
+msgstr "Breedte"
+
 #: tftoolbox.caption
 msgctxt "tftoolbox.caption"
 msgid "Tools"
@@ -2961,6 +3023,7 @@ msgid "File not saved"
 msgstr "Bestand niet opgeslaan"
 
 #: uresourcestrings.rsfilesize
+msgctxt "uresourcestrings.rsfilesize"
 msgid "Size"
 msgstr "Grootte"
 

+ 63 - 0
lazpaint/release/bin/i18n/lazpaint.pl.po

@@ -2312,6 +2312,7 @@ msgid "Saturation"
 msgstr "Nasycenie"
 
 #: tfphongfilter.radio_usebackcolor.caption
+msgctxt "tfphongfilter.radio_usebackcolor.caption"
 msgid "Back color"
 msgstr "Kolor tła"
 
@@ -2320,6 +2321,7 @@ msgid "Keep"
 msgstr "Trzymaj"
 
 #: tfphongfilter.radio_usepencolor.caption
+msgctxt "tfphongfilter.radio_usepencolor.caption"
 msgid "Pen color"
 msgstr "Kolor pióra"
 
@@ -2608,6 +2610,66 @@ msgctxt "TFSHIFTCOLORS.LABEL2.CAPTION"
 msgid "Saturation"
 msgstr "Jasność"
 
+#: tfsuperformula.caption
+msgid "Superformula"
+msgstr "Superformuła"
+
+#: tfsuperformula.label_a.caption
+msgid "a"
+msgstr ""
+
+#: tfsuperformula.label_b.caption
+msgid "b"
+msgstr ""
+
+#: tfsuperformula.label_backcolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_backcolor.caption"
+msgid "Back color"
+msgstr "Kolor tła"
+
+#: tfsuperformula.label_n1.caption
+msgid "n1"
+msgstr ""
+
+#: tfsuperformula.label_n2.caption
+msgid "n2"
+msgstr ""
+
+#: tfsuperformula.label_n3.caption
+msgid "n3"
+msgstr ""
+
+#: tfsuperformula.label_pencolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_pencolor.caption"
+msgid "Pen color"
+msgstr "Kolor pióra"
+
+#: tfsuperformula.label_rational.caption
+msgid "Rational"
+msgstr "Liczba wymierna"
+
+#: tfsuperformula.label_size.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_size.caption"
+msgid "Size"
+msgstr "Rozmiar"
+
+#: tfsuperformula.label_spikecount.caption
+msgid "Spike count"
+msgstr "Liczba skoków"
+
+#: tfsuperformula.label_spikeoverlap.caption
+msgid "Spike overlap"
+msgstr "Nakładanie się kolców"
+
+#: tfsuperformula.label_width.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_width.caption"
+msgid "Width"
+msgstr "Szerokość"
+
 #: tftoolbox.caption
 msgctxt "tftoolbox.caption"
 msgid "Tools"
@@ -2977,6 +3039,7 @@ msgid "File not saved"
 msgstr "Plik nie został zapisany"
 
 #: uresourcestrings.rsfilesize
+msgctxt "uresourcestrings.rsfilesize"
 msgid "Size"
 msgstr "Rozmiar"
 

+ 59 - 0
lazpaint/release/bin/i18n/lazpaint.pot

@@ -2142,6 +2142,7 @@ msgid "Saturation"
 msgstr ""
 
 #: tfphongfilter.radio_usebackcolor.caption
+msgctxt "tfphongfilter.radio_usebackcolor.caption"
 msgid "Back color"
 msgstr ""
 
@@ -2150,6 +2151,7 @@ msgid "Keep"
 msgstr ""
 
 #: tfphongfilter.radio_usepencolor.caption
+msgctxt "tfphongfilter.radio_usepencolor.caption"
 msgid "Pen color"
 msgstr ""
 
@@ -2432,6 +2434,62 @@ msgctxt "tfshiftcolors.label2.caption"
 msgid "Saturation"
 msgstr ""
 
+#: tfsuperformula.caption
+msgid "Superformula"
+msgstr ""
+
+#: tfsuperformula.label_a.caption
+msgid "a"
+msgstr ""
+
+#: tfsuperformula.label_b.caption
+msgid "b"
+msgstr ""
+
+#: tfsuperformula.label_backcolor.caption
+msgctxt "tfsuperformula.label_backcolor.caption"
+msgid "Back color"
+msgstr ""
+
+#: tfsuperformula.label_n1.caption
+msgid "n1"
+msgstr ""
+
+#: tfsuperformula.label_n2.caption
+msgid "n2"
+msgstr ""
+
+#: tfsuperformula.label_n3.caption
+msgid "n3"
+msgstr ""
+
+#: tfsuperformula.label_pencolor.caption
+msgctxt "tfsuperformula.label_pencolor.caption"
+msgid "Pen color"
+msgstr ""
+
+#: tfsuperformula.label_rational.caption
+msgid "Rational"
+msgstr ""
+
+#: tfsuperformula.label_size.caption
+msgctxt "tfsuperformula.label_size.caption"
+msgid "Size"
+msgstr ""
+
+#: tfsuperformula.label_spikecount.caption
+msgid "Spike count"
+msgstr ""
+
+#: tfsuperformula.label_spikeoverlap.caption
+msgid "Spike overlap"
+msgstr ""
+
+#: tfsuperformula.label_width.caption
+msgctxt "tfsuperformula.label_width.caption"
+msgid "Width"
+msgstr ""
+
 #: tftoolbox.caption
 msgctxt "tftoolbox.caption"
 msgid "Tools"
@@ -2793,6 +2851,7 @@ msgid "File not saved"
 msgstr ""
 
 #: uresourcestrings.rsfilesize
+msgctxt "uresourcestrings.rsfilesize"
 msgid "Size"
 msgstr ""
 

+ 63 - 0
lazpaint/release/bin/i18n/lazpaint.pt_BR.po

@@ -2302,6 +2302,7 @@ msgid "Saturation"
 msgstr "Saturação"
 
 #: tfphongfilter.radio_usebackcolor.caption
+msgctxt "tfphongfilter.radio_usebackcolor.caption"
 msgid "Back color"
 msgstr "Cor de fundo"
 
@@ -2310,6 +2311,7 @@ msgid "Keep"
 msgstr "Manter"
 
 #: tfphongfilter.radio_usepencolor.caption
+msgctxt "tfphongfilter.radio_usepencolor.caption"
 msgid "Pen color"
 msgstr "cor da caneta"
 
@@ -2600,6 +2602,66 @@ msgctxt "TFSHIFTCOLORS.LABEL2.CAPTION"
 msgid "Saturation"
 msgstr "Saturação"
 
+#: tfsuperformula.caption
+msgid "Superformula"
+msgstr "Superfórmula"
+
+#: tfsuperformula.label_a.caption
+msgid "a"
+msgstr ""
+
+#: tfsuperformula.label_b.caption
+msgid "b"
+msgstr ""
+
+#: tfsuperformula.label_backcolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_backcolor.caption"
+msgid "Back color"
+msgstr "Cor de fundo"
+
+#: tfsuperformula.label_n1.caption
+msgid "n1"
+msgstr ""
+
+#: tfsuperformula.label_n2.caption
+msgid "n2"
+msgstr ""
+
+#: tfsuperformula.label_n3.caption
+msgid "n3"
+msgstr ""
+
+#: tfsuperformula.label_pencolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_pencolor.caption"
+msgid "Pen color"
+msgstr "cor da caneta"
+
+#: tfsuperformula.label_rational.caption
+msgid "Rational"
+msgstr "Racional"
+
+#: tfsuperformula.label_size.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_size.caption"
+msgid "Size"
+msgstr "Tamanho"
+
+#: tfsuperformula.label_spikecount.caption
+msgid "Spike count"
+msgstr "Contagem de picos"
+
+#: tfsuperformula.label_spikeoverlap.caption
+msgid "Spike overlap"
+msgstr "Sobreposição de pico"
+
+#: tfsuperformula.label_width.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_width.caption"
+msgid "Width"
+msgstr "Largura"
+
 #: tftoolbox.caption
 msgctxt "TFTOOLBOX.CAPTION"
 msgid "Tools"
@@ -2967,6 +3029,7 @@ msgid "File not saved"
 msgstr "Arquivo não salvo"
 
 #: uresourcestrings.rsfilesize
+msgctxt "uresourcestrings.rsfilesize"
 msgid "Size"
 msgstr "Tamanho"
 

+ 63 - 0
lazpaint/release/bin/i18n/lazpaint.ru.po

@@ -2287,6 +2287,7 @@ msgid "Saturation"
 msgstr "Насыщенность"
 
 #: tfphongfilter.radio_usebackcolor.caption
+msgctxt "tfphongfilter.radio_usebackcolor.caption"
 msgid "Back color"
 msgstr "Дополнит."
 
@@ -2295,6 +2296,7 @@ msgid "Keep"
 msgstr "Как есть"
 
 #: tfphongfilter.radio_usepencolor.caption
+msgctxt "tfphongfilter.radio_usepencolor.caption"
 msgid "Pen color"
 msgstr "Основной"
 
@@ -2583,6 +2585,66 @@ msgctxt "TFSHIFTCOLORS.LABEL2.CAPTION"
 msgid "Saturation"
 msgstr "Насыщенность"
 
+#: tfsuperformula.caption
+msgid "Superformula"
+msgstr "Суперформула"
+
+#: tfsuperformula.label_a.caption
+msgid "a"
+msgstr ""
+
+#: tfsuperformula.label_b.caption
+msgid "b"
+msgstr ""
+
+#: tfsuperformula.label_backcolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_backcolor.caption"
+msgid "Back color"
+msgstr "Дополнит."
+
+#: tfsuperformula.label_n1.caption
+msgid "n1"
+msgstr ""
+
+#: tfsuperformula.label_n2.caption
+msgid "n2"
+msgstr ""
+
+#: tfsuperformula.label_n3.caption
+msgid "n3"
+msgstr ""
+
+#: tfsuperformula.label_pencolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_pencolor.caption"
+msgid "Pen color"
+msgstr "Основной"
+
+#: tfsuperformula.label_rational.caption
+msgid "Rational"
+msgstr "Рациональное"
+
+#: tfsuperformula.label_size.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_size.caption"
+msgid "Size"
+msgstr "Размер"
+
+#: tfsuperformula.label_spikecount.caption
+msgid "Spike count"
+msgstr "Количество шипов"
+
+#: tfsuperformula.label_spikeoverlap.caption
+msgid "Spike overlap"
+msgstr "Перекрытие шипов"
+
+#: tfsuperformula.label_width.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_width.caption"
+msgid "Width"
+msgstr "Ширина"
+
 #: tftoolbox.caption
 msgctxt "tftoolbox.caption"
 msgid "Tools"
@@ -2948,6 +3010,7 @@ msgid "File not saved"
 msgstr "Файл не сохранен"
 
 #: uresourcestrings.rsfilesize
+msgctxt "uresourcestrings.rsfilesize"
 msgid "Size"
 msgstr "Размер"
 

+ 63 - 0
lazpaint/release/bin/i18n/lazpaint.sv.po

@@ -2300,6 +2300,7 @@ msgid "Saturation"
 msgstr "Intensitet"
 
 #: tfphongfilter.radio_usebackcolor.caption
+msgctxt "tfphongfilter.radio_usebackcolor.caption"
 msgid "Back color"
 msgstr "Bakgrundsfärg"
 
@@ -2308,6 +2309,7 @@ msgid "Keep"
 msgstr "Behåll"
 
 #: tfphongfilter.radio_usepencolor.caption
+msgctxt "tfphongfilter.radio_usepencolor.caption"
 msgid "Pen color"
 msgstr "Pennfärg"
 
@@ -2600,6 +2602,66 @@ msgctxt "TFSHIFTCOLORS.LABEL2.CAPTION"
 msgid "Saturation"
 msgstr "Intensitet"
 
+#: tfsuperformula.caption
+msgid "Superformula"
+msgstr "Superformel"
+
+#: tfsuperformula.label_a.caption
+msgid "a"
+msgstr ""
+
+#: tfsuperformula.label_b.caption
+msgid "b"
+msgstr ""
+
+#: tfsuperformula.label_backcolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_backcolor.caption"
+msgid "Back color"
+msgstr "Bakgrundsfärg"
+
+#: tfsuperformula.label_n1.caption
+msgid "n1"
+msgstr ""
+
+#: tfsuperformula.label_n2.caption
+msgid "n2"
+msgstr ""
+
+#: tfsuperformula.label_n3.caption
+msgid "n3"
+msgstr ""
+
+#: tfsuperformula.label_pencolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_pencolor.caption"
+msgid "Pen color"
+msgstr "Pennfärg"
+
+#: tfsuperformula.label_rational.caption
+msgid "Rational"
+msgstr "Rationellt"
+
+#: tfsuperformula.label_size.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_size.caption"
+msgid "Size"
+msgstr "Storlek"
+
+#: tfsuperformula.label_spikecount.caption
+msgid "Spike count"
+msgstr "Spikräkning"
+
+#: tfsuperformula.label_spikeoverlap.caption
+msgid "Spike overlap"
+msgstr "Spiköverlappning"
+
+#: tfsuperformula.label_width.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_width.caption"
+msgid "Width"
+msgstr "Bredd"
+
 #: tftoolbox.caption
 msgctxt "tftoolbox.caption"
 msgid "Tools"
@@ -2967,6 +3029,7 @@ msgid "File not saved"
 msgstr "Filen har inte sparats"
 
 #: uresourcestrings.rsfilesize
+msgctxt "uresourcestrings.rsfilesize"
 msgid "Size"
 msgstr "Storlek"
 

+ 63 - 0
lazpaint/release/bin/i18n/lazpaint.tr.po

@@ -2297,6 +2297,7 @@ msgid "Saturation"
 msgstr "Saturizasyon"
 
 #: tfphongfilter.radio_usebackcolor.caption
+msgctxt "tfphongfilter.radio_usebackcolor.caption"
 msgid "Back color"
 msgstr "Arkaplan rengi"
 
@@ -2305,6 +2306,7 @@ msgid "Keep"
 msgstr "Hatırla"
 
 #: tfphongfilter.radio_usepencolor.caption
+msgctxt "tfphongfilter.radio_usepencolor.caption"
 msgid "Pen color"
 msgstr "Kalem rengi"
 
@@ -2593,6 +2595,66 @@ msgctxt "TFSHIFTCOLORS.LABEL2.CAPTION"
 msgid "Saturation"
 msgstr "Saturasyon"
 
+#: tfsuperformula.caption
+msgid "Superformula"
+msgstr "Süperformül"
+
+#: tfsuperformula.label_a.caption
+msgid "a"
+msgstr ""
+
+#: tfsuperformula.label_b.caption
+msgid "b"
+msgstr ""
+
+#: tfsuperformula.label_backcolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_backcolor.caption"
+msgid "Back color"
+msgstr "Arkaplan rengi"
+
+#: tfsuperformula.label_n1.caption
+msgid "n1"
+msgstr ""
+
+#: tfsuperformula.label_n2.caption
+msgid "n2"
+msgstr ""
+
+#: tfsuperformula.label_n3.caption
+msgid "n3"
+msgstr ""
+
+#: tfsuperformula.label_pencolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_pencolor.caption"
+msgid "Pen color"
+msgstr "Kalem rengi"
+
+#: tfsuperformula.label_rational.caption
+msgid "Rational"
+msgstr "Rasyonel"
+
+#: tfsuperformula.label_size.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_size.caption"
+msgid "Size"
+msgstr "Boyut"
+
+#: tfsuperformula.label_spikecount.caption
+msgid "Spike count"
+msgstr "Spike sayısı"
+
+#: tfsuperformula.label_spikeoverlap.caption
+msgid "Spike overlap"
+msgstr "Spike örtüşmesi"
+
+#: tfsuperformula.label_width.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_width.caption"
+msgid "Width"
+msgstr "Genişlik"
+
 #: tftoolbox.caption
 msgctxt "tftoolbox.caption"
 msgid "Tools"
@@ -2966,6 +3028,7 @@ msgid "File not saved"
 msgstr "Dosya kaydedilmedi"
 
 #: uresourcestrings.rsfilesize
+msgctxt "uresourcestrings.rsfilesize"
 msgid "Size"
 msgstr "Boyut"
 

+ 63 - 0
lazpaint/release/bin/i18n/lazpaint.zh_CN.po

@@ -2300,6 +2300,7 @@ msgid "Saturation"
 msgstr "饱和度"
 
 #: tfphongfilter.radio_usebackcolor.caption
+msgctxt "tfphongfilter.radio_usebackcolor.caption"
 msgid "Back color"
 msgstr "背景色"
 
@@ -2308,6 +2309,7 @@ msgid "Keep"
 msgstr "保留"
 
 #: tfphongfilter.radio_usepencolor.caption
+msgctxt "tfphongfilter.radio_usepencolor.caption"
 msgid "Pen color"
 msgstr "钢笔颜色"
 
@@ -2596,6 +2598,66 @@ msgctxt "TFSHIFTCOLORS.LABEL2.CAPTION"
 msgid "Saturation"
 msgstr "饱和度"
 
+#: tfsuperformula.caption
+msgid "Superformula"
+msgstr ""
+
+#: tfsuperformula.label_a.caption
+msgid "a"
+msgstr ""
+
+#: tfsuperformula.label_b.caption
+msgid "b"
+msgstr ""
+
+#: tfsuperformula.label_backcolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_backcolor.caption"
+msgid "Back color"
+msgstr "背景色"
+
+#: tfsuperformula.label_n1.caption
+msgid "n1"
+msgstr ""
+
+#: tfsuperformula.label_n2.caption
+msgid "n2"
+msgstr ""
+
+#: tfsuperformula.label_n3.caption
+msgid "n3"
+msgstr ""
+
+#: tfsuperformula.label_pencolor.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_pencolor.caption"
+msgid "Pen color"
+msgstr "钢笔颜色"
+
+#: tfsuperformula.label_rational.caption
+msgid "Rational"
+msgstr "有理数"
+
+#: tfsuperformula.label_size.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_size.caption"
+msgid "Size"
+msgstr "大小"
+
+#: tfsuperformula.label_spikecount.caption
+msgid "Spike count"
+msgstr "峰值计数"
+
+#: tfsuperformula.label_spikeoverlap.caption
+msgid "Spike overlap"
+msgstr "尖峰重叠"
+
+#: tfsuperformula.label_width.caption
+#, fuzzy
+msgctxt "tfsuperformula.label_width.caption"
+msgid "Width"
+msgstr "宽度"
+
 #: tftoolbox.caption
 msgctxt "tftoolbox.caption"
 msgid "Tools"
@@ -2971,6 +3033,7 @@ msgid "File not saved"
 msgstr "文件未保存"
 
 #: uresourcestrings.rsfilesize
+msgctxt "uresourcestrings.rsfilesize"
 msgid "Size"
 msgstr "大小"
 

+ 13 - 0
lazpaint/uconfig.pas

@@ -308,6 +308,9 @@ type
     function DefaultCuspCount: integer;
     procedure SetDefaultCuspCount(value: integer);
 
+    function DefaultSuperformulaParameters: string;
+    procedure SetDefaultSuperformulaParameters(value: string);
+
     //twirl config
     function DefaultTwirlRadius: double;
     procedure SetDefaultTwirlRadius(value: double);
@@ -1302,6 +1305,16 @@ begin
   iniOptions.WriteInteger('Filter','CuspCount',value);
 end;
 
+function TLazPaintConfig.DefaultSuperformulaParameters: string;
+begin
+  result := iniOptions.ReadString('Filter','SuperformulaParameters','');
+end;
+
+procedure TLazPaintConfig.SetDefaultSuperformulaParameters(value: string);
+begin
+  iniOptions.WriteString('Filter','SuperformulaParameters',value);
+end;
+
 function TLazPaintConfig.DefaultTwirlRadius: double;
 begin
   result := iniOptions.ReadFloat('Filter','TwirlRadius',100);

+ 5 - 3
lazpaint/ufilters.pas

@@ -120,15 +120,17 @@ begin
       exit;
   end;
 
+  if filter = pfHypocycloid then
+    exit(AInstance.ShowHypocycloidDlg(AInstance, AParameters));
+  if filter = pfSuperformula then
+    exit(AInstance.ShowSuperformulaDlg(AInstance, AParameters));
+
   applyOfsBefore:= false;
   if not (filter in[pfSharpen, pfSmooth, pfClearType, pfClearTypeInverse, pfNormalize, pfMedian,
             pfNegative, pfLinearNegative, pfComplementaryColor, pfGrayscale]) then
     if AInstance.Image.SelectionLayerIsEmpty then
       applyOfsBefore := true;
 
-  if filter = pfHypocycloid then
-    exit(AInstance.ShowHypocycloidDlg(AInstance, AParameters));
-
   try
     FilterConnector := TFilterConnector.Create(AInstance, AParameters, applyOfsBefore);
     layer := FilterConnector.ActiveLayer;

+ 1 - 1
lazpaint/umenu.pas

@@ -484,7 +484,7 @@ begin
   AddMenus('MenuRadialBlur',  'FilterBlurBox,FilterBlurFast,FilterBlurRadial,FilterBlurCorona,FilterBlurDisk');
   AddMenus('MenuColors', 'ColorCurves,ColorPosterize,ColorColorize,ColorShiftColors,FilterComplementaryColor,ColorIntensity,-,ColorLightness,FilterNegative,FilterLinearNegative,FilterNormalize,FilterGrayscale');
   AddMenus('MenuTool',   'ToolHand,ToolHotSpot,ToolColorPicker,-,ToolPen,ToolBrush,ToolEraser,ToolFloodFill,ToolClone,-,ToolEditShape,ToolRect,ToolEllipse,ToolPolyline,ToolOpenedCurve,ToolPolygon,ToolSpline,ToolGradient,ToolPhong,ToolText,-,ToolDeformation,ToolTextureMapping');
-  AddMenus('MenuRender', 'RenderPerlinNoise,RenderCyclicPerlinNoise,-,RenderWater,RenderCustomWater,RenderSnowPrint,RenderWood,RenderWoodVertical,RenderMetalFloor,RenderPlastik,RenderStone,RenderRoundStone,RenderMarble,RenderCamouflage,-,RenderClouds,FilterRain,RenderHypocycloid');
+  AddMenus('MenuRender', 'RenderPerlinNoise,RenderCyclicPerlinNoise,-,RenderWater,RenderCustomWater,RenderSnowPrint,RenderWood,RenderWoodVertical,RenderMetalFloor,RenderPlastik,RenderStone,RenderRoundStone,RenderMarble,RenderCamouflage,-,RenderClouds,FilterRain,RenderHypocycloid,RenderSuperformula');
   AddMenus('MenuScript', 'FileRunScript,-,InstalledScripts');
   AddMenus('MenuHelp',   'HelpIndex,-,HelpAbout');
   for i := 0 to high(FMainMenus) do

+ 5 - 1
lazpaintcontrols/lazpaintcontrols.lpk

@@ -21,7 +21,7 @@
       </Linking>
     </CompilerOptions>
     <Version Minor="2" Release="1"/>
-    <Files Count="13">
+    <Files Count="14">
       <Item1>
         <Filename Value="lctoolbars.pas"/>
         <UnitName Value="LCToolbars"/>
@@ -75,6 +75,10 @@
         <Filename Value="lcvectormultishape.pas"/>
         <UnitName Value="LCVectorMultishape"/>
       </Item13>
+      <Item14>
+        <Filename Value="lcsuperformulaoriginal.pas"/>
+        <UnitName Value="LCSuperformulaOriginal"/>
+      </Item14>
     </Files>
     <CompatibilityMode Value="True"/>
     <i18n>

+ 2 - 1
lazpaintcontrols/lazpaintcontrols.pas

@@ -11,7 +11,8 @@ uses
   LCToolbars, LCVectorialFill, LCVectorialFillInterface, LCVectorOriginal, 
   LCVectorPolyShapes, LCVectorRectShapes, LCVectorialFillControl, 
   LCVectorShapes, LCVectorTextShapes, LCScaleDPI, LCVectorClipboard, 
-  LCResourceString, LCVectorMultishape, LazarusPackageIntf;
+  LCResourceString, LCVectorMultishape, LCSuperformulaOriginal, 
+  LazarusPackageIntf;
 
 implementation
 

+ 561 - 0
lazpaintcontrols/lcsuperformulaoriginal.pas

@@ -0,0 +1,561 @@
+unit LCSuperformulaOriginal;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, BGRALayerOriginal, BGRABitmap, BGRABitmapTypes, Math,
+  Types;
+
+const
+    MaxDenominator = 20;
+
+type
+  { TSuperformulaOriginal }
+
+  TSuperformulaOriginal = class(TBGRALayerCustomOriginal)
+  private
+    FSpikeOverlap: boolean;
+    Fa: double;
+    Fb: double;
+    FBackColor: TBGRAPixel;
+    FPenColor: TBGRAPixel;
+    FLineWidth: double;
+    Fm: double;
+    FMRational: boolean;
+    FMultiplier: double;
+    Fn1: double;
+    Fn2: double;
+    Fn3: double;
+    FDiff: TBGRAOriginalStorageDiff;
+    FUpdateCount: integer;
+    function FloatToFraction(ARatio: single; out num, denom: integer; AMaxDenominator: integer): string;
+    function GetRadius: double;
+    function GetSize: double;
+    function GetSizeWithoutMultiplier: double;
+    procedure SetA(AValue: double);
+    procedure SetB(AValue: double);
+    procedure SetBackColor(AValue: TBGRAPixel);
+    procedure SetPenColor(AValue: TBGRAPixel);
+    procedure SetLineWidth(AValue: double);
+    procedure SetM(AValue: double);
+    procedure SetMultiplier(AValue: double);
+    procedure SetN1(AValue: double);
+    procedure SetN2(AValue: double);
+    procedure SetN3(AValue: double);
+    procedure SetMRational(AValue: boolean);
+    procedure SetSize(AValue: double);
+    procedure SetSpikeOverlap(AValue: boolean);
+  protected
+    procedure GetCurve(AMatrix: TAffineMatrix; out ABackPoints: ArrayOfTPointF;
+      out APenOutlinePoints: ArrayOfTPointF);
+    function PenVisible: boolean;
+    function BackVisible: boolean;
+    procedure BeginUpdate;
+    procedure EndUpdate;
+  public
+    constructor Create; override;
+    procedure Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix;
+      ADraft: boolean); override;
+    function GetRenderBounds(ADestRect: TRect; {%H-}AMatrix: TAffineMatrix): TRect; override;
+    procedure GetMFraction(out ANumerator, ADenominator: integer);
+    procedure LoadFromStorage(AStorage: TBGRACustomOriginalStorage); override;
+    procedure SaveToStorage(AStorage: TBGRACustomOriginalStorage); override;
+    class function StorageClassName: RawByteString; override;
+    property SpikeOverlap: boolean read FSpikeOverlap write SetSpikeOverlap;
+    property a: double read Fa write SetA;
+    property b: double read Fb write SetB;
+    property m: double read Fm write SetM;
+    property mRational: boolean read FMRational write SetMRational;
+    property n1: double read Fn1 write SetN1;
+    property n2: double read Fn2 write SetN2;
+    property n3: double read Fn3 write SetN3;
+    property Radius: double read GetRadius;
+    property LineWidth: double read FLineWidth write SetLineWidth;
+    property PenColor: TBGRAPixel read FPenColor write SetPenColor;
+    property BackColor: TBGRAPixel read FBackColor write SetBackColor;
+    property Multiplier: double read FMultiplier write SetMultiplier;
+    property Size: double read GetSize write SetSize;
+  end;
+
+implementation
+
+uses BGRATransform, BGRAPen, BGRAGraphics;
+
+var
+  MAX_LOG: double = 0.0;
+  MIN_LOG: double = 0.0;
+  MAX_R: double = 100.0;
+
+function SafePower(a, b: double; out c: double): boolean;
+var
+  tmp: double;
+begin
+  if a < 0 then
+  begin
+    result := SafePower(-a, b, c);
+    c := -c;
+    exit;
+  end;
+
+  Result := True;
+  if a = 0 then
+  begin
+    if b = 0 then
+      c := 1
+    else
+      c := 0;
+    exit;
+  end;
+
+  if MAX_LOG = 0.0 then
+    MAX_LOG := ln(MaxDouble);
+  if MIN_LOG = 0.0 then
+    MIN_LOG := ln(MinDouble);
+
+  // ln(a^b) = b ln(a)
+  tmp := b * ln(a);
+  if tmp > MAX_LOG then
+    Result := False
+  else
+  if tmp < MIN_LOG then
+    c := 0.0
+  else
+    c := exp(tmp);
+end;
+
+function ComputeR(theta, a, b, m, n1, n2, n3: double): double;
+const
+  EPS = 1E-9;
+var
+  c, pc, s, ps: double;
+begin
+  if (a = 0) or (b = 0) or (m = 0) or (n1 = 0) or (n2 = 0) or (n3 = 0) then
+    exit(0);
+
+  c := abs(cos(m * theta / 4) / a);
+  if c < EPS then
+    pc := 0
+  else
+  if not SafePower(c, n2, pc) then
+  begin
+    Result := MAX_R;
+    exit;
+  end;
+
+  s := abs(sin(m * theta / 4) / b);
+  if s < EPS then
+    ps := 0
+  else
+  if not SafePower(s, n3, ps) then
+  begin
+    Result := MAX_R;
+    exit;
+  end;
+
+  if pc + ps < EPS then
+    Result := 0
+  else
+  if not SafePower(pc + ps, -1 / n1, Result) then
+    Result := MAX_R;
+
+  if Result > MAX_R then
+    Result := MAX_R;
+end;
+
+{ TSuperformulaOriginal }
+
+procedure TSuperformulaOriginal.SetA(AValue: double);
+begin
+  if Fa = AValue then
+    Exit;
+  BeginUpdate;
+  Fa := AValue;
+  EndUpdate;
+end;
+
+procedure TSuperformulaOriginal.SetB(AValue: double);
+begin
+  if Fb = AValue then
+    Exit;
+  BeginUpdate;
+  Fb := AValue;
+  EndUpdate;
+end;
+
+procedure TSuperformulaOriginal.SetBackColor(AValue: TBGRAPixel);
+begin
+  if FBackColor = AValue then
+    Exit;
+  BeginUpdate;
+  FBackColor := AValue;
+  EndUpdate;
+end;
+
+procedure TSuperformulaOriginal.SetPenColor(AValue: TBGRAPixel);
+begin
+  if FPenColor = AValue then
+    Exit;
+  BeginUpdate;
+  FPenColor := AValue;
+  EndUpdate;
+end;
+
+procedure TSuperformulaOriginal.SetLineWidth(AValue: double);
+begin
+  if FLineWidth = AValue then
+    Exit;
+  BeginUpdate;
+  FLineWidth := AValue;
+  EndUpdate;
+end;
+
+procedure TSuperformulaOriginal.SetM(AValue: double);
+begin
+  if Fm = AValue then
+    Exit;
+  BeginUpdate;
+  Fm := AValue;
+  EndUpdate;
+end;
+
+procedure TSuperformulaOriginal.SetMultiplier(AValue: double);
+begin
+  if FMultiplier = AValue then
+    Exit;
+  BeginUpdate;
+  FMultiplier := AValue;
+  EndUpdate;
+end;
+
+procedure TSuperformulaOriginal.SetMRational(AValue: boolean);
+begin
+  if FMRational=AValue then Exit;
+  BeginUpdate;
+  FMRational:=AValue;
+  EndUpdate;
+end;
+
+procedure TSuperformulaOriginal.SetSize(AValue: double);
+var
+  curSizeWithoutMultiplier: Double;
+begin
+  curSizeWithoutMultiplier := GetSizeWithoutMultiplier;
+  if curSizeWithoutMultiplier = 0 then exit;
+  Multiplier:= AValue/curSizeWithoutMultiplier;
+end;
+
+procedure TSuperformulaOriginal.SetN1(AValue: double);
+begin
+  if Fn1 = AValue then
+    Exit;
+  BeginUpdate;
+  Fn1 := AValue;
+  EndUpdate;
+end;
+
+procedure TSuperformulaOriginal.SetN2(AValue: double);
+begin
+  if Fn2 = AValue then
+    Exit;
+  BeginUpdate;
+  Fn2 := AValue;
+  EndUpdate;
+end;
+
+procedure TSuperformulaOriginal.SetN3(AValue: double);
+begin
+  if Fn3 = AValue then
+    Exit;
+  BeginUpdate;
+  Fn3 := AValue;
+  EndUpdate;
+end;
+
+procedure TSuperformulaOriginal.SetSpikeOverlap(AValue: boolean);
+begin
+  if FSpikeOverlap=AValue then Exit;
+  BeginUpdate;
+  FSpikeOverlap:=AValue;
+  EndUpdate;
+end;
+
+procedure TSuperformulaOriginal.GetCurve(AMatrix: TAffineMatrix;
+  out ABackPoints: ArrayOfTPointF; out APenOutlinePoints: ArrayOfTPointF);
+var
+  i, num, denom, precision, turns: integer;
+  r, theta, usedM, approxM, correction: double;
+  stroker: TBGRACustomPenStroker;
+begin
+  ABackPoints := nil;
+  APenOutlinePoints := nil;
+  FloatToFraction(m, num, denom, MaxDenominator);
+  approxM := num/denom;
+  precision := max(num * 100, 100 * 3);
+  if precision > 3000 then
+    precision := (3000 div num)*num;
+  if mRational then
+  begin
+    usedM := approxM;
+    correction := 1;
+  end else
+  begin
+    usedM:= m;
+    correction := approxM / m;
+  end;
+  turns := denom * (1 + integer(SpikeOverlap and odd(num) and ((a <> b) or (n2 <> n3))));
+  SetLength(ABackPoints, precision * turns);
+  for i := 0 to precision * turns - 1 do
+  begin
+    theta := i * 2 * Pi * correction / precision;
+    r := ComputeR(theta, a, b, usedM, n1, n2, n3) * multiplier;
+    ABackPoints[i] := AMatrix * PointF(r * cos(theta), r * sin(theta));
+  end;
+  if PenVisible then
+  begin
+    stroker := TBGRAPenStroker.Create;
+    try
+      stroker.StrokeMatrix := AMatrix;
+      stroker.JoinStyle := pjsMiter;
+      APenOutlinePoints := stroker.ComputePolygon(ABackPoints, LineWidth);
+    finally
+      stroker.Free;
+    end;
+  end;
+  if not BackVisible then
+     ABackPoints := nil;
+end;
+
+function TSuperformulaOriginal.PenVisible: boolean;
+begin
+  result := (LineWidth > 0) and (PenColor.alpha > 0);
+end;
+
+function TSuperformulaOriginal.BackVisible: boolean;
+begin
+  result := BackColor.alpha > 0;
+end;
+
+procedure TSuperformulaOriginal.BeginUpdate;
+begin
+  if FUpdateCount = 0 then
+  begin
+    FDiff := TBGRAOriginalStorageDiff.Create(self);
+  end;
+  Inc(FUpdateCount);
+end;
+
+procedure TSuperformulaOriginal.EndUpdate;
+begin
+  if FUpdateCount = 0 then exit;
+  Dec(FUpdateCount);
+  if FUpdateCount = 0 then
+  begin
+    if Assigned(FDiff) then
+       FDiff.ComputeDifference(self);
+    NotifyChange(FDiff);
+    FDiff := nil;
+  end;
+end;
+
+constructor TSuperformulaOriginal.Create;
+begin
+  inherited Create;
+  FSpikeOverlap:= true;
+  Fa := 1;
+  Fb := 1;
+  Fm := 24;
+  Fn1 := 2;
+  Fn2 := 1;
+  Fn3 := 2;
+  FLineWidth := 0;
+  FPenColor := BGRA($00, $40, $80);
+  FBackColor := BGRA($00, $80, $C0);
+  FMultiplier := 200;
+  FMRational:= true;
+  FUpdateCount:= 0;
+  FDiff := nil;
+end;
+
+function TSuperformulaOriginal.FloatToFraction(ARatio: single; out num,
+  denom: integer; AMaxDenominator: integer): string;
+
+  procedure InvFrac;
+  var temp: integer;
+  begin
+    temp := num;
+    num := denom;
+    denom := temp;
+  end;
+
+  procedure AddFrac(AValue: integer);
+  begin
+    inc(num, AValue*denom);
+  end;
+
+const MaxDev = 6;
+var
+  dev: array[1..MaxDev] of integer;
+  devCount, i: integer;
+  curVal, remain: Single;
+
+begin
+  if ARatio < 0 then ARatio := -ARatio;
+  curVal := ARatio;
+  devCount := 0;
+  repeat
+    inc(devCount);
+    dev[devCount] := trunc(curVal);
+    remain := frac(curVal);
+    if abs(remain) < 1e-3 then break;
+    if devCount = MaxDev then
+    begin
+      if remain > 0.5 then inc(dev[devCount]);
+      break;
+    end;
+    curVal := 1/remain;
+  until false;
+  repeat
+    num := dev[devCount];
+    denom := 1;
+    for i := devCount-1 downto 1 do
+    begin
+      InvFrac;
+      AddFrac(dev[i]);
+    end;
+    if ((num >= denom) and (denom <= AMaxDenominator))
+       or ((num < denom) and (num <= AMaxDenominator))
+       or (devCount = 1) then break;
+    dec(devCount);
+  until false;
+  result := IntToStr(num)+':'+IntToStr(denom);
+end;
+
+function TSuperformulaOriginal.GetRadius: double;
+begin
+  result := 1;
+end;
+
+function TSuperformulaOriginal.GetSize: double;
+begin
+  result := GetSizeWithoutMultiplier * Multiplier;
+end;
+
+function TSuperformulaOriginal.GetSizeWithoutMultiplier: double;
+const SizePrecision = 50;
+var
+  r, factor: Double;
+  i: Integer;
+begin
+  if m = 0 then exit(0);
+  factor := 2*Pi/m/SizePrecision;
+  r := 0;
+  for i := 0 to SizePrecision-1 do
+  begin
+    r += ComputeR(i * factor, a, b, m, n1, n2, n3);
+  end;
+  r /= SizePrecision;
+  result := r;
+end;
+
+procedure TSuperformulaOriginal.Render(ADest: TBGRABitmap;
+  AMatrix: TAffineMatrix; ADraft: boolean);
+var
+  backPoints, penOutlinePoints: ArrayOfTPointF;
+begin
+  try
+    GetCurve(AMatrix, backPoints, penOutlinePoints);
+    if ADraft then
+    begin
+      if backPoints <> nil then
+         ADest.FillPoly(backPoints, FBackColor, dmDrawWithTransparency, false);
+      if penOutlinePoints <> nil then
+         ADest.FillPoly(penOutlinePoints, FPenColor, dmDrawWithTransparency, false);
+    end else
+    begin
+      if backPoints <> nil then
+         ADest.FillPolyAntialias(backPoints, FBackColor, false);
+      if penOutlinePoints <> nil then
+         ADest.FillPolyAntialias(penOutlinePoints, FPenColor, false);
+    end;
+  except
+    // ignore exceptions
+  end;
+end;
+
+function TSuperformulaOriginal.GetRenderBounds(ADestRect: TRect;
+  AMatrix: TAffineMatrix): TRect;
+var
+  backPoints, penOutlinePoints: ArrayOfTPointF;
+  resultF: TRectF;
+  ptF: TPointF;
+begin
+  GetCurve(AMatrix, backPoints, penOutlinePoints);
+  if (backPoints = nil) and (penOutlinePoints = nil) then
+    exit(EmptyRect);
+  resultF.Left := MaxSingle;
+  resultF.Top := MaxSingle;
+  resultF.Right := -MaxSingle;
+  resultF.Bottom := -MaxSingle;
+  if backPoints <> nil then
+    for ptF in backPoints do resultF.Include(ptF);
+  if penOutlinePoints <> nil then
+    for ptF in penOutlinePoints do resultF.Include(ptF);
+  result.Left := floor(resultF.Left);
+  result.Top := floor(resultF.Top);
+  result.Right := ceil(resultF.Right);
+  result.Bottom := ceil(resultF.Bottom);
+end;
+
+procedure TSuperformulaOriginal.GetMFraction(out ANumerator,
+  ADenominator: integer);
+begin
+  FloatToFraction(m, ANumerator, ADenominator, MaxDenominator);
+end;
+
+procedure TSuperformulaOriginal.LoadFromStorage(
+  AStorage: TBGRACustomOriginalStorage);
+begin
+  FSpikeOverlap:= AStorage.BoolDef['spike-overlap', false];
+  Fa := AStorage.Float['a'];
+  Fb := AStorage.Float['b'];
+  Fm := AStorage.Float['m'];
+  FMRational:= AStorage.BoolDef['m-rational', true];
+  Fn1 := AStorage.Float['n1'];
+  Fn2 := AStorage.Float['n2'];
+  Fn3 := AStorage.Float['n3'];
+  FMultiplier := AStorage.Float['multiplier'];
+  FLineWidth := AStorage.Float['line-width'];
+
+  FPenColor := AStorage.Color['pen-color'];
+  FBackColor := AStorage.Color['back-color'];
+end;
+
+procedure TSuperformulaOriginal.SaveToStorage(
+  AStorage: TBGRACustomOriginalStorage);
+begin
+  AStorage.Bool['spike-overlap'] := FSpikeOverlap;
+  AStorage.Float['a'] := Fa;
+  AStorage.Float['b'] := Fb;
+  AStorage.Float['m'] := Fm;
+  AStorage.Bool['m-rational'] := FMRational;
+  AStorage.Float['n1'] := Fn1;
+  AStorage.Float['n2'] := Fn2;
+  AStorage.Float['n3'] := Fn3;
+  AStorage.Float['multiplier'] := FMultiplier;
+  AStorage.Float['line-width'] := FLineWidth;
+
+  AStorage.Color['pen-color'] := FPenColor;
+  AStorage.Color['back-color'] := FBackColor;
+end;
+
+class function TSuperformulaOriginal.StorageClassName: RawByteString;
+begin
+  Result := 'superformula';
+end;
+
+initialization
+  RegisterLayerOriginal(TSuperformulaOriginal);
+
+end.