utak3r's fixes for FormExport

This commit is contained in:
zueuk 2006-04-05 11:02:26 +00:00
parent 4f76d9b2a3
commit df7d8bc7f0
2 changed files with 68 additions and 104 deletions

View File

@ -3,7 +3,7 @@ object ExportDialog: TExportDialog
Top = 276 Top = 276
BorderStyle = bsDialog BorderStyle = bsDialog
Caption = 'Export Flame' Caption = 'Export Flame'
ClientHeight = 325 ClientHeight = 292
ClientWidth = 419 ClientWidth = 419
Color = clBtnFace Color = clBtnFace
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
@ -100,7 +100,6 @@ object ExportDialog: TExportDialog
Width = 281 Width = 281
Height = 21 Height = 21
TabOrder = 0 TabOrder = 0
Text = 'txtFilename'
end end
end end
object GroupBox3: TGroupBox object GroupBox3: TGroupBox
@ -216,7 +215,10 @@ object ExportDialog: TExportDialog
'1024' '1024'
'1280' '1280'
'1600' '1600'
'2048') '1920'
'2048'
'2560'
'3200')
end end
object cbHeight: TComboBox object cbHeight: TComboBox
Left = 112 Left = 112
@ -234,32 +236,27 @@ object ExportDialog: TExportDialog
'768' '768'
'1024' '1024'
'1200' '1200'
'2048') '2048'
'2400')
end end
end end
object GroupBox4: TGroupBox object GroupBox4: TGroupBox
Left = 8 Left = 8
Top = 176 Top = 176
Width = 313 Width = 313
Height = 145 Height = 113
Caption = ' flam3 parameters ' Caption = ' flam3 parameters '
TabOrder = 5 TabOrder = 5
object Label6: TLabel
Left = 10
Top = 23
Width = 42
Height = 13
Caption = 'Batches:'
end
object Label7: TLabel object Label7: TLabel
Left = 152 Left = 8
Top = 23 Top = 23
Width = 61 Width = 31
Height = 13 Height = 26
Caption = 'Buffer depth:' Caption = 'Buffer depth:'
WordWrap = True
end end
object Label8: TLabel object Label8: TLabel
Left = 10 Left = 8
Top = 55 Top = 55
Width = 29 Width = 29
Height = 13 Height = 13
@ -268,14 +265,14 @@ object ExportDialog: TExportDialog
object Label9: TLabel object Label9: TLabel
Left = 8 Left = 8
Top = 80 Top = 80
Width = 49 Width = 46
Height = 25 Height = 26
Caption = 'Estimator radius' Caption = 'Estimator radius'
WordWrap = True WordWrap = True
end end
object Label11: TLabel object Label11: TLabel
Left = 8 Left = 160
Top = 112 Top = 80
Width = 46 Width = 46
Height = 26 Height = 26
Caption = 'Estimator min.' Caption = 'Estimator min.'
@ -283,68 +280,41 @@ object ExportDialog: TExportDialog
end end
object Label12: TLabel object Label12: TLabel
Left = 160 Left = 160
Top = 80 Top = 48
Width = 46 Width = 46
Height = 26 Height = 26
Caption = 'Estimator curve' Caption = 'Estimator curve'
WordWrap = True WordWrap = True
end end
object Label13: TLabel
Left = 160
Top = 112
Width = 47
Height = 26
Caption = 'Temporal samples'
WordWrap = True
end
object Label14: TLabel object Label14: TLabel
Left = 160 Left = 160
Top = 48 Top = 16
Width = 57 Width = 39
Height = 26 Height = 26
Caption = 'Gamma tresholds' Caption = 'Gamma treshold'
WordWrap = True WordWrap = True
end end
object txtBatches: TEdit
Left = 64
Top = 20
Width = 57
Height = 21
TabOrder = 0
Text = '1'
OnChange = txtBatchesChange
end
object udBatches: TUpDown
Left = 121
Top = 20
Width = 12
Height = 21
Associate = txtBatches
Min = 1
Max = 10000
Position = 1
TabOrder = 1
end
object cmbDepth: TComboBox object cmbDepth: TComboBox
Left = 224 Left = 64
Top = 20 Top = 20
Width = 73 Width = 73
Height = 21 Height = 21
Style = csDropDownList Style = csDropDownList
ItemHeight = 13 ItemHeight = 13
TabOrder = 2 TabOrder = 0
OnChange = cmbDepthChange OnChange = cmbDepthChange
Items.Strings = ( Items.Strings = (
'16 bits' '16-bit'
'32 bits' '32-bit'
'64 bits') '32-bit float'
'64-bit')
end end
object txtStrips: TEdit object txtStrips: TEdit
Left = 64 Left = 64
Top = 52 Top = 52
Width = 57 Width = 57
Height = 21 Height = 21
TabOrder = 3 TabOrder = 1
Text = '1' Text = '1'
OnChange = txtBatchesChange OnChange = txtBatchesChange
end end
@ -357,57 +327,48 @@ object ExportDialog: TExportDialog
Min = 1 Min = 1
Max = 512 Max = 512
Position = 1 Position = 1
TabOrder = 4 TabOrder = 2
end
object txtJitters: TEdit
Left = 224
Top = 116
Width = 57
Height = 21
TabOrder = 5
Text = '1'
OnChange = txtJittersChange
end end
object txtEstimator: TEdit object txtEstimator: TEdit
Left = 64 Left = 64
Top = 84 Top = 84
Width = 57 Width = 57
Height = 21 Height = 21
TabOrder = 6 TabOrder = 3
Text = '5' Text = '5'
OnChange = txtEstimatorChange OnChange = txtEstimatorChange
end end
object txtEstimatorMin: TEdit object txtEstimatorMin: TEdit
Left = 64 Left = 224
Top = 116 Top = 84
Width = 57 Width = 57
Height = 21 Height = 21
TabOrder = 7 TabOrder = 4
Text = '0' Text = '0'
OnChange = txtEstimatorMinChange OnChange = txtEstimatorMinChange
end end
object txtEstimatorCurve: TEdit object txtEstimatorCurve: TEdit
Left = 224
Top = 84
Width = 57
Height = 21
TabOrder = 8
Text = '0.6'
OnChange = txtEstimatorCurveChange
end
object txtGammaTresholds: TEdit
Left = 224 Left = 224
Top = 52 Top = 52
Width = 57 Width = 57
Height = 21 Height = 21
TabOrder = 9 TabOrder = 5
Text = '0.6'
OnChange = txtEstimatorCurveChange
end
object txtGammaTreshold: TEdit
Left = 224
Top = 20
Width = 57
Height = 21
TabOrder = 6
Text = '0.01' Text = '0.01'
OnChange = txtGammaTresholdsChange OnChange = txtGammaTresholdChange
end end
end end
object chkRender: TCheckBox object chkRender: TCheckBox
Left = 328 Left = 328
Top = 302 Top = 270
Width = 65 Width = 65
Height = 17 Height = 17
Caption = 'Render' Caption = 'Render'
@ -420,7 +381,7 @@ object ExportDialog: TExportDialog
Filter = Filter =
'JPEG Image (*.jpg)|*.jpg|PPM Image (*.ppm)|*.ppm|PNG Images (*.p' + 'JPEG Image (*.jpg)|*.jpg|PPM Image (*.ppm)|*.ppm|PNG Images (*.p' +
'ng)|*.png' 'ng)|*.png'
Left = 392 Left = 376
Top = 24 Top = 48
end end
end end

View File

@ -1,5 +1,6 @@
{ {
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
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
@ -47,9 +48,6 @@ type
cbWidth: TComboBox; cbWidth: TComboBox;
cbHeight: TComboBox; cbHeight: TComboBox;
GroupBox4: TGroupBox; GroupBox4: TGroupBox;
Label6: TLabel;
txtBatches: TEdit;
udBatches: TUpDown;
Label7: TLabel; Label7: TLabel;
cmbDepth: TComboBox; cmbDepth: TComboBox;
chkRender: TCheckBox; chkRender: TCheckBox;
@ -59,13 +57,11 @@ type
Label9: TLabel; Label9: TLabel;
Label11: TLabel; Label11: TLabel;
Label12: TLabel; Label12: TLabel;
Label13: TLabel;
txtJitters: TEdit;
txtEstimator: TEdit; txtEstimator: TEdit;
txtEstimatorMin: TEdit; txtEstimatorMin: TEdit;
txtEstimatorCurve: TEdit; txtEstimatorCurve: TEdit;
Label14: TLabel; Label14: TLabel;
txtGammaTresholds: TEdit; txtGammaTreshold: TEdit;
procedure btnBrowseClick(Sender: TObject); procedure btnBrowseClick(Sender: TObject);
procedure FormShow(Sender: TObject); procedure FormShow(Sender: TObject);
procedure btnOKClick(Sender: TObject); procedure btnOKClick(Sender: TObject);
@ -81,7 +77,7 @@ type
procedure txtEstimatorMinChange(Sender: TObject); procedure txtEstimatorMinChange(Sender: TObject);
procedure txtEstimatorCurveChange(Sender: TObject); procedure txtEstimatorCurveChange(Sender: TObject);
procedure txtJittersChange(Sender: TObject); procedure txtJittersChange(Sender: TObject);
procedure txtGammaTresholdsChange(Sender: TObject); procedure txtGammaTresholdChange(Sender: TObject);
private private
FloatFormatSettings: TFormatSettings; FloatFormatSettings: TFormatSettings;
public public
@ -89,7 +85,7 @@ type
ImageWidth, ImageHeight, Oversample, Batches, Strips: Integer; ImageWidth, ImageHeight, Oversample, Batches, Strips: Integer;
Sample_Density, Filter_Radius: double; Sample_Density, Filter_Radius: double;
Estimator, EstimatorMin, EstimatorCurve: double; Estimator, EstimatorMin, EstimatorCurve: double;
GammaTresholds: double; GammaTreshold: double;
Jitters: integer; Jitters: integer;
end; end;
@ -133,23 +129,24 @@ begin
ImageWidth := MainCp.Width; ImageWidth := MainCp.Width;
ImageHeight := MainCp.Height; ImageHeight := MainCp.Height;
txtDensity.text := FloatToStr(Sample_density); txtDensity.text := FloatToStr(Sample_density);
if cmbDepth.ItemIndex <> 2 then // if cmbDepth.ItemIndex <> 2 then
txtBatches.text := IntToStr(Round(Sample_density / 4)); // txtBatches.text := IntToStr(Round(Sample_density / 4));
txtFilterRadius.text := FloatToStr(Filter_Radius); txtFilterRadius.text := FloatToStr(Filter_Radius);
txtOversample.text := IntToSTr(Oversample); txtOversample.text := IntToSTr(Oversample);
udOversample.Position := Oversample; udOversample.Position := Oversample;
Ratio := ImageWidth / ImageHeight; Ratio := ImageWidth / ImageHeight;
Batches := 1;
Estimator := 5.0; Estimator := 5.0;
EstimatorMin := 0.0; EstimatorMin := 0.0;
EstimatorCurve := 0.6; EstimatorCurve := 0.6;
Jitters := 1; Jitters := 1;
GammaTresholds := 0.01; GammaTreshold := 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);
txtEstimatorCurve.Text := FloatToStr(EstimatorCurve, FloatFormatSettings); txtEstimatorCurve.Text := FloatToStr(EstimatorCurve, FloatFormatSettings);
txtJitters.Text := IntToStr(Jitters); // txtJitters.Text := IntToStr(Jitters);
txtGammaTresholds.Text := FloatToStr(GammaTresholds, FloatFormatSettings); txtGammaTreshold.Text := FloatToStr(GammaTreshold, FloatFormatSettings);
end; end;
procedure TExportDialog.btnOKClick(Sender: TObject); procedure TExportDialog.btnOKClick(Sender: TObject);
@ -194,8 +191,8 @@ procedure TExportDialog.txtDensityChange(Sender: TObject);
begin begin
try try
Sample_Density := StrToFloat(txtDensity.Text); Sample_Density := StrToFloat(txtDensity.Text);
if cmbDepth.ItemIndex <> 2 then // if cmbDepth.ItemIndex <> 2 then
txtBatches.text := IntToStr(Round(Sample_density / 4)); // txtBatches.text := IntToStr(Round(Sample_density / 4));
except except
end; end;
end; end;
@ -222,6 +219,7 @@ end;
procedure TExportDialog.txtBatchesChange(Sender: TObject); procedure TExportDialog.txtBatchesChange(Sender: TObject);
begin begin
{
if StrToInt(txtBatches.Text) > udBatches.Max then if StrToInt(txtBatches.Text) > udBatches.Max then
txtBatches.Text := IntToStr(udBatches.Max); txtBatches.Text := IntToStr(udBatches.Max);
if StrToInt(txtBatches.Text) < udBatches.Min then if StrToInt(txtBatches.Text) < udBatches.Min then
@ -230,14 +228,17 @@ begin
Batches := StrToInt(txtBatches.Text); Batches := StrToInt(txtBatches.Text);
except except
end; end;
}
end; end;
procedure TExportDialog.cmbDepthChange(Sender: TObject); procedure TExportDialog.cmbDepthChange(Sender: TObject);
begin begin
{
if cmbDepth.ItemIndex <> 2 then if cmbDepth.ItemIndex <> 2 then
txtBatches.text := IntToStr(Round(Sample_density / 4)) txtBatches.text := IntToStr(Round(Sample_density / 4))
else else
txtBatches.text := IntToStr(1); txtBatches.text := IntToStr(1);
}
end; end;
procedure TExportDialog.txtEstimatorChange(Sender: TObject); procedure TExportDialog.txtEstimatorChange(Sender: TObject);
@ -269,18 +270,20 @@ end;
procedure TExportDialog.txtJittersChange(Sender: TObject); procedure TExportDialog.txtJittersChange(Sender: TObject);
begin begin
{
Jitters := 0; Jitters := 0;
try try
Jitters := StrToInt(txtJitters.Text); Jitters := StrToInt(txtJitters.Text);
except except
end; end;
}
end; end;
procedure TExportDialog.txtGammaTresholdsChange(Sender: TObject); procedure TExportDialog.txtGammaTresholdChange(Sender: TObject);
begin begin
GammaTresholds := 0.01; GammaTreshold := 0.01;
try try
GammaTresholds := StrToFloat(txtGammaTresholds.Text, FloatFormatSettings); GammaTreshold := StrToFloat(txtGammaTreshold.Text, FloatFormatSettings);
except except
end; end;
end; end;