1 // RenderParameters.h
2 // this file is part of Context Free
3 // ---------------------
4 // Copyright (C) 2017 John Horigan - john@glyphic.com
5 //
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19 //
20 // John Horigan can be contacted at john@glyphic.com or at
21 // John Horigan, 1209 Villa St., Mountain View, CA 94041-1123, USA
22 //
23 //
24 
25 #pragma once
26 
27 #include "Form1.h"
28 
29 namespace ContextFreeNet {
30 
31     public value class RenderParameters
32     {
33     public:
34         enum class RenderActions { Render, Animate, SaveSVG };
35         RenderActions action;
36         bool    periodicUpdate;
37         bool	animateZoom;
38         bool    suppressDisplay;
39         int		animateFrameCount;
40         int     width;
41         int     height;
42         double  minimumSize;
43         double  borderSize;
44         int     animateWidth;
45         int     animateHeight;
46         int     length;
47         int     frameRate;
48         int     frame;
49         bool    animateFrame;
50         int     codec;
51         bool    preview;
52         bool    loop;
53 
initFromPrefs()54         void initFromPrefs()
55         {
56             periodicUpdate = Form1::prefs->ProgressiveRender;
57             suppressDisplay = Form1::prefs->DontDisplay;
58             animateZoom = Form1::prefs->AnimateZoom;
59             width = Form1::prefs->RenderWidth;
60             height = Form1::prefs->RenderHeight;
61             borderSize = Form1::prefs->BorderWidth;
62             minimumSize = Form1::prefs->MinimumSize;
63             animateWidth = Form1::prefs->AnimateWidth;
64             animateHeight = Form1::prefs->AnimateHeight;
65             length = Form1::prefs->AnimateLength;
66             frameRate = Form1::prefs->AnimateFrameRate;
67             codec = Form1::prefs->AnimateCodec;
68             preview = Form1::prefs->AnimatePreview;
69             loop = Form1::prefs->AnimatePreviewLoop;
70         }
71 
saveToPrefs()72         void saveToPrefs()
73         {
74             Form1::prefs->ProgressiveRender = periodicUpdate;
75             Form1::prefs->DontDisplay = suppressDisplay;
76             Form1::prefs->AnimateZoom = animateZoom;
77             Form1::prefs->RenderWidth = width;
78             Form1::prefs->RenderHeight = height;
79             Form1::prefs->BorderWidth = borderSize;
80             Form1::prefs->MinimumSize = minimumSize;
81             Form1::prefs->AnimateWidth = animateWidth;
82             Form1::prefs->AnimateHeight = animateHeight;
83             Form1::prefs->AnimateLength = length;
84             Form1::prefs->AnimateFrameRate = frameRate;
85             Form1::prefs->AnimateCodec = codec;
86             Form1::prefs->AnimatePreview = preview;
87             Form1::prefs->AnimatePreviewLoop = loop;
88         }
89     };
90 
91 };