Density estimator controls for flam3 renderer added.

This commit is contained in:
utak3r 2006-03-19 22:36:16 +00:00
parent 489f4fa1be
commit c0b9aedea3
5 changed files with 160 additions and 16 deletions

View File

@ -124,6 +124,8 @@ 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.
PropTable: array of TXForm;//Integer;
FAngle: Double;
FTwoColorDimensions: Boolean;

View File

@ -3,8 +3,8 @@ object ExportDialog: TExportDialog
Top = 276
BorderStyle = bsDialog
Caption = 'Export Flame'
ClientHeight = 270
ClientWidth = 424
ClientHeight = 325
ClientWidth = 419
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
@ -17,9 +17,9 @@ object ExportDialog: TExportDialog
PixelsPerInch = 96
TextHeight = 13
object btnOK: TButton
Left = 336
Top = 178
Width = 75
Left = 326
Top = 182
Width = 89
Height = 25
Caption = '&OK'
Default = True
@ -28,9 +28,9 @@ object ExportDialog: TExportDialog
OnClick = btnOKClick
end
object btnCancel: TButton
Left = 336
Left = 326
Top = 210
Width = 75
Width = 89
Height = 25
Caption = 'Cancel'
ModalResult = 2
@ -41,7 +41,7 @@ object ExportDialog: TExportDialog
Top = 5
Width = 408
Height = 57
Caption = 'Destination'
Caption = ' Destination '
TabOrder = 2
object btnBrowse: TSpeedButton
Left = 368
@ -108,7 +108,7 @@ object ExportDialog: TExportDialog
Top = 66
Width = 200
Height = 105
Caption = 'Rendering'
Caption = ' Quality '
TabOrder = 3
object Label3: TLabel
Left = 10
@ -174,7 +174,7 @@ object ExportDialog: TExportDialog
Top = 66
Width = 200
Height = 105
Caption = 'Size'
Caption = ' Size '
TabOrder = 4
object Label1: TLabel
Left = 10
@ -241,8 +241,8 @@ object ExportDialog: TExportDialog
Left = 8
Top = 176
Width = 313
Height = 89
Caption = 'hqi/flam3'
Height = 145
Caption = ' flam3 parameters '
TabOrder = 5
object Label6: TLabel
Left = 10
@ -265,6 +265,37 @@ object ExportDialog: TExportDialog
Height = 13
Caption = 'Strips:'
end
object Label9: TLabel
Left = 8
Top = 88
Width = 43
Height = 13
Caption = 'Estimator'
end
object Label11: TLabel
Left = 8
Top = 112
Width = 49
Height = 25
Caption = 'Estimator min.'
WordWrap = True
end
object Label12: TLabel
Left = 160
Top = 80
Width = 57
Height = 25
Caption = 'Estimator curve'
WordWrap = True
end
object Label13: TLabel
Left = 160
Top = 112
Width = 57
Height = 25
Caption = 'Temporal samples'
WordWrap = True
end
object txtBatches: TEdit
Left = 64
Top = 20
@ -329,6 +360,42 @@ object ExportDialog: TExportDialog
Position = 1
TabOrder = 5
end
object txtJitters: TEdit
Left = 224
Top = 116
Width = 57
Height = 21
TabOrder = 6
Text = '1'
OnChange = txtJittersChange
end
object txtEstimator: TEdit
Left = 64
Top = 84
Width = 57
Height = 21
TabOrder = 7
Text = '5'
OnChange = txtEstimatorChange
end
object txtEstimatorMin: TEdit
Left = 64
Top = 116
Width = 57
Height = 21
TabOrder = 8
Text = '0'
OnChange = txtEstimatorMinChange
end
object txtEstimatorCurve: TEdit
Left = 224
Top = 84
Width = 57
Height = 21
TabOrder = 9
Text = '0.6'
OnChange = txtEstimatorCurveChange
end
end
object SaveDialog: TSaveDialog
DefaultExt = 'jpg'

View File

@ -56,6 +56,14 @@ type
Label8: TLabel;
txtStrips: TEdit;
udStrips: TUpDown;
Label9: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
txtJitters: TEdit;
txtEstimator: TEdit;
txtEstimatorMin: TEdit;
txtEstimatorCurve: TEdit;
procedure btnBrowseClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure btnOKClick(Sender: TObject);
@ -67,13 +75,17 @@ type
procedure txtOversampleChange(Sender: TObject);
procedure txtBatchesChange(Sender: TObject);
procedure cmbDepthChange(Sender: TObject);
procedure txtEstimatorChange(Sender: TObject);
procedure txtEstimatorMinChange(Sender: TObject);
procedure txtEstimatorCurveChange(Sender: TObject);
procedure txtJittersChange(Sender: TObject);
private
{ Private declarations }
FloatFormatSettings: TFormatSettings;
public
Filename: string;
ImageWidth, ImageHeight, Oversample, Batches, Strips: Integer;
Sample_Density, Filter_Radius: double;
{ Public declarations }
Estimator, EstimatorMin, EstimatorCurve, Jitters: double;
end;
var
@ -122,6 +134,16 @@ begin
txtOversample.text := IntToSTr(Oversample);
udOversample.Position := Oversample;
Ratio := ImageWidth / ImageHeight;
Estimator := 5.0;
EstimatorMin := 0.0;
EstimatorCurve := 0.6;
Jitters := 1;
txtEstimator.Text := '5.0';
txtEstimatorMin.Text := '0.0';
txtEstimatorCurve.Text := '0.6';
txtJitters.Text := '1';
GetLocaleFormatSettings(LOCALE_SYSTEM_DEFAULT, FloatFormatSettings);
end;
procedure TExportDialog.btnOKClick(Sender: TObject);
@ -212,5 +234,41 @@ begin
txtBatches.text := IntToStr(1);
end;
procedure TExportDialog.txtEstimatorChange(Sender: TObject);
begin
Estimator := 0;
try
Estimator := StrToFloat(txtEstimator.Text, FloatFormatSettings);
except
end;
end;
procedure TExportDialog.txtEstimatorMinChange(Sender: TObject);
begin
EstimatorMin := 0;
try
EstimatorMin := StrToFloat(txtEstimatorMin.Text, FloatFormatSettings);
except
end;
end;
procedure TExportDialog.txtEstimatorCurveChange(Sender: TObject);
begin
EstimatorCurve := 0;
try
EstimatorCurve := StrToFloat(txtEstimatorCurve.Text, FloatFormatSettings);
except
end;
end;
procedure TExportDialog.txtJittersChange(Sender: TObject);
begin
Jitters := 0;
try
Jitters := StrToFloat(txtJitters.Text, FloatFormatSettings);
except
end;
end;
end.

View File

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

View File

@ -1329,7 +1329,12 @@ begin
format('" background="%g %g %g" ', [cp1.background[0] / 255, cp1.background[1] / 255, cp1.background[2] / 255]) +
format('brightness="%g" ', [cp1.brightness]) +
format('gamma="%g" ', [cp1.gamma]) +
format('vibrancy="%g" ', [cp1.vibrancy]) + hue + url + nick + '>');
format('vibrancy="%g" ', [cp1.vibrancy]) +
format('estimator="%g" ', [cp1.estimator]) +
format('estimator_minimum="%g" ', [cp1.estimator_min]) +
format('estimator_curve="%g" ', [cp1.estimator_curve]) +
format('temporal_samples="%g" ', [cp1.jitters]) +
hue + url + nick + '>');
{ Write transform parameters }
t := cp1.NumXForms;
@ -3618,7 +3623,10 @@ var
begin
if (MainCp.NumXForms > 12) or
(MainCP.HasNewVariants) then begin
showMessage('This flame will not be correctly rendered this way. Please use the internal renderer.');
showMessage('WARNING: This flame will not be correctly rendered '#10#13+
'by the flam3 version < 2.7b4.'#10#13+
'Please use the 2.7b4 version or newer '#10#13+
'or use the internal renderer.');
end;
if not FileExists(HqiPath) then
@ -3661,12 +3669,20 @@ begin
ExportFilter := ExportDialog.Filter_Radius;
ExportOversample := ExportDialog.Oversample;
ExportBatches := ExportDialog.Batches;
ExportEstimator := ExportDialog.Estimator;
ExportEstimatorMin := ExportDialog.EstimatorMin;
ExportEstimatorCurve := ExportDialog.EstimatorCurve;
ExportJitters := ExportDialog.Jitters;
cp1.sample_density := ExportDensity;
cp1.spatial_oversample := ExportOversample;
cp1.spatial_filter_radius := ExportFilter;
cp1.nbatches := ExportBatches;
if (cp1.width <> ExportWidth) or (cp1.Height <> ExportHeight) then
cp1.AdjustScale(ExportWidth, ExportHeight);
cp1.estimator := ExportEstimator;
cp1.estimator_min := ExportEstimatorMin;
cp1.estimator_curve := ExportEstimatorCurve;
cp1.jitters := ExportJitters;
FileList.Text := FlameToXML(cp1, false);
FileList.SaveToFile(ChangeFileExt(ExportDialog.Filename, '.flame'));
FileList.Clear;