gamma threshold support added

This commit is contained in:
zueuk 2008-08-30 09:47:37 +00:00
parent b50b60f759
commit 1973ec62cb
15 changed files with 355 additions and 173 deletions

View File

@ -182,7 +182,7 @@ object AdjustForm: TAdjustForm
Top = 132 Top = 132
Width = 388 Width = 388
Height = 129 Height = 129
ActivePage = TabSheet3 ActivePage = TabSheet2
Align = alBottom Align = alBottom
Images = MainForm.Buttons Images = MainForm.Buttons
TabOrder = 1 TabOrder = 1
@ -511,6 +511,34 @@ object AdjustForm: TAdjustForm
OnMouseMove = DragPanelMouseMove OnMouseMove = DragPanelMouseMove
OnMouseUp = DragPanelMouseUp OnMouseUp = DragPanelMouseUp
end end
object pnlGammaThreshold: TPanel
Left = 232
Top = 76
Width = 106
Height = 21
Cursor = crHandPoint
Hint = 'Click and drag to change value'
BevelOuter = bvLowered
Caption = 'Gamma Threshold'
ParentShowHint = False
ShowHint = True
TabOrder = 11
OnDblClick = DragPanelDblClick
OnMouseDown = DragPanelMouseDown
OnMouseMove = DragPanelMouseMove
OnMouseUp = DragPanelMouseUp
end
object txtGammaThreshold: TEdit
Left = 338
Top = 76
Width = 41
Height = 21
TabOrder = 12
Text = '0'
OnEnter = txtGammaThresholdEnter
OnExit = txtGammaThresholdExit
OnKeyPress = txtGammaThresholdKeyPress
end
end end
object TabSheet3: TTabSheet object TabSheet3: TTabSheet
Caption = 'Gradient' Caption = 'Gradient'

View File

@ -135,6 +135,8 @@ type
Bevel3: TBevel; Bevel3: TBevel;
pnlMasterScale: TPanel; pnlMasterScale: TPanel;
editPPU: TEdit; editPPU: TEdit;
pnlGammaThreshold: TPanel;
txtGammaThreshold: TEdit;
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormDestroy(Sender: TObject); procedure FormDestroy(Sender: TObject);
@ -264,6 +266,9 @@ type
procedure PreviewImageMouseUp(Sender: TObject; Button: TMouseButton; procedure PreviewImageMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer); Shift: TShiftState; X, Y: Integer);
procedure PreviewImageDblClick(Sender: TObject); procedure PreviewImageDblClick(Sender: TObject);
procedure txtGammaThresholdKeyPress(Sender: TObject; var Key: Char);
procedure txtGammaThresholdEnter(Sender: TObject);
procedure txtGammaThresholdExit(Sender: TObject);
private private
Resetting: boolean; Resetting: boolean;
@ -401,6 +406,8 @@ begin
Resetting := False; Resetting := False;
editPPU.Text := Format('%.6g', [100*cp.pixels_per_unit/PreviewImage.Width]); editPPU.Text := Format('%.6g', [100*cp.pixels_per_unit/PreviewImage.Width]);
txtGammaThreshold.Text := Format('%.3g', [cp.gamma_threshold]);
end; //*** end; //***
DrawPreview; DrawPreview;
end; end;
@ -1938,9 +1945,10 @@ begin
except except
exit; exit;
end; end;
if v > 0 then begin v := v/100*PreviewImage.Width;
if (v > 0) and (cp.pixels_per_unit <> v) then begin
MainForm.UpdateUndo; MainForm.UpdateUndo;
cp.pixels_per_unit := v/100*PreviewImage.Width; cp.pixels_per_unit := v;
UpdateFlame; UpdateFlame;
end; end;
end; end;
@ -1968,6 +1976,8 @@ begin
pnlDragValue := cp.brightness pnlDragValue := cp.brightness
else if (Sender = pnlVibrancy) then else if (Sender = pnlVibrancy) then
pnlDragValue := cp.vibrancy pnlDragValue := cp.vibrancy
else if (Sender = pnlGammaThreshold) then
pnlDragValue := cp.gamma_threshold
else assert(false); else assert(false);
pnlDragMode := true; pnlDragMode := true;
@ -2040,6 +2050,12 @@ begin
else if (Sender = pnlVibrancy) then else if (Sender = pnlVibrancy) then
begin begin
scrollVibrancy.Position := trunc(v * 100); scrollVibrancy.Position := trunc(v * 100);
end
else if (Sender = pnlGammaThreshold) then
begin
if v < 0 then v := 0;
cp.gamma_threshold := v;
txtGammaThreshold.Text := FloattoStr(v);
end; end;
//pEdit^.Text := FloatToStr(v); //pEdit^.Text := FloatToStr(v);
//pEdit.Refresh; //pEdit.Refresh;
@ -2097,15 +2113,21 @@ begin
end end
else if (Sender = pnlGamma) then else if (Sender = pnlGamma) then
begin begin
scrollGamma.Position := 400; scrollGamma.Position := Round(defGamma * 100);
end end
else if (Sender = pnlBrightness) then else if (Sender = pnlBrightness) then
begin begin
scrollBrightness.Position := 400; scrollBrightness.Position := Round(defBrightness * 100);
end end
else if (Sender = pnlVibrancy) then else if (Sender = pnlVibrancy) then
begin begin
scrollVibrancy.Position := 100; scrollVibrancy.Position := Round(defVibrancy * 100);
end
else if (Sender = pnlGammaThreshold) then
begin
if cp.gamma_threshold = defGammaThreshold then exit;
cp.gamma_threshold := defGammaThreshold;
txtGammaThreshold.Text := FloatToStr(defGammaThreshold);
end end
else assert(false); else assert(false);
@ -2219,5 +2241,38 @@ begin
UpdateFlame; UpdateFlame;
end; end;
procedure TAdjustForm.txtGammaThresholdEnter(Sender: TObject);
begin
EditBoxValue := txtGammaThreshold.Text;
end;
procedure TAdjustForm.txtGammaThresholdExit(Sender: TObject);
var
v: double;
begin
try
v := strtofloat(txtGammaThreshold.Text);
except
exit;
end;
if v < 0 then v := 0;
if v <> cp.gamma_threshold then begin
MainForm.UpdateUndo;
cp.gamma_threshold := v;
UpdateFlame;
EditBoxValue := txtGammaThreshold.Text;
end;
end;
procedure TAdjustForm.txtGammaThresholdKeyPress(Sender: TObject;
var Key: Char);
begin
if key=#13 then
begin
key := #0;
txtGammaThresholdExit(Sender);
end;
end;
end. end.

View File

@ -127,7 +127,7 @@ type
estimator, estimator_min, estimator_curve: double; // density estimator. estimator, estimator_min, estimator_curve: double; // density estimator.
jitters: integer; jitters: integer;
gamma_treshold: double; gamma_threshold: double;
// PropTable: array of TXForm; // PropTable: array of TXForm;
FAngle: Double; FAngle: Double;
@ -269,7 +269,7 @@ begin
estimator_min := 0.0; estimator_min := 0.0;
estimator_curve := 0.4; estimator_curve := 0.4;
jitters := 1; jitters := 1;
gamma_treshold := 0.01; gamma_threshold := defGammaThreshold;
FTwoColorDimensions := False; FTwoColorDimensions := False;
@ -437,7 +437,6 @@ end;
xf := xform[0];//random(NumXForms)]; xf := xform[0];//random(NumXForms)];
for i := 0 to FUSE do begin for i := 0 to FUSE do begin
xf := xf.PropTable[Random(PROP_TABLE_SIZE)]; xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
//if xf.RetraceXform then continue;
xf.NextPoint(p); xf.NextPoint(p);
end; end;
@ -866,10 +865,7 @@ begin
end else if AnsiCompareText(CurrentToken, 'plotmode') = 0 then begin end else if AnsiCompareText(CurrentToken, 'plotmode') = 0 then begin
Inc(ParsePos); Inc(ParsePos);
xform[CurrentXForm].noPlot := (ParseValues[ParsePos] = '1'); xform[CurrentXForm].noPlot := (StrToInt(ParseValues[ParsePos]) = 1);
// end else if AnsiCompareText(CurrentToken, 'retrace') = 0 then begin
// Inc(ParsePos);
// xform[CurrentXForm].RetraceXform := (ParseValues[ParsePos] = '1');
end else begin end else begin
OutputDebugString(Pchar('Unknown Token: ' + CurrentToken)); OutputDebugString(Pchar('Unknown Token: ' + CurrentToken));
end; end;
@ -1600,7 +1596,6 @@ begin
sl.Add(s); sl.Add(s);
sl.Add(Format('plotmode %d', [Ifthen(noPlot, 1, 0)])); sl.Add(Format('plotmode %d', [Ifthen(noPlot, 1, 0)]));
// sl.Add(Format('retrace %d', [Ifthen(RetraceXform, 1, 0)]));
end; end;
DecimalSeparator := OldDecimalSperator; DecimalSeparator := OldDecimalSperator;
@ -1622,6 +1617,7 @@ begin
Result.nick := nick; Result.nick := nick;
Result.url := url; Result.url := url;
Result.Transparency := Transparency; Result.Transparency := Transparency;
Result.gamma_threshold := gamma_threshold;
for i := 0 to NXFORMS - 1 do for i := 0 to NXFORMS - 1 do
Result.xform[i].assign(xform[i]); Result.xform[i].assign(xform[i]);
@ -1653,6 +1649,7 @@ begin
name := cp1.name; name := cp1.name;
nick := cp1.nick; nick := cp1.nick;
url := cp1.url; url := cp1.url;
gamma_threshold := cp1.gamma_threshold;
if KeepSizes then if KeepSizes then
AdjustScale(w, h); AdjustScale(w, h);

View File

@ -358,7 +358,8 @@ type
procedure mnuChaosSetAllClick(Sender: TObject); procedure mnuChaosSetAllClick(Sender: TObject);
procedure mnuLinkPostxformClick(Sender: TObject); procedure mnuLinkPostxformClick(Sender: TObject);
procedure chkXformSoloClick(Sender: TObject); procedure chkXformSoloClick(Sender: TObject);
// procedure chkRetraceClick(Sender: TObject); // procedure btnInvisibleClick(Sender: TObject);
// procedure btnSoloClick(Sender: TObject);
private private
TriangleView: TCustomDrawControl; TriangleView: TCustomDrawControl;
@ -835,8 +836,6 @@ begin
chkXformInvisible.Enabled := true; chkXformInvisible.Enabled := true;
chkXformInvisible.Checked := noPlot; chkXformInvisible.Checked := noPlot;
chkXformSolo.Enabled := true; chkXformSolo.Enabled := true;
// chkRetrace.Enabled := not noPlot;
// chkRetrace.Checked := RetraceXform;
if cp.soloXform >= 0 then begin if cp.soloXform >= 0 then begin
chkXformSolo.Checked := true; chkXformSolo.Checked := true;
chkXformSolo.Caption := Format('Solo transform #%d', [cp.soloXform + 1]); chkXformSolo.Caption := Format('Solo transform #%d', [cp.soloXform + 1]);
@ -1065,7 +1064,6 @@ begin
modWeights[Transforms-1] := 1; modWeights[Transforms-1] := 1;
end; end;
// //
if t = (Transforms - 1) then if t = (Transforms - 1) then
begin begin
MainTriangles[t] := MainTriangles[Transforms]; MainTriangles[t] := MainTriangles[Transforms];
@ -1679,9 +1677,6 @@ begin
vleVariables.InsertRow(GetVariableNameAt(i), '0', True); vleVariables.InsertRow(GetVariableNameAt(i), '0', True);
end; end;
// for i:= 0 to NXFORMS - 1 do begin
// vleChaos.InsertRow(inttostr(i + 1), '1', True);
// end;
vleChaos.InsertRow('to 1', '1', true); vleChaos.InsertRow('to 1', '1', true);
GraphZoom := 1; GraphZoom := 1;
@ -3326,7 +3321,7 @@ begin
if Sender = VEVars then if Sender = VEVars then
begin begin
v := cp.xform[SelectedTriangle].vars[n]; v := cp.xform[SelectedTriangle].vars[n];
cp.xform[SelectedTriangle].vars[n] := IfThen(DoubleClickSetVars and (v = 0), 1, 0); cp.xform[SelectedTriangle].vars[n] := IfThen(v = 0, 1, 0);
//VEVars.Values[VarNames(n)] := '0'; //VEVars.Values[VarNames(n)] := '0';
changed := (cp.xform[SelectedTriangle].vars[n] <> v); changed := (cp.xform[SelectedTriangle].vars[n] <> v);
end end
@ -3622,6 +3617,15 @@ begin
Ord('P'): btnPickPivotClick(Sender); Ord('P'): btnPickPivotClick(Sender);
Ord('T'): tbPostXswapClick(Sender); Ord('T'): tbPostXswapClick(Sender);
Ord('I'): // Invisible
begin
chkXformInvisible.Checked := not chkXformInvisible.Checked;
end;
Ord('S'): // Solo
begin
chkXformSolo.Checked := not chkXformSolo.Checked;
end;
189: // "-" 189: // "-"
begin begin
GraphZoom := GraphZoom * 0.8; GraphZoom := GraphZoom * 0.8;
@ -4918,7 +4922,7 @@ begin
noEdit := false; noEdit := false;
break; break;
end; end;
end; end;
if noEdit then exit; if noEdit then exit;
Mainform.UpdateUndo; Mainform.UpdateUndo;
@ -4948,7 +4952,7 @@ begin
noEdit := false; noEdit := false;
break; break;
end; end;
end; end;
if noEdit then exit; if noEdit then exit;
Mainform.UpdateUndo; Mainform.UpdateUndo;
@ -5013,15 +5017,32 @@ begin
end; end;
{ {
procedure TEditForm.chkRetraceClick(Sender: TObject); procedure TEditForm.btnInvisibleClick(Sender: TObject);
var var
newValue: boolean; newMode: boolean;
begin begin
if (SelectedTriangle < Transforms) then begin if (SelectedTriangle < Transforms) then
newValue := chkRetrace.Checked; begin
if cp.xform[SelectedTriangle].RetraceXform <> newValue then begin newMode := btnInvisible.Down;
if cp.xform[SelectedTriangle].noPlot <> newMode then begin
MainForm.UpdateUndo; MainForm.UpdateUndo;
cp.xform[SelectedTriangle].RetraceXform := newValue; cp.xform[SelectedTriangle].noPlot := newMode;
UpdateFlame(true);
end;
end;
end;
procedure TEditForm.btnSoloClick(Sender: TObject);
begin
if btnSolo.Down <> (cp.soloXform >=0) then begin
if btnSolo.Down then begin
if (SelectedTriangle < Transforms) then begin
cp.soloXform := SelectedTriangle;
UpdateFlame(true);
end;
end
else begin
cp.soloXform := -1;
UpdateFlame(true); UpdateFlame(true);
end; end;
end; end;

View File

@ -289,9 +289,9 @@ object ExportDialog: TExportDialog
object Label14: TLabel object Label14: TLabel
Left = 160 Left = 160
Top = 16 Top = 16
Width = 39 Width = 43
Height = 26 Height = 26
Caption = 'Gamma treshold' Caption = 'Gamma threshold'
WordWrap = True WordWrap = True
end end
object cmbDepth: TComboBox object cmbDepth: TComboBox

View File

@ -146,7 +146,7 @@ begin
EstimatorMin := 0.0; EstimatorMin := 0.0;
EstimatorCurve := 0.4; EstimatorCurve := 0.4;
Jitters := 1; Jitters := 1;
GammaTreshold := 0.01; GammaTreshold := MainCP.gamma_threshold; //0.01;
GetLocaleFormatSettings(LOCALE_SYSTEM_DEFAULT, FloatFormatSettings); GetLocaleFormatSettings(LOCALE_SYSTEM_DEFAULT, FloatFormatSettings);
txtEstimator.Text := FloatToStr(Estimator, FloatFormatSettings); txtEstimator.Text := FloatToStr(Estimator, FloatFormatSettings);
txtEstimatorMin.Text := FloatToStr(EstimatorMin, FloatFormatSettings); txtEstimatorMin.Text := FloatToStr(EstimatorMin, FloatFormatSettings);
@ -287,7 +287,7 @@ end;
procedure TExportDialog.txtGammaTresholdChange(Sender: TObject); procedure TExportDialog.txtGammaTresholdChange(Sender: TObject);
begin begin
GammaTreshold := 0.01; //GammaTreshold := 0.01;
try try
GammaTreshold := StrToFloat(txtGammaTreshold.Text, FloatFormatSettings); GammaTreshold := StrToFloat(txtGammaTreshold.Text, FloatFormatSettings);
except except

View File

@ -96,13 +96,13 @@ var
EditorBkgColor, ReferenceTriangleColor: integer; EditorBkgColor, ReferenceTriangleColor: integer;
GridColor1, GridColor2, HelpersColor: integer; GridColor1, GridColor2, HelpersColor: integer;
ExtEditEnabled, TransformAxisLock: boolean; ExtEditEnabled, TransformAxisLock: boolean;
DoubleClickSetVars: boolean;
ShowAllXforms: boolean; ShowAllXforms: boolean;
{ Display } { Display }
defSampleDensity, defPreviewDensity: Double; defSampleDensity, defPreviewDensity: Double;
defGamma, defBrightness, defVibrancy, defFilterRadius: Double; defGamma, defBrightness, defVibrancy,
defFilterRadius, defGammaThreshold: Double;
defOversample: integer; defOversample: integer;
{ Render } { Render }

View File

@ -254,6 +254,7 @@ var
gutter_width: integer; gutter_width: integer;
k1, k2: double; k1, k2: double;
area: double; area: double;
frac, funcval: double;
GetBucket: function(x, y: integer): TBucket64 of object; GetBucket: function(x, y: integer): TBucket64 of object;
bucket: TBucket64; bucket: TBucket64;
@ -267,6 +268,9 @@ begin
vib := round(fcp.vibrancy * 256.0); vib := round(fcp.vibrancy * 256.0);
notvib := 256 - vib; notvib := 256 - vib;
if fcp.gamma_threshold <> 0 then
funcval := power(fcp.gamma_threshold, gamma - 1); { / fcp.gamma_threshold; }
bgi[0] := round(fcp.background[0]); bgi[0] := round(fcp.background[0]);
bgi[1] := round(fcp.background[1]); bgi[1] := round(fcp.background[1]);
bgi[2] := round(fcp.background[2]); bgi[2] := round(fcp.background[2]);
@ -352,8 +356,15 @@ begin
Inc(bx, FOversample); Inc(bx, FOversample);
if fcp.Transparency then begin // -------------------------- Transparency if fcp.Transparency then begin // -------------------------- Transparency
// gamma linearization
if (fp[3] > 0.0) then begin if (fp[3] > 0.0) then begin
alpha := power(fp[3], gamma); if fp[3] <= fcp.gamma_threshold then begin
frac := fp[3] / fcp.gamma_threshold;
alpha := (1 - frac) * fp[3] * funcval + frac * power(fp[3], gamma);
end
else
alpha := power(fp[3], gamma);
ls := vib * alpha / fp[3]; ls := vib * alpha / fp[3];
ai := round(alpha * 256); ai := round(alpha * 256);
if (ai <= 0) then goto zero_alpha // ignore all if alpha = 0 if (ai <= 0) then goto zero_alpha // ignore all if alpha = 0
@ -399,7 +410,14 @@ zero_alpha:
end end
else begin // ------------------------------------------- No transparency else begin // ------------------------------------------- No transparency
if (fp[3] > 0.0) then begin if (fp[3] > 0.0) then begin
alpha := power(fp[3], gamma); // gamma linearization
if fp[3] <= fcp.gamma_threshold then begin
frac := fp[3] / fcp.gamma_threshold;
alpha := (1 - frac) * fp[3] * funcval + frac * power(fp[3], gamma);
end
else
alpha := power(fp[3], gamma);
ls := vib * alpha / fp[3]; ls := vib * alpha / fp[3];
ai := round(alpha * 256); ai := round(alpha * 256);
if (ai < 0) then ai := 0 if (ai < 0) then ai := 0

View File

@ -31,7 +31,7 @@ object MainForm: TMainForm
Left = 160 Left = 160
Top = 28 Top = 28
Width = 4 Width = 4
Height = 435 Height = 430
end end
object ToolBar: TToolBar object ToolBar: TToolBar
Left = 0 Left = 0
@ -72,7 +72,6 @@ object MainForm: TMainForm
Left = 69 Left = 69
Top = 0 Top = 0
Width = 8 Width = 8
Caption = 'ToolButton9'
ImageIndex = 8 ImageIndex = 8
Style = tbsSeparator Style = tbsSeparator
end end
@ -98,7 +97,6 @@ object MainForm: TMainForm
Left = 123 Left = 123
Top = 0 Top = 0
Width = 8 Width = 8
Caption = 'ToolButton1'
ImageIndex = 18 ImageIndex = 18
Style = tbsSeparator Style = tbsSeparator
end end
@ -142,7 +140,6 @@ object MainForm: TMainForm
Left = 217 Left = 217
Top = 0 Top = 0
Width = 8 Width = 8
Caption = 'ToolButton3'
ImageIndex = 8 ImageIndex = 8
Style = tbsSeparator Style = tbsSeparator
end end
@ -190,7 +187,6 @@ object MainForm: TMainForm
Left = 340 Left = 340
Top = 0 Top = 0
Width = 8 Width = 8
Caption = 'ToolButton4'
ImageIndex = 14 ImageIndex = 14
Style = tbsSeparator Style = tbsSeparator
end end
@ -222,7 +218,6 @@ object MainForm: TMainForm
Left = 417 Left = 417
Top = 0 Top = 0
Width = 8 Width = 8
Caption = 'ToolButton5'
ImageIndex = 42 ImageIndex = 42
Style = tbsSeparator Style = tbsSeparator
end end
@ -247,7 +242,6 @@ object MainForm: TMainForm
Left = 471 Left = 471
Top = 0 Top = 0
Width = 8 Width = 8
Caption = 'ToolButton6'
ImageIndex = 42 ImageIndex = 42
Style = tbsSeparator Style = tbsSeparator
end end
@ -292,14 +286,12 @@ object MainForm: TMainForm
Style = tbsCheck Style = tbsCheck
OnClick = tbRotateClick OnClick = tbRotateClick
end end
object ToolButton2: TToolButton object tbTraceSeparator: TToolButton
Left = 571 Left = 571
Top = 0 Top = 0
Width = 8 Width = 8
Caption = 'ToolButton2'
ImageIndex = 39 ImageIndex = 39
Style = tbsSeparator Style = tbsSeparator
Visible = False
end end
object tbShowTrace: TToolButton object tbShowTrace: TToolButton
Left = 579 Left = 579
@ -307,7 +299,6 @@ object MainForm: TMainForm
Hint = 'Show trace window' Hint = 'Show trace window'
Caption = 'tbShowTrace' Caption = 'tbShowTrace'
ImageIndex = 38 ImageIndex = 38
Visible = False
OnClick = tbShowTraceClick OnClick = tbShowTraceClick
end end
end end
@ -315,7 +306,7 @@ object MainForm: TMainForm
Left = 0 Left = 0
Top = 28 Top = 28
Width = 160 Width = 160
Height = 435 Height = 430
Align = alLeft Align = alLeft
Columns = < Columns = <
item item
@ -336,7 +327,7 @@ object MainForm: TMainForm
Left = 164 Left = 164
Top = 28 Top = 28
Width = 557 Width = 557
Height = 435 Height = 430
Align = alClient Align = alClient
BevelInner = bvLowered BevelInner = bvLowered
BevelOuter = bvNone BevelOuter = bvNone
@ -347,7 +338,7 @@ object MainForm: TMainForm
Left = 1 Left = 1
Top = 1 Top = 1
Width = 555 Width = 555
Height = 433 Height = 428
Align = alClient Align = alClient
Anchors = [] Anchors = []
Center = True Center = True
@ -361,7 +352,7 @@ object MainForm: TMainForm
end end
object StatusBar: TStatusBar object StatusBar: TStatusBar
Left = 0 Left = 0
Top = 463 Top = 458
Width = 721 Width = 721
Height = 19 Height = 19
Panels = < Panels = <
@ -2918,6 +2909,14 @@ object MainForm: TMainForm
Caption = '-' Caption = '-'
GroupIndex = 2 GroupIndex = 2
end end
object mnuBuiltinVars: TMenuItem
Caption = 'Built-in'
GroupIndex = 2
end
object mnuPluginVars: TMenuItem
Caption = 'Plugins'
GroupIndex = 2
end
end end
object mnuScript: TMenuItem object mnuScript: TMenuItem
Caption = 'Script' Caption = 'Script'

View File

@ -184,6 +184,8 @@ type
tbShowTrace: TToolButton; tbShowTrace: TToolButton;
tbTraceSeparator: TToolButton; tbTraceSeparator: TToolButton;
mnuRenderAll: TMenuItem; mnuRenderAll: TMenuItem;
mnuBuiltinVars: TMenuItem;
mnuPluginVars: TMenuItem;
procedure tbzoomoutwindowClick(Sender: TObject); procedure tbzoomoutwindowClick(Sender: TObject);
procedure mnuimageClick(Sender: TObject); procedure mnuimageClick(Sender: TObject);
procedure mnuExitClick(Sender: TObject); procedure mnuExitClick(Sender: TObject);
@ -1371,6 +1373,9 @@ begin
if cp1.vibrancy <> 1 then if cp1.vibrancy <> 1 then
parameters := parameters + format('vibrancy="%g" ', [cp1.vibrancy]); parameters := parameters + format('vibrancy="%g" ', [cp1.vibrancy]);
if cp1.gamma_threshold <> 0 then
parameters := parameters + format('gamma_threshold="%g" ', [cp1.gamma_threshold]);
if cp1.soloXform >= 0 then if cp1.soloXform >= 0 then
parameters := parameters + format('soloxform="%d" ', [cp1.soloXform]); parameters := parameters + format('soloxform="%d" ', [cp1.soloXform]);
@ -1378,8 +1383,7 @@ begin
format('estimator_radius="%g" ', [cp1.estimator]) + format('estimator_radius="%g" ', [cp1.estimator]) +
format('estimator_minimum="%g" ', [cp1.estimator_min]) + format('estimator_minimum="%g" ', [cp1.estimator_min]) +
format('estimator_curve="%g" ', [cp1.estimator_curve]) + format('estimator_curve="%g" ', [cp1.estimator_curve]) +
format('temporal_samples="%d" ', [cp1.jitters]) + format('temporal_samples="%d" ', [cp1.jitters]);
format('gamma_threshold="%g" ', [cp1.gamma_treshold]);
FileList.Add('<flame name="' + CleanXMLName(cp1.name) + '" ' + parameters + '>'); FileList.Add('<flame name="' + CleanXMLName(cp1.name) + '" ' + parameters + '>');
{ Write transform parameters } { Write transform parameters }
@ -1427,7 +1431,7 @@ begin
FileList := TStringList.Create; FileList := TStringList.Create;
try try
FileList.LoadFromFile(filename); FileList.LoadFromFile(filename);
if pos(title, FileList.Text) <> 0 then Result := true; if pos('<flame name="' + title + '"', FileList.Text) <> 0 then Result := true;
finally finally
FileList.Free; FileList.Free;
end end
@ -1482,10 +1486,10 @@ begin
try try
FileList.LoadFromFile(bakname); FileList.LoadFromFile(bakname);
if Pos(title, FileList.Text) <> 0 then if Pos('<flame name="' + title + '"', FileList.Text) <> 0 then
begin begin
i := 0; i := 0;
while Pos('name="' + title + '"', Trim(FileList[i])) = 0 do while Pos('<flame name="' + title + '"', Trim(FileList[i])) = 0 do
inc(i); inc(i);
p := 0; p := 0;
@ -1526,6 +1530,9 @@ begin
FileList.SaveToFile(filename); FileList.SaveToFile(filename);
finally finally
if FileExists(bakname) and not FileExists(filename) then
RenameFile(bakname, filename);
FileList.Free; FileList.Free;
end; end;
end end
@ -2571,6 +2578,7 @@ begin
maincp.sample_density := defSampleDensity; maincp.sample_density := defSampleDensity;
maincp.spatial_oversample := defOversample; maincp.spatial_oversample := defOversample;
maincp.spatial_filter_radius := defFilterRadius; maincp.spatial_filter_radius := defFilterRadius;
maincp.gamma_threshold := defGammaThreshold;
inc(MainSeed); inc(MainSeed);
RandSeed := MainSeed; RandSeed := MainSeed;
@ -3960,7 +3968,7 @@ begin
cp1.estimator_min := ExportEstimatorMin; cp1.estimator_min := ExportEstimatorMin;
cp1.estimator_curve := ExportEstimatorCurve; cp1.estimator_curve := ExportEstimatorCurve;
cp1.jitters := ExportJitters; cp1.jitters := ExportJitters;
cp1.gamma_treshold := ExportGammaTreshold; cp1.gamma_threshold := ExportGammaTreshold;
FileList.Text := FlameToXML(cp1, true); FileList.Text := FlameToXML(cp1, true);
FileList.SaveToFile(ChangeFileExt(ExportDialog.Filename, '.flame')); FileList.SaveToFile(ChangeFileExt(ExportDialog.Filename, '.flame'));
FileList.Clear; FileList.Clear;
@ -4105,6 +4113,7 @@ begin
else else
Parsecp.cmapindex := -1; Parsecp.cmapindex := -1;
ParseCP.hue_rotation := 1; ParseCP.hue_rotation := 1;
v := Attributes.value('hue'); v := Attributes.value('hue');
if v <> '' then Parsecp.hue_rotation := StrToFloat(v); if v <> '' then Parsecp.hue_rotation := StrToFloat(v);
v := Attributes.Value('brightness'); v := Attributes.Value('brightness');
@ -4112,9 +4121,11 @@ begin
v := Attributes.Value('gamma'); v := Attributes.Value('gamma');
if v <> '' then Parsecp.gamma := StrToFloat(v); if v <> '' then Parsecp.gamma := StrToFloat(v);
v := Attributes.Value('vibrancy'); v := Attributes.Value('vibrancy');
if v <> '' then Parsecp.vibrancy := StrToFloat(v); if v <> '' then Parsecp.vibrancy := StrToFloat(v);
if (LimitVibrancy) and (Parsecp.vibrancy > 1) then Parsecp.vibrancy := 1; if (LimitVibrancy) and (Parsecp.vibrancy > 1) then Parsecp.vibrancy := 1;
v := Attributes.Value('gamma_threshold');
if v <> '' then Parsecp.gamma_threshold := StrToFloat(v)
else Parsecp.gamma_threshold := 0;
v := Attributes.Value('zoom'); v := Attributes.Value('zoom');
if v <> '' then Parsecp.zoom := StrToFloat(v); if v <> '' then Parsecp.zoom := StrToFloat(v);
@ -4841,7 +4852,10 @@ begin
NewMenuItem.GroupIndex := 2; NewMenuItem.GroupIndex := 2;
NewMenuItem.RadioItem := True; NewMenuItem.RadioItem := True;
VarMenus[i] := NewMenuItem; VarMenus[i] := NewMenuItem;
mnuvar.Add(NewMenuItem); if i < NumBuiltinVars then
mnuBuiltinVars.Add(NewMenuItem)
else
mnuPluginVars.Add(NewMenuItem);
end; end;
end; end;

View File

@ -51,8 +51,8 @@ object OptionsForm: TOptionsForm
HelpContext = 1 HelpContext = 1
Caption = 'General' Caption = 'General'
object chkConfirmDel: TCheckBox object chkConfirmDel: TCheckBox
Left = 8 Left = 144
Top = 183 Top = 127
Width = 97 Width = 97
Height = 17 Height = 17
HelpContext = 1005 HelpContext = 1005
@ -61,7 +61,7 @@ object OptionsForm: TOptionsForm
end end
object JPEG: TGroupBox object JPEG: TGroupBox
Left = 8 Left = 8
Top = 124 Top = 118
Width = 121 Width = 121
Height = 55 Height = 55
Caption = 'JPEG Quality' Caption = 'JPEG Quality'
@ -219,13 +219,51 @@ object OptionsForm: TOptionsForm
TabOrder = 2 TabOrder = 2
end end
end end
object GroupBox18: TGroupBox object chkOldPaletteFormat: TCheckBox
Left = 144
Top = 148
Width = 121
Height = 29
Caption = 'Save gradient in old file format'
TabOrder = 4
WordWrap = True
end
object chkConfirmExit: TCheckBox
Left = 144
Top = 183
Width = 81
Height = 17
HelpContext = 1005
Caption = 'Confirm exit'
TabOrder = 5
end
object chkConfirmStopRender: TCheckBox
Left = 144
Top = 210
Width = 121
Height = 17
Caption = 'Confirm stop render'
TabOrder = 6
end
object rgTransparency: TRadioGroup
Left = 8 Left = 8
Top = 64 Top = 176
Width = 121 Width = 121
Height = 57 Height = 57
Caption = 'PNG Transparency'
ItemIndex = 0
Items.Strings = (
'Disabled'
'Enabled')
TabOrder = 7
end
object GroupBox18: TGroupBox
Left = 8
Top = 61
Width = 121
Height = 55
Caption = 'Internal buffer depth' Caption = 'Internal buffer depth'
TabOrder = 4 TabOrder = 8
object cbInternalBitsPerSample: TComboBox object cbInternalBitsPerSample: TComboBox
Left = 16 Left = 16
Top = 20 Top = 20
@ -241,32 +279,6 @@ object OptionsForm: TOptionsForm
'64-bit integer') '64-bit integer')
end end
end end
object chkOldPaletteFormat: TCheckBox
Left = 8
Top = 204
Width = 121
Height = 29
Caption = 'Save gradient in old file format'
TabOrder = 5
WordWrap = True
end
object chkConfirmExit: TCheckBox
Left = 136
Top = 183
Width = 81
Height = 17
HelpContext = 1005
Caption = 'Confirm exit'
TabOrder = 6
end
object chkConfirmStopRender: TCheckBox
Left = 136
Top = 210
Width = 121
Height = 17
Caption = 'Confirm stop render'
TabOrder = 7
end
end end
object EditorPage: TTabSheet object EditorPage: TTabSheet
Caption = 'Editor' Caption = 'Editor'
@ -432,17 +444,6 @@ object OptionsForm: TOptionsForm
TabOrder = 1 TabOrder = 1
end end
end end
object rgDoubleClickVars: TRadioGroup
Left = 160
Top = 144
Width = 273
Height = 57
Caption = 'Double-click on variation'
Items.Strings = (
'Reset value to zero'
'Reset value to zero, if zero set to "1"')
TabOrder = 3
end
end end
object DisplayPage: TTabSheet object DisplayPage: TTabSheet
Caption = 'Display' Caption = 'Display'
@ -507,105 +508,116 @@ object OptionsForm: TOptionsForm
Caption = 'Rendering' Caption = 'Rendering'
TabOrder = 0 TabOrder = 0
object lblSampleDensity: TLabel object lblSampleDensity: TLabel
Left = 40 Left = 56
Top = 19 Top = 19
Width = 38 Width = 41
Height = 13 Height = 13
Alignment = taRightJustify
Caption = 'Quality:' Caption = 'Quality:'
end end
object lblGamma: TLabel object lblGamma: TLabel
Left = 40 Left = 56
Top = 43 Top = 43
Width = 39 Width = 41
Height = 13 Height = 13
Alignment = taRightJustify
Caption = 'Gamma:' Caption = 'Gamma:'
end end
object lblBrightness: TLabel object lblBrightness: TLabel
Left = 24 Left = 40
Top = 67 Top = 67
Width = 54 Width = 57
Height = 13 Height = 13
Alignment = taRightJustify
Caption = 'Brightness:' Caption = 'Brightness:'
end end
object lblVibrancy: TLabel object lblVibrancy: TLabel
Left = 32 Left = 48
Top = 91 Top = 91
Width = 45 Width = 49
Height = 13 Height = 13
Alignment = taRightJustify
Caption = 'Vibrancy:' Caption = 'Vibrancy:'
end end
object lblOversample: TLabel object lblOversample: TLabel
Left = 16 Left = 32
Top = 115 Top = 139
Width = 61 Width = 65
Height = 13 Height = 13
Alignment = taRightJustify
Caption = 'Oversample:' Caption = 'Oversample:'
end end
object lblFilterRadius: TLabel object lblFilterRadius: TLabel
Left = 16 Left = 32
Top = 139 Top = 163
Width = 63 Width = 65
Height = 13 Height = 13
Alignment = taRightJustify
Caption = 'Filter Radius:' Caption = 'Filter Radius:'
end end
object lblGammaThreshold: TLabel
Left = 8
Top = 115
Width = 89
Height = 14
Alignment = taRightJustify
Caption = 'Gamma threshold:'
WordWrap = True
end
object txtSampleDensity: TEdit object txtSampleDensity: TEdit
Left = 88 Left = 104
Top = 16 Top = 16
Width = 65 Width = 49
Height = 21 Height = 21
HelpContext = 1006 HelpContext = 1006
TabOrder = 0 TabOrder = 0
end end
object txtGamma: TEdit object txtGamma: TEdit
Left = 88 Left = 104
Top = 40 Top = 40
Width = 65 Width = 49
Height = 21 Height = 21
HelpContext = 1007 HelpContext = 1007
TabOrder = 1 TabOrder = 1
end end
object txtBrightness: TEdit object txtBrightness: TEdit
Left = 88 Left = 104
Top = 64 Top = 64
Width = 65 Width = 49
Height = 21 Height = 21
HelpContext = 1008 HelpContext = 1008
TabOrder = 2 TabOrder = 2
end end
object txtVibrancy: TEdit object txtVibrancy: TEdit
Left = 88 Left = 104
Top = 88 Top = 88
Width = 65 Width = 49
Height = 21 Height = 21
HelpContext = 1009 HelpContext = 1009
TabOrder = 3 TabOrder = 3
end end
object txtOversample: TEdit object txtOversample: TEdit
Left = 88 Left = 104
Top = 112 Top = 136
Width = 65 Width = 49
Height = 21 Height = 21
HelpContext = 1010 HelpContext = 1010
TabOrder = 4 TabOrder = 4
end end
object txtFilterRadius: TEdit object txtFilterRadius: TEdit
Left = 88 Left = 104
Top = 136 Top = 160
Width = 65 Width = 49
Height = 21 Height = 21
HelpContext = 1011 HelpContext = 1011
TabOrder = 5 TabOrder = 5
end end
object rgTransparency: TRadioGroup object txtGammaThreshold: TEdit
Left = 8 Left = 104
Top = 160 Top = 112
Width = 153 Width = 49
Height = 61 Height = 21
Caption = 'PNG Transparency' HelpContext = 1011
ItemIndex = 0
Items.Strings = (
'Disabled'
'Enabled')
TabOrder = 6 TabOrder = 6
end end
end end

View File

@ -200,20 +200,16 @@ type
chkPlaysound: TCheckBox; chkPlaysound: TCheckBox;
btnPlay: TSpeedButton; btnPlay: TSpeedButton;
Label44: TLabel; Label44: TLabel;
GroupBox18: TGroupBox;
cbInternalBitsPerSample: TComboBox;
GroupBox20: TGroupBox; GroupBox20: TGroupBox;
chkShowTransparency: TCheckBox; chkShowTransparency: TCheckBox;
chkExtendMainPreview: TCheckBox; chkExtendMainPreview: TCheckBox;
Label48: TLabel; Label48: TLabel;
rgTransparency: TRadioGroup;
cbExtendPercent: TComboBox; cbExtendPercent: TComboBox;
chkShowRenderStats: TCheckBox; chkShowRenderStats: TCheckBox;
rgRotationMode: TRadioGroup; rgRotationMode: TRadioGroup;
GroupBox21: TGroupBox; GroupBox21: TGroupBox;
chkAxisLock: TCheckBox; chkAxisLock: TCheckBox;
chkExtendedEdit: TCheckBox; chkExtendedEdit: TCheckBox;
rgDoubleClickVars: TRadioGroup;
chkOldPaletteFormat: TCheckBox; chkOldPaletteFormat: TCheckBox;
rgZoomingMode: TRadioGroup; rgZoomingMode: TRadioGroup;
chkShowAllXforms: TCheckBox; chkShowAllXforms: TCheckBox;
@ -221,6 +217,11 @@ type
btnGradientsFile: TSpeedButton; btnGradientsFile: TSpeedButton;
chkConfirmExit: TCheckBox; chkConfirmExit: TCheckBox;
chkConfirmStopRender: TCheckBox; chkConfirmStopRender: TCheckBox;
rgTransparency: TRadioGroup;
GroupBox18: TGroupBox;
cbInternalBitsPerSample: TComboBox;
txtGammaThreshold: TEdit;
lblGammaThreshold: TLabel;
procedure btnCancelClick(Sender: TObject); procedure btnCancelClick(Sender: TObject);
procedure FormShow(Sender: TObject); procedure FormShow(Sender: TObject);
procedure btnOKClick(Sender: TObject); procedure btnOKClick(Sender: TObject);
@ -332,8 +333,6 @@ begin
chkHelpers.Checked := HelpersEnabled; chkHelpers.Checked := HelpersEnabled;
chkExtendedEdit.Checked := ExtEditEnabled; chkExtendedEdit.Checked := ExtEditEnabled;
chkAxisLock.Checked := TransformAxisLock; chkAxisLock.Checked := TransformAxisLock;
if DoubleClickSetVars then rgDoubleClickVars.ItemIndex := 1
else rgDoubleClickVars.ItemIndex := 0;
chkShowAllXforms.Checked := ShowAllXforms; chkShowAllXforms.Checked := ShowAllXforms;
{ Display tab } { Display tab }
@ -343,6 +342,8 @@ begin
txtVibrancy.Text := FloatToStr(defVibrancy); txtVibrancy.Text := FloatToStr(defVibrancy);
txtOversample.Text := IntToStr(defOversample); txtOversample.Text := IntToStr(defOversample);
txtFilterRadius.Text := FloatToStr(defFilterRadius); txtFilterRadius.Text := FloatToStr(defFilterRadius);
txtGammaThreshold.Text := FloatToStr(defGammaThreshold);
txtLowQuality.Text := FloatToStr(prevLowQuality); txtLowQuality.Text := FloatToStr(prevLowQuality);
txtMediumQuality.Text := FloatToStr(prevMediumQuality); txtMediumQuality.Text := FloatToStr(prevMediumQuality);
txtHighQuality.Text := FloatToStr(prevHighQuality); txtHighQuality.Text := FloatToStr(prevHighQuality);
@ -471,7 +472,6 @@ begin
ExtEditEnabled := chkExtendedEdit.Checked; ExtEditEnabled := chkExtendedEdit.Checked;
TransformAxisLock := chkAxisLock.Checked; TransformAxisLock := chkAxisLock.Checked;
DoubleClickSetVars := rgDoubleClickVars.ItemIndex <> 0;
{ Display tab } { Display tab }
defSampleDensity := StrToFloat(txtSampleDensity.Text); defSampleDensity := StrToFloat(txtSampleDensity.Text);
@ -485,6 +485,8 @@ begin
if defVibrancy < 0 then defVibrancy := 0.1; if defVibrancy < 0 then defVibrancy := 0.1;
defFilterRadius := StrToFloat(txtFilterRadius.Text); defFilterRadius := StrToFloat(txtFilterRadius.Text);
if defFilterRadius <= 0 then defFilterRadius := 0.1; if defFilterRadius <= 0 then defFilterRadius := 0.1;
defGammaThreshold := StrToFloat(txtGammaThreshold.Text);
if defGammaThreshold < 0 then defGammaThreshold := 0;
defOversample := StrToInt(txtOversample.Text); defOversample := StrToInt(txtOversample.Text);
if defOversample > 4 then defOversample := 4; if defOversample > 4 then defOversample := 4;
if defOversample < 1 then defOversample := 1; if defOversample < 1 then defOversample := 1;
@ -492,10 +494,10 @@ begin
if prevLowQuality > 100 then prevLowQuality := 100; if prevLowQuality > 100 then prevLowQuality := 100;
if prevLowQuality < 0.01 then prevLowQuality := 0.01; if prevLowQuality < 0.01 then prevLowQuality := 0.01;
prevMediumQuality := StrToFloat(txtMediumQuality.Text); prevMediumQuality := StrToFloat(txtMediumQuality.Text);
if prevMediumQuality > 100 then prevMediumQuality := 100; if prevMediumQuality > 1000 then prevMediumQuality := 1000;
if prevMediumQuality < 0.01 then prevMediumQuality := 0.01; if prevMediumQuality < 0.01 then prevMediumQuality := 0.01;
prevHighQuality := StrToFloat(txtHighQuality.Text); prevHighQuality := StrToFloat(txtHighQuality.Text);
if prevHighQuality > 100 then prevHighQuality := 100; if prevHighQuality > 10000 then prevHighQuality := 10000;
if prevHighQuality < 0.01 then prevHighQuality := 0.01; if prevHighQuality < 0.01 then prevHighQuality := 0.01;
MainPreviewScale := 1 + 0.02 * StrToFloatDef(cbExtendPercent.Text, 0); MainPreviewScale := 1 + 0.02 * StrToFloatDef(cbExtendPercent.Text, 0);

View File

@ -79,6 +79,7 @@ begin
begin begin
SavePath := DefaultPath + 'Parameters\My Flames.flame'; SavePath := DefaultPath + 'Parameters\My Flames.flame';
end; end;
if Registry.ValueExists('SmoothPaletteFile') then if Registry.ValueExists('SmoothPaletteFile') then
begin begin
defSmoothPaletteFile := Registry.ReadString('SmoothPaletteFIle'); defSmoothPaletteFile := Registry.ReadString('SmoothPaletteFIle');
@ -143,9 +144,11 @@ begin
begin begin
TryLength := 100000; TryLength := 100000;
end; end;
if Registry.ValueExists('MinTransforms') then if Registry.ValueExists('MinTransforms') then
begin begin
randMinTransforms := Registry.ReadInteger('MinTransforms'); randMinTransforms := Registry.ReadInteger('MinTransforms');
if randMinTransforms <= 0 then randMinTransforms := 2;
end end
else else
begin begin
@ -154,14 +157,17 @@ begin
if Registry.ValueExists('MaxTransforms') then if Registry.ValueExists('MaxTransforms') then
begin begin
randMaxTransforms := Registry.ReadInteger('MaxTransforms'); randMaxTransforms := Registry.ReadInteger('MaxTransforms');
if randMaxTransforms < randMinTransforms then randMaxTransforms := randMinTransforms;
end end
else else
begin begin
randMaxTransforms := 3; randMaxTransforms := randMinTransforms + 1;
end; end;
if Registry.ValueExists('MutationMinTransforms') then if Registry.ValueExists('MutationMinTransforms') then
begin begin
mutantMinTransforms := Registry.ReadInteger('MutationMinTransforms'); mutantMinTransforms := Registry.ReadInteger('MutationMinTransforms');
if mutantMinTransforms <= 0 then mutantMinTransforms := 2;
end end
else else
begin begin
@ -170,11 +176,13 @@ begin
if Registry.ValueExists('MutationMaxTransforms') then if Registry.ValueExists('MutationMaxTransforms') then
begin begin
mutantMaxTransforms := Registry.ReadInteger('MutationMaxTransforms'); mutantMaxTransforms := Registry.ReadInteger('MutationMaxTransforms');
if mutantMaxTransforms < mutantMinTransforms then mutantMinTransforms := mutantMinTransforms;
end end
else else
begin begin
mutantMaxTransforms := 6; mutantMaxTransforms := mutantMinTransforms + 1;
end; end;
if Registry.ValueExists('RandomGradient') then if Registry.ValueExists('RandomGradient') then
begin begin
randGradient := Registry.ReadInteger('RandomGradient'); randGradient := Registry.ReadInteger('RandomGradient');
@ -242,6 +250,7 @@ begin
if Registry.ValueExists('MutatePreviewQaulity') then if Registry.ValueExists('MutatePreviewQaulity') then
begin begin
MutatePrevQual := Registry.ReadInteger('MutatePreviewQaulity'); MutatePrevQual := Registry.ReadInteger('MutatePreviewQaulity');
if MutatePrevQual <= 0 then MutatePrevQual := 1;
end end
else else
begin begin
@ -250,6 +259,7 @@ begin
if Registry.ValueExists('AdjustPreviewQaulity') then if Registry.ValueExists('AdjustPreviewQaulity') then
begin begin
AdjustPrevQual := Registry.ReadInteger('AdjustPreviewQaulity'); AdjustPrevQual := Registry.ReadInteger('AdjustPreviewQaulity');
if AdjustPrevQual <= 0 then AdjustPrevQual := 1;
end end
else else
begin begin
@ -321,6 +331,7 @@ begin
if Registry.ValueExists('MinNodes') then if Registry.ValueExists('MinNodes') then
begin begin
MinNodes := Registry.ReadInteger('MinNodes'); MinNodes := Registry.ReadInteger('MinNodes');
if MinNodes < 2 then MinNodes := 2;
end end
else else
begin begin
@ -353,6 +364,7 @@ begin
if Registry.ValueExists('MaxNodes') then if Registry.ValueExists('MaxNodes') then
begin begin
MaxNodes := Registry.ReadInteger('MaxNodes'); MaxNodes := Registry.ReadInteger('MaxNodes');
if MaxNodes < MinNodes then MaxNodes := MinNodes;
end end
else else
begin begin
@ -361,6 +373,7 @@ begin
if Registry.ValueExists('MaxHue') then if Registry.ValueExists('MaxHue') then
begin begin
MaxHue := Registry.ReadInteger('MaxHue'); MaxHue := Registry.ReadInteger('MaxHue');
if MaxHue < 0 then MaxHue := 0;
end end
else else
begin begin
@ -369,6 +382,7 @@ begin
if Registry.ValueExists('MaxSat') then if Registry.ValueExists('MaxSat') then
begin begin
MaxSat := Registry.ReadInteger('MaxSat'); MaxSat := Registry.ReadInteger('MaxSat');
if MaxSat < 0 then MaxSat := 0;
end end
else else
begin begin
@ -382,9 +396,11 @@ begin
begin begin
randGradientFile := '' randGradientFile := ''
end; end;
if Registry.ValueExists('ReferenceMode') then if Registry.ValueExists('ReferenceMode') then
ReferenceMode := Registry.ReadInteger('ReferenceMode') ReferenceMode := Registry.ReadInteger('ReferenceMode')
else ReferenceMode := 0; else ReferenceMode := 0;
if Registry.ValueExists('RotationMode') then if Registry.ValueExists('RotationMode') then
MainForm_RotationMode := Registry.ReadInteger('RotationMode') MainForm_RotationMode := Registry.ReadInteger('RotationMode')
else MainForm_RotationMode := 0; else MainForm_RotationMode := 0;
@ -392,6 +408,7 @@ begin
if Registry.ValueExists('MaxLum') then if Registry.ValueExists('MaxLum') then
begin begin
MaxLum := Registry.ReadInteger('MaxLum'); MaxLum := Registry.ReadInteger('MaxLum');
if MaxLum < 0 then MaxLum := 0;
end end
else else
begin begin
@ -400,6 +417,7 @@ begin
if Registry.ValueExists('BatchSize') then if Registry.ValueExists('BatchSize') then
begin begin
BatchSize := Registry.ReadInteger('BatchSize'); BatchSize := Registry.ReadInteger('BatchSize');
if BatchSize <= 0 then BatchSize := 10;
end end
else else
begin begin
@ -432,6 +450,7 @@ begin
if Registry.ValueExists('ExportWidth') then if Registry.ValueExists('ExportWidth') then
begin begin
ExportWidth := Registry.ReadInteger('ExportWidth'); ExportWidth := Registry.ReadInteger('ExportWidth');
if ExportWidth <= 0 then ExportWidth := 640;
end end
else else
begin begin
@ -440,6 +459,7 @@ begin
if Registry.ValueExists('ExportHeight') then if Registry.ValueExists('ExportHeight') then
begin begin
ExportHeight := Registry.ReadInteger('ExportHeight'); ExportHeight := Registry.ReadInteger('ExportHeight');
if ExportHeight <= 0 then ExportHeight := 480;
end end
else else
begin begin
@ -448,6 +468,7 @@ begin
if Registry.ValueExists('ExportDensity') then if Registry.ValueExists('ExportDensity') then
begin begin
ExportDensity := Registry.ReadFloat('ExportDensity'); ExportDensity := Registry.ReadFloat('ExportDensity');
if ExportDensity <= 0 then ExportDensity := 100;
end end
else else
begin begin
@ -456,6 +477,7 @@ begin
if Registry.ValueExists('ExportOversample') then if Registry.ValueExists('ExportOversample') then
begin begin
ExportOversample := Registry.ReadInteger('ExportOversample'); ExportOversample := Registry.ReadInteger('ExportOversample');
if ExportOversample <= 0 then ExportOversample := 2;
end end
else else
begin begin
@ -464,6 +486,7 @@ begin
if Registry.ValueExists('ExportFilter') then if Registry.ValueExists('ExportFilter') then
begin begin
ExportFilter := Registry.ReadFloat('ExportFilter'); ExportFilter := Registry.ReadFloat('ExportFilter');
if ExportFilter <= 0 then ExportFilter := 0.6;
end end
else else
begin begin
@ -472,6 +495,7 @@ begin
if Registry.ValueExists('ExportBatches') then if Registry.ValueExists('ExportBatches') then
begin begin
ExportBatches := Registry.ReadInteger('ExportBatches'); ExportBatches := Registry.ReadInteger('ExportBatches');
if ExportBatches <= 0 then ExportBatches := 3;
end end
else else
begin begin
@ -571,11 +595,13 @@ begin
if Registry.ValueExists('NrTreads') then begin if Registry.ValueExists('NrTreads') then begin
NrTreads := Registry.ReadInteger('NrTreads'); NrTreads := Registry.ReadInteger('NrTreads');
if NrTreads <= 0 then NrTreads := 1;
end else begin end else begin
NrTreads := 1; NrTreads := 1;
end; end;
if Registry.ValueExists('UseNrThreads') then begin if Registry.ValueExists('UseNrThreads') then begin
UseNrThreads := Registry.ReadInteger('UseNrThreads'); UseNrThreads := Registry.ReadInteger('UseNrThreads');
if UseNrThreads <= 0 then UseNrThreads := 1;
end else begin end else begin
UseNrThreads := 1; UseNrThreads := 1;
end; end;
@ -720,9 +746,6 @@ begin
if Registry.ValueExists('LockTransformAxis') then if Registry.ValueExists('LockTransformAxis') then
TransformAxisLock := Registry.ReadBool('LockTransformAxis') TransformAxisLock := Registry.ReadBool('LockTransformAxis')
else TransformAxisLock := true; else TransformAxisLock := true;
if Registry.ValueExists('DoubleClickSetVars') then
DoubleClickSetVars := Registry.ReadBool('DoubleClickSetVars')
else DoubleClickSetVars := true;
end end
else begin else begin
UseTransformColors := false; UseTransformColors := false;
@ -735,7 +758,6 @@ begin
ReferenceTriangleColor := integer(clGray); ReferenceTriangleColor := integer(clGray);
ExtEditEnabled := true; ExtEditEnabled := true;
TransformAxisLock := true; TransformAxisLock := true;
DoubleClickSetVars := true;
end; end;
Registry.CloseKey; Registry.CloseKey;
@ -952,6 +974,14 @@ begin
begin begin
defFilterRadius := 0.2; defFilterRadius := 0.2;
end; end;
if Registry.ValueExists('GammaThreshold') then
begin
defGammaThreshold := Registry.ReadFloat('GammaThreshold');
end
else
begin
defGammaThreshold := 0.01;
end;
if Registry.ValueExists('Oversample') then if Registry.ValueExists('Oversample') then
begin begin
defOversample := Registry.ReadInteger('Oversample'); defOversample := Registry.ReadInteger('Oversample');
@ -1001,6 +1031,7 @@ begin
defVibrancy := 1; defVibrancy := 1;
defFilterRadius := 0.2; defFilterRadius := 0.2;
defOversample := 1; defOversample := 1;
defGammaThreshold := 0.01;
defPreviewDensity := 0.5; defPreviewDensity := 0.5;
prevLowQuality := 0.1; prevLowQuality := 0.1;
prevMediumQuality := 1; prevMediumQuality := 1;
@ -1132,7 +1163,6 @@ begin
Registry.WriteInteger('ReferenceTriangleColor', ReferenceTriangleColor); Registry.WriteInteger('ReferenceTriangleColor', ReferenceTriangleColor);
Registry.WriteBool('ExtendedEdit', ExtEditEnabled); Registry.WriteBool('ExtendedEdit', ExtEditEnabled);
Registry.WriteBool('LockTransformAxis', TransformAxisLock); Registry.WriteBool('LockTransformAxis', TransformAxisLock);
Registry.WriteBool('DoubleClickSetVars', DoubleClickSetVars);
end; end;
Registry.CloseKey; Registry.CloseKey;
@ -1145,6 +1175,7 @@ begin
Registry.WriteFloat('Vibrancy', defVibrancy); Registry.WriteFloat('Vibrancy', defVibrancy);
Registry.WriteFloat('FilterRadius', defFilterRadius); Registry.WriteFloat('FilterRadius', defFilterRadius);
Registry.WriteInteger('Oversample', defOversample); Registry.WriteInteger('Oversample', defOversample);
Registry.WriteFloat('GammaThreshold', defGammaThreshold);
Registry.WriteFloat('PreviewDensity', defPreviewDensity); Registry.WriteFloat('PreviewDensity', defPreviewDensity);
Registry.WriteFloat('PreviewLowQuality', prevLowQuality); Registry.WriteFloat('PreviewLowQuality', prevLowQuality);
Registry.WriteFloat('PreviewMediumQuality', prevMediumQuality); Registry.WriteFloat('PreviewMediumQuality', prevMediumQuality);

View File

@ -1,6 +1,7 @@
{ {
Apophysis Copyright (C) 2001-2004 Mark Townsend Apophysis Copyright (C) 2001-2004 Mark Townsend
Apophysis Copyright (C) 2005-2006 Ronald Hordijk, Piotr Borys, Peter Sdobnov Apophysis Copyright (C) 2005-2006 Ronald Hordijk, Piotr Borys, Peter Sdobnov
Apophysis Copyright (C) 2007-2008 Piotr Borys, Peter Sdobnov
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -16,8 +17,11 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
} }
unit Tracer; unit Tracer;
//{$define TRACEFORM_HIDDEN}
interface interface
uses uses
@ -70,8 +74,6 @@ procedure TTraceForm.FormCreate(Sender: TObject);
var var
Registry: TRegistry; Registry: TRegistry;
begin begin
TraceLevel := 0; // Tracer disabled in release version
{ Read position from registry } { Read position from registry }
Registry := TRegistry.Create; Registry := TRegistry.Create;
try try
@ -87,8 +89,21 @@ begin
if Registry.ValueExists('Height') then if Registry.ValueExists('Height') then
self.Height := Registry.ReadInteger('Height'); self.Height := Registry.ReadInteger('Height');
// if Registry.ValueExists('TraceLevel') then {$ifndef TRACEFORM_HIDDEN}
// TraceLevel := Registry.ReadInteger('TraceLevel');
if Registry.ValueExists('TraceLevel') then
TraceLevel := Registry.ReadInteger('TraceLevel')
else
TraceLevel := 0;
{$else} // Tracer disabled in release version
TraceLevel := 0;
MainForm.tbShowTrace.Visible := false;
MainForm.tbTraceSeparator.Visible := false;
{$endif}
end; end;
Registry.CloseKey; Registry.CloseKey;
finally finally

View File

@ -33,13 +33,11 @@ const
type type
TCPpoint = record TCPpoint = record
x, y, c: double; x, y, c: double;
//invisible: boolean;
end; end;
PCPpoint = ^TCPpoint; PCPpoint = ^TCPpoint;
TXYpoint = record TXYpoint = record
x, y: double; x, y: double;
//skip: boolean;
end; end;
PXYpoint = ^TXYpoint; PXYpoint = ^TXYpoint;
@ -66,7 +64,6 @@ type
postXswap: boolean; postXswap: boolean;
noPlot: boolean; noPlot: boolean;
//RetraceXform: boolean;
// nx,ny,x,y: double; // nx,ny,x,y: double;
// script: TatPascalScripter; // script: TatPascalScripter;
@ -1909,9 +1906,6 @@ begin
px := FPx; px := FPx;
py := FPy; py := FPy;
// if PlotMode <> keepPlot then
// skip := (PlotMode = neverPlot);
end; end;
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -2147,7 +2141,6 @@ begin
modWeights[i] := xform.modWeights[i]; modWeights[i] := xform.modWeights[i];
noPlot := xform.noPlot; noPlot := xform.noPlot;
//RetraceXform := xform.RetraceXform;
end; end;
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -2192,10 +2185,7 @@ begin
Result := Result + '" '; Result := Result + '" ';
end; end;
// if RetraceXform then if noPlot = true then
// Result := Result + 'plotmode="retrace" '
// else
if noPlot then
Result := Result + 'plotmode="off" '; Result := Result + 'plotmode="off" ';
Result := Result + '/>'; Result := Result + '/>';