new options

This commit is contained in:
zueuk 2006-09-06 12:39:01 +00:00
parent 3f5e7e6a72
commit 5660d78da7
4 changed files with 248 additions and 103 deletions

View File

@ -36,7 +36,7 @@ function dist(x1, y1, x2, y2: double): double;
function GetVal(token: string): string;
function ReplaceTabs(str: string): string;
{ Palette and gradient functions }
function GetGradient(FileName, Entry: string): string;
//function GetGradient(FileName, Entry: string): string;
{ Misc }
function det(a, b, c, d: double): double;
function solve3(x1, x2, x1h, y1, y2, y1h, z1, z2, z1h: double;
@ -53,18 +53,25 @@ const
clSlateGray = TColor($837365);
FT_BMP = 1; FT_PNG = 2; FT_JPG = 3;
const
crEditArrow = 20;
crEditMove = 21;
crEditRotate = 22;
crEditScale = 23;
var
MainSeed: integer;
MainTriangles: TTriangles;
ConfirmDelete: boolean; // Flag confirmation of entry deletion
// FlameTitle: string;
Transforms: integer; // Count of Tranforms
EnableFinalXform: boolean;
AppPath: string; // Path of applicatio file
OpenFile: string; // Name of currently open file
CanDrawOnResize: boolean;
PreserveWeights: boolean;
{UPR Options}
{ UPR Options }
UPRSampleDensity: integer;
UPRFilterRadius: double;
UPROversample: integer;
@ -81,16 +88,23 @@ var
Variation: TVariation; // Current variation
NumTries, TryLength: integer; // Settings for smooth palette
SmoothPaletteFile: string;
{ Editor }
{ Editor }
UseFlameBackground, UseTransformColors: boolean;
EditorBkgColor, ReferenceTriangleColor: integer;
GridColor1, GridColor2, HelpersColor: integer;
ExtEditEnabled, TransformAxisLock: boolean;
{ Display }
DoubleClickSetVars: boolean;
{ Display }
defSampleDensity, defPreviewDensity: Double;
defGamma, defBrightness, defVibrancy, defFilterRadius: Double;
defOversample: integer;
{ Render }
{ Render }
renderDensity, renderFilterRadius: double;
renderOversample, renderWidth, renderHeight: integer;
renderBitsPerSample: integer;
@ -98,7 +112,18 @@ var
JPEGQuality: integer;
renderFileFormat: integer;
InternalBitsPerSample: integer;
{ Defaults }
NrTreads: Integer;
UseNrThreads: integer;
PNGTransparency: integer;
ShowTransparency: boolean;
MainPreviewScale: double;
ExtendMainPreview: boolean;
{ Defaults }
SavePath, SmoothPalettePath: string;
RandomPrefix, RandomDate: string;
RandomIndex: integer;
@ -117,12 +142,20 @@ var
PlaySoundOnRenderComplete: boolean;
RenderCompleteSoundFile: string;
SaveIncompleteRenders: boolean;
ShowRenderStats: boolean;
PreviewTimeLimit, FullscreenTimeLimit: integer;
PreviewMinDensity: double;
SymmetryType: integer;
SymmetryOrder: integer;
SymmetryNVars: integer;
Variations: array[0..63] of boolean;
VariationOptions: int64;
{ For random gradients }
MinNodes, MaxNodes, MinHue, MaxHue, MinSat, MaxSat, MinLum, MaxLum: integer;
ReferenceMode: integer;//FixedReference: boolean;
MainForm_RotationMode: integer;
@ -138,18 +171,11 @@ var
ExportJitters: integer;
ExportGammaTreshold: double;
OpenFileType: TFileType;
ResizeOnLoad: Boolean;
// ResizeOnLoad: Boolean;
ShowProgress: Boolean;
defLibrary: string;
LimitVibrancy: Boolean;
DefaultPalette: TColorMap;
PNGTransparency: integer;
ShowTransparency: boolean;
NrTreads: Integer;
UseNrThreads: integer;
PreviewTimeLimit, FullscreenTimeLimit: integer;
PreviewMinDensity: double;
function Round6(x: double): double;
@ -297,9 +323,6 @@ begin
end;
end;
{ Weight manipulation }
{ Parse }
function GetVal(token: string): string;
@ -327,7 +350,7 @@ begin
Result := str;
end;
(*
{ Palette and gradient functions }
function RGBToColor(Pal: TMapPalette; index: integer): Tcolor;
@ -419,6 +442,7 @@ begin
FileStrings.Free;
end;
end;
*)
end.

View File

@ -1,6 +1,6 @@
object OptionsForm: TOptionsForm
Left = 675
Top = 365
Left = 497
Top = 238
BorderIcons = [biSystemMenu, biMinimize, biMaximize, biHelp]
BorderStyle = bsDialog
Caption = 'Options'
@ -51,21 +51,21 @@ object OptionsForm: TOptionsForm
HelpContext = 1
Caption = 'General'
object chkConfirmDel: TCheckBox
Left = 136
Top = 7
Width = 121
Left = 8
Top = 183
Width = 97
Height = 17
HelpContext = 1005
Caption = 'Confirm delete'
TabOrder = 3
TabOrder = 2
end
object JPEG: TGroupBox
Left = 8
Top = 116
Top = 124
Width = 121
Height = 55
Caption = 'JPEG Quality'
TabOrder = 2
TabOrder = 1
object txtJPEGquality: TComboBox
Left = 16
Top = 20
@ -82,14 +82,6 @@ object OptionsForm: TOptionsForm
'120')
end
end
object chkResize: TCheckBox
Left = 136
Top = 25
Width = 121
Height = 17
Caption = 'Resize on load'
TabOrder = 4
end
object GroupBox16: TGroupBox
Left = 8
Top = 4
@ -113,24 +105,13 @@ object OptionsForm: TOptionsForm
'8')
end
end
object rgRotationMode: TRadioGroup
Left = 8
Top = 60
Width = 121
Height = 55
Caption = 'Rotation Mode'
Items.Strings = (
'Rotate image'
'Rotate frame')
TabOrder = 1
end
object GroupBox15: TGroupBox
Left = 136
Top = 158
Top = 4
Width = 297
Height = 75
Caption = 'When render is finished'
TabOrder = 5
Height = 101
Caption = 'On render complete'
TabOrder = 3
object btnBrowseSound: TSpeedButton
Left = 264
Top = 41
@ -229,14 +210,22 @@ object OptionsForm: TOptionsForm
Caption = 'Play sound'
TabOrder = 1
end
object chkShowRenderStats: TCheckBox
Left = 8
Top = 72
Width = 185
Height = 17
Caption = 'Show extended render statistics'
TabOrder = 2
end
end
object GroupBox18: TGroupBox
Left = 8
Top = 176
Top = 64
Width = 121
Height = 57
Caption = 'Internal buffer depth'
TabOrder = 6
TabOrder = 4
object cbInternalBitsPerSample: TComboBox
Left = 16
Top = 20
@ -254,11 +243,11 @@ object OptionsForm: TOptionsForm
end
object GroupBox19: TGroupBox
Left = 136
Top = 56
Top = 112
Width = 201
Height = 97
Caption = 'Time limited previews'
TabOrder = 7
Caption = 'Time-limited previews'
TabOrder = 5
Visible = False
object Label45: TLabel
Left = 8
@ -452,24 +441,43 @@ object OptionsForm: TOptionsForm
'Wandering (old-style)')
TabOrder = 1
end
object chkExtendedEdit: TCheckBox
object GroupBox21: TGroupBox
Left = 160
Top = 80
Top = 77
Width = 145
Height = 17
Caption = 'Extended edit mode'
Checked = True
State = cbChecked
Height = 65
Caption = 'Editor defaults'
TabOrder = 2
object chkAxisLock: TCheckBox
Left = 8
Top = 38
Width = 129
Height = 17
Caption = 'Lock transform axis'
Checked = True
State = cbChecked
TabOrder = 0
end
object chkExtendedEdit: TCheckBox
Left = 8
Top = 18
Width = 129
Height = 17
Caption = 'Extended edit mode'
Checked = True
State = cbChecked
TabOrder = 1
end
end
object chkAxisLock: TCheckBox
Left = 160
Top = 100
Width = 145
Height = 17
Caption = 'Lock transform axis'
Checked = True
State = cbChecked
object rgDoubleClickVars: TRadioGroup
Left = 8
Top = 144
Width = 297
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
@ -532,7 +540,7 @@ object OptionsForm: TOptionsForm
Left = 8
Top = 4
Width = 169
Height = 169
Height = 229
Caption = 'Rendering'
TabOrder = 0
object lblSampleDensity: TLabel
@ -625,26 +633,76 @@ object OptionsForm: TOptionsForm
HelpContext = 1011
TabOrder = 5
end
object rgTransparency: TRadioGroup
Left = 8
Top = 160
Width = 153
Height = 61
Caption = 'PNG Transparency'
ItemIndex = 0
Items.Strings = (
'Disabled'
'Enabled')
TabOrder = 6
end
end
object chkShowTransparency: TCheckBox
Left = 192
Top = 155
Width = 129
Height = 17
Caption = 'Show Transparency'
TabOrder = 2
end
object rgTransparency: TRadioGroup
object GroupBox20: TGroupBox
Left = 184
Top = 104
Width = 193
Height = 49
Caption = 'PNG Transparency'
ItemIndex = 0
Items.Strings = (
'Disabled'
'Enabled')
TabOrder = 3
Width = 254
Height = 129
Caption = 'Main Window Preview'
TabOrder = 2
object Label48: TLabel
Left = 208
Top = 20
Width = 37
Height = 13
Caption = 'percent'
end
object chkShowTransparency: TCheckBox
Left = 8
Top = 42
Width = 129
Height = 17
Caption = 'Show Transparency'
TabOrder = 2
end
object chkExtendMainPreview: TCheckBox
Left = 8
Top = 20
Width = 145
Height = 17
Caption = 'Extend preview buffer by'
TabOrder = 0
end
object cbExtendPercent: TComboBox
Left = 152
Top = 18
Width = 49
Height = 21
ItemHeight = 13
TabOrder = 1
Items.Strings = (
'0'
'10'
'25'
'50'
'100'
'150'
'200')
end
object rgRotationMode: TRadioGroup
Left = 8
Top = 60
Width = 121
Height = 61
Caption = 'Rotation Mode'
Items.Strings = (
'Rotate image'
'Rotate frame')
TabOrder = 3
end
end
end
object RandomPage: TTabSheet

View File

@ -147,7 +147,6 @@ type
GroupBox8: TGroupBox;
Label17: TLabel;
txtServer: TEdit;
chkResize: TCheckBox;
PathsPage: TTabSheet;
GroupBox10: TGroupBox;
btnDefGradient: TSpeedButton;
@ -177,13 +176,10 @@ type
Label24: TLabel;
txtSymNVars: TEdit;
udSymNVars: TUpDown;
rgRotationMode: TRadioGroup;
txtBatchSize: TEdit;
udBatchSize: TUpDown;
Label38: TLabel;
Label39: TLabel;
chkShowTransparency: TCheckBox;
rgTransparency: TRadioGroup;
GroupBox15: TGroupBox;
btnBrowseSound: TSpeedButton;
txtSoundFile: TEdit;
@ -201,8 +197,6 @@ type
pnlGridColor2: TPanel;
pnlHelpersColor: TPanel;
rgReferenceMode: TRadioGroup;
chkExtendedEdit: TCheckBox;
chkAxisLock: TCheckBox;
chkPlaysound: TCheckBox;
btnPlay: TSpeedButton;
Label44: TLabel;
@ -215,6 +209,18 @@ type
Label47: TLabel;
cbPreviewTime: TComboBox;
cbFullscrTime: TComboBox;
GroupBox20: TGroupBox;
chkShowTransparency: TCheckBox;
chkExtendMainPreview: TCheckBox;
Label48: TLabel;
rgTransparency: TRadioGroup;
cbExtendPercent: TComboBox;
chkShowRenderStats: TCheckBox;
rgRotationMode: TRadioGroup;
GroupBox21: TGroupBox;
chkAxisLock: TCheckBox;
chkExtendedEdit: TCheckBox;
rgDoubleClickVars: TRadioGroup;
procedure btnCancelClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure btnOKClick(Sender: TObject);
@ -246,6 +252,7 @@ type
procedure pnlHelpersColorClick(Sender: TObject);
procedure btnBrowseSoundClick(Sender: TObject);
procedure btnPlayClick(Sender: TObject);
private
{ Private declarations }
public
@ -298,21 +305,22 @@ begin
rgReferenceMode.ItemIndex := ReferenceMode;
rgRotationMode.ItemIndex := MainForm_RotationMode;
udBatchSize.Position := BatchSize;
chkResize.checked := ResizeOnLoad;
rgTransparency.ItemIndex := PNGTransparency;
chkShowTransparency.Checked := ShowTransparency;
// chkResize.checked := ResizeOnLoad;
if NrTreads <= 1 then
cbNrTheads.ItemIndex := 0
else
cbNrTheads.text := intTostr(NrTreads);
chkExtendedEdit.Checked := ExtEditEnabled;
chkAxisLock.Checked := TransformAxisLock;
if DoubleClickSetVars then rgDoubleClickVars.ItemIndex := 1
else rgDoubleClickVars.ItemIndex := 0;
chkPlaySound.Checked := PlaySoundOnRenderComplete;
txtSoundFile.Text := RenderCompleteSoundFile;
cbInternalBitsPerSample.ItemIndex := InternalBitsPerSample;
if PreviewTimeLimit = 0 then cbPreviewTime.ItemIndex := 0
else cbPreviewTime.Text := IntToStr(PreviewTimeLimit);
if FullscreenTimeLimit = 0 then cbFullscrTime.ItemIndex := 0
@ -335,6 +343,13 @@ begin
pnlGridColor2.Color := GridColor2;
pnlReference.color := TColor(ReferenceTriangleColor);
rgTransparency.ItemIndex := PNGTransparency;
chkShowTransparency.Checked := ShowTransparency;
cbExtendPercent.Text := FloatToStr((MainPreviewScale - 1) / 0.02);
chkExtendMainPreview.Checked := ExtendMainPreview;
chkShowRenderStats.Checked := ShowRenderStats;
{ Random tab }
udMinXforms.Position := randMinTransforms;
udMaxXforms.Position := randMaxTransforms;
@ -428,7 +443,7 @@ begin
ConfirmDelete := chkConfirmDel.Checked;
MainForm_RotationMode := rgRotationMode.ItemIndex;
ResizeOnLoad := chkResize.checked;
// ResizeOnLoad := chkResize.checked;
InternalBitsPerSample := cbInternalBitsPerSample.ItemIndex;
@ -440,6 +455,7 @@ begin
ReferenceMode := rgReferenceMode.ItemIndex;
ExtEditEnabled := chkExtendedEdit.Checked;
TransformAxisLock := chkAxisLock.Checked;
DoubleClickSetVars := rgDoubleClickVars.ItemIndex <> 0;
{ Display tab }
defSampleDensity := StrToFloat(txtSampleDensity.Text);
@ -466,6 +482,13 @@ begin
if prevHighQuality > 100 then prevHighQuality := 100;
if prevHighQuality < 0.01 then prevHighQuality := 0.01;
MainPreviewScale := 1 + 0.02 * StrToFloatDef(cbExtendPercent.Text, 0);
if MainPreviewScale < 1 then MainPreviewScale := 1
else if MainPreviewScale > 3 then MainPreviewScale := 3;
ExtendMainPreview := chkExtendMainPreview.Checked;
ShowRenderStats := chkShowRenderStats.Checked;
{ Random tab }
randMinTransforms := udMinXforms.Position;
randMaxTransforms := udMaxXforms.Position;

View File

@ -490,7 +490,7 @@ begin
begin
SheepServer := 'http://v2d5.sheepserver.net/';
end;
if Registry.ValueExists('ResizeOnLoad') then
{ if Registry.ValueExists('ResizeOnLoad') then
begin
ResizeOnLoad := Registry.ReadBool('ResizeOnLoad');
end
@ -498,16 +498,28 @@ begin
begin
ResizeOnLoad := False;
end;
if Registry.ValueExists('ShowProgress') then
} if Registry.ValueExists('ShowProgress') then
begin
ShowProgress := Registry.ReadBool('ShowProgress');
end else begin
ShowProgress := true;
end;
if Registry.ValueExists('SaveIncompleteRenders') then begin
SaveIncompleteRenders := Registry.ReadBool('SaveIncompleteRenders');
end else begin
SaveIncompleteRenders := false;
end;
if Registry.ValueExists('ShowRenderStats') then begin
ShowRenderStats := Registry.ReadBool('ShowRenderStats');
end else begin
ShowRenderStats := false;
end;
if Registry.ValueExists('PNGTransparency') then begin
PNGTransparency := Registry.ReadInteger('PNGTransparency');
if PNGTransparency > 1 then PNGTransparency := 1;
if PNGTransparency > 1 then PNGTransparency := 1; // tmp
end else begin
PNGTransparency := 1
@ -517,6 +529,19 @@ begin
end else begin
ShowTransparency := False;
end;
if Registry.ValueExists('ExtendMainPreview') then begin
ExtendMainPreview := Registry.ReadBool('ExtendMainPreview');
end else begin
ExtendMainPreview := true;
end;
if Registry.ValueExists('MainPreviewScale') then begin
MainPreviewScale := Registry.ReadFloat('MainPreviewScale');
if MainPreviewScale < 1 then MainPreviewScale := 1
else if MainPreviewScale > 3 then MainPreviewScale := 3;
end else begin
MainPreviewScale := 1.2;
end;
if Registry.ValueExists('NrTreads') then begin
NrTreads := Registry.ReadInteger('NrTreads');
end else begin
@ -603,10 +628,14 @@ begin
SheepPW := '';
flam3Path := DefaultPath + 'flam3.exe';
SheepServer := 'http://v2d5.sheepserver.net/';
ResizeOnLoad := False;
// ResizeOnLoad := False;
ShowProgress := true;
SaveIncompleteRenders := false;
ShowRenderStats := false;
PNGTransparency := 1;
ShowTransparency := False;
MainPreviewScale := 1.2;
ExtendMainPreview := true;
NrTreads := 1;
UseNrThreads := 1;
InternalBitsPerSample := 0;
@ -662,6 +691,9 @@ begin
if Registry.ValueExists('LockTransformAxis') then
TransformAxisLock := Registry.ReadBool('LockTransformAxis')
else TransformAxisLock := true;
if Registry.ValueExists('DoubleClickSetVars') then
DoubleClickSetVars := Registry.ReadBool('DoubleClickSetVars')
else DoubleClickSetVars := true;
end
else begin
EditorBkgColor := $000000;
@ -671,6 +703,7 @@ begin
ReferenceTriangleColor := integer(clGray);
ExtEditEnabled := true;
TransformAxisLock := true;
DoubleClickSetVars := true;
end;
Registry.CloseKey;
@ -1019,17 +1052,23 @@ begin
Registry.WriteString('Renderer', flam3Path);
Registry.WriteString('Server', SheepServer);
Registry.WriteString('Pass', SheepPW);
Registry.WriteBool('ResizeOnLoad', ResizeOnLoad);
// Registry.WriteBool('ResizeOnLoad', ResizeOnLoad);
Registry.WriteBool('ShowProgress', ShowProgress);
Registry.WriteBool('KeepBackground', KeepBackground);
Registry.WriteString('FunctionLibrary', defLibrary);
Registry.WriteBool('ShowTransparency', ShowTransparency);
Registry.WriteInteger('PNGTransparency', PNGTransparency);
Registry.WriteBool('ExtendMainPreview', ExtendMainPreview);
Registry.WriteFloat('MainPreviewScale', MainPreviewScale);
Registry.WriteBool('SaveIncompleteRenders', SaveIncompleteRenders);
Registry.WriteBool('ShowRenderStats', ShowRenderStats);
Registry.WriteInteger('NrTreads', NrTreads);
Registry.WriteInteger('UseNrThreads', UseNrThreads);
Registry.WriteInteger('InternalBitsPerSample', InternalBitsPerSample);
Registry.WriteInteger('PreviewTimeLimit', PreviewTimeLimit);
Registry.WriteInteger('FullscreenTimeLimit', FullscreenTimeLimit);
Registry.WriteFloat('PreviewMinDensity', PreviewMinDensity);
@ -1045,6 +1084,7 @@ begin
Registry.WriteInteger('ReferenceTriangleColor', ReferenceTriangleColor);
Registry.WriteBool('ExtendedEdit', ExtEditEnabled);
Registry.WriteBool('LockTransformAxis', TransformAxisLock);
Registry.WriteBool('DoubleClickSetVars', DoubleClickSetVars);
end;
{ Display }
if Registry.OpenKey('\Software\' + APP_NAME + '\Display', True) then