Further flam3 exporting functions fixes and additions.

This commit is contained in:
utak3r 2006-03-21 21:51:48 +00:00
parent 440f63f090
commit 5b7a3b1118
5 changed files with 77 additions and 37 deletions

View File

@ -124,7 +124,9 @@ type
pulse: array[0..1, 0..1] of double; // [i][0]=magnitute [i][1]=frequency */
wiggle: array[0..1, 0..1] of double; // frequency is /minute, assuming 30 frames/s */
estimator, estimator_min, estimator_curve, jitters: double; // density estimator.
estimator, estimator_min, estimator_curve: double; // density estimator.
jitters: integer;
gamma_tresholds: double;
PropTable: array of TXForm;//Integer;
FAngle: Double;

View File

@ -267,35 +267,44 @@ object ExportDialog: TExportDialog
end
object Label9: TLabel
Left = 8
Top = 88
Width = 43
Height = 13
Caption = 'Estimator'
Top = 80
Width = 49
Height = 25
Caption = 'Estimator radius'
WordWrap = True
end
object Label11: TLabel
Left = 8
Top = 112
Width = 49
Height = 25
Width = 46
Height = 26
Caption = 'Estimator min.'
WordWrap = True
end
object Label12: TLabel
Left = 160
Top = 80
Width = 57
Height = 25
Width = 46
Height = 26
Caption = 'Estimator curve'
WordWrap = True
end
object Label13: TLabel
Left = 160
Top = 112
Width = 57
Height = 25
Width = 47
Height = 26
Caption = 'Temporal samples'
WordWrap = True
end
object Label14: TLabel
Left = 160
Top = 48
Width = 57
Height = 26
Caption = 'Gamma tresholds'
WordWrap = True
end
object txtBatches: TEdit
Left = 64
Top = 20
@ -330,22 +339,12 @@ object ExportDialog: TExportDialog
'32 bits'
'64 bits')
end
object chkRender: TCheckBox
Left = 224
Top = 54
Width = 65
Height = 17
Caption = 'Render'
Checked = True
State = cbChecked
TabOrder = 3
end
object txtStrips: TEdit
Left = 64
Top = 52
Width = 57
Height = 21
TabOrder = 4
TabOrder = 3
Text = '1'
OnChange = txtBatchesChange
end
@ -358,14 +357,14 @@ object ExportDialog: TExportDialog
Min = 1
Max = 512
Position = 1
TabOrder = 5
TabOrder = 4
end
object txtJitters: TEdit
Left = 224
Top = 116
Width = 57
Height = 21
TabOrder = 6
TabOrder = 5
Text = '1'
OnChange = txtJittersChange
end
@ -374,7 +373,7 @@ object ExportDialog: TExportDialog
Top = 84
Width = 57
Height = 21
TabOrder = 7
TabOrder = 6
Text = '5'
OnChange = txtEstimatorChange
end
@ -383,7 +382,7 @@ object ExportDialog: TExportDialog
Top = 116
Width = 57
Height = 21
TabOrder = 8
TabOrder = 7
Text = '0'
OnChange = txtEstimatorMinChange
end
@ -392,10 +391,29 @@ object ExportDialog: TExportDialog
Top = 84
Width = 57
Height = 21
TabOrder = 9
TabOrder = 8
Text = '0.6'
OnChange = txtEstimatorCurveChange
end
object txtGammaTresholds: TEdit
Left = 224
Top = 52
Width = 57
Height = 21
TabOrder = 9
Text = '0.01'
OnChange = txtGammaTresholdsChange
end
end
object chkRender: TCheckBox
Left = 328
Top = 302
Width = 65
Height = 17
Caption = 'Render'
Checked = True
State = cbChecked
TabOrder = 6
end
object SaveDialog: TSaveDialog
DefaultExt = 'jpg'

View File

@ -64,6 +64,8 @@ type
txtEstimator: TEdit;
txtEstimatorMin: TEdit;
txtEstimatorCurve: TEdit;
Label14: TLabel;
txtGammaTresholds: TEdit;
procedure btnBrowseClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure btnOKClick(Sender: TObject);
@ -79,13 +81,16 @@ type
procedure txtEstimatorMinChange(Sender: TObject);
procedure txtEstimatorCurveChange(Sender: TObject);
procedure txtJittersChange(Sender: TObject);
procedure txtGammaTresholdsChange(Sender: TObject);
private
FloatFormatSettings: TFormatSettings;
public
Filename: string;
ImageWidth, ImageHeight, Oversample, Batches, Strips: Integer;
Sample_Density, Filter_Radius: double;
Estimator, EstimatorMin, EstimatorCurve, Jitters: double;
Estimator, EstimatorMin, EstimatorCurve: double;
GammaTresholds: double;
Jitters: integer;
end;
var
@ -138,12 +143,13 @@ begin
EstimatorMin := 0.0;
EstimatorCurve := 0.6;
Jitters := 1;
txtEstimator.Text := '5.0';
txtEstimatorMin.Text := '0.0';
txtEstimatorCurve.Text := '0.6';
txtJitters.Text := '1';
GammaTresholds := 0.01;
GetLocaleFormatSettings(LOCALE_SYSTEM_DEFAULT, FloatFormatSettings);
txtEstimator.Text := FloatToStr(Estimator, FloatFormatSettings);
txtEstimatorMin.Text := FloatToStr(EstimatorMin, FloatFormatSettings);
txtEstimatorCurve.Text := FloatToStr(EstimatorCurve, FloatFormatSettings);
txtJitters.Text := IntToStr(Jitters);
txtGammaTresholds.Text := FloatToStr(GammaTresholds, FloatFormatSettings);
end;
procedure TExportDialog.btnOKClick(Sender: TObject);
@ -265,7 +271,16 @@ procedure TExportDialog.txtJittersChange(Sender: TObject);
begin
Jitters := 0;
try
Jitters := StrToFloat(txtJitters.Text, FloatFormatSettings);
Jitters := StrToInt(txtJitters.Text);
except
end;
end;
procedure TExportDialog.txtGammaTresholdsChange(Sender: TObject);
begin
GammaTresholds := 0.01;
try
GammaTresholds := StrToFloat(txtGammaTresholds.Text, FloatFormatSettings);
except
end;
end;

View File

@ -127,7 +127,9 @@ var
SheepServer, SheepNick, SheepURL, SheepPW, HqiPath: string;
ExportBatches, ExportOversample, ExportWidth, ExportHeight, ExportFileFormat: Integer;
ExportFilter, ExportDensity: Double;
ExportEstimator, ExportEstimatorMin, ExportEstimatorCurve, ExportJitters: double;
ExportEstimator, ExportEstimatorMin, ExportEstimatorCurve: double;
ExportJitters: integer;
ExportGammaTresholds: double;
OpenFileType: TFileType;
ResizeOnLoad: Boolean;
ShowProgress: Boolean;

View File

@ -1330,10 +1330,11 @@ begin
format('brightness="%g" ', [cp1.brightness]) +
format('gamma="%g" ', [cp1.gamma]) +
format('vibrancy="%g" ', [cp1.vibrancy]) +
format('estimator="%g" ', [cp1.estimator]) +
format('estimator_radius="%g" ', [cp1.estimator]) +
format('estimator_minimum="%g" ', [cp1.estimator_min]) +
format('estimator_curve="%g" ', [cp1.estimator_curve]) +
format('temporal_samples="%g" ', [cp1.jitters]) +
format('temporal_samples="%d" ', [cp1.jitters]) +
format('gamma_thresholds="%g" ', [cp1.gamma_tresholds]) +
hue + url + nick + '>');
{ Write transform parameters }
@ -3673,6 +3674,7 @@ begin
ExportEstimatorMin := ExportDialog.EstimatorMin;
ExportEstimatorCurve := ExportDialog.EstimatorCurve;
ExportJitters := ExportDialog.Jitters;
ExportGammaTresholds := ExportDialog.GammaTresholds;
cp1.sample_density := ExportDensity;
cp1.spatial_oversample := ExportOversample;
cp1.spatial_filter_radius := ExportFilter;
@ -3683,6 +3685,7 @@ begin
cp1.estimator_min := ExportEstimatorMin;
cp1.estimator_curve := ExportEstimatorCurve;
cp1.jitters := ExportJitters;
cp1.gamma_tresholds := ExportGammaTresholds;
FileList.Text := FlameToXML(cp1, false);
FileList.SaveToFile(ChangeFileExt(ExportDialog.Filename, '.flame'));
FileList.Clear;