-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemberscene.h
More file actions
71 lines (49 loc) · 1.67 KB
/
emberscene.h
File metadata and controls
71 lines (49 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef EMBERSCENE_H
#define EMBERSCENE_H
#include "abstractscene.h"
#include <Ember.h>
#include <SheepTools.h>
#include <RendererCL.h>
#include <OpenCLWrapper.h>
#include "x11_undefs.h"
#include <QMutex>
#include <QException>
#define EMBER_PRECISION float
class EmberRendererNotInitialisedException : public QException
{
public:
EmberRendererNotInitialisedException() : QException() {}
virtual ~EmberRendererNotInitialisedException() {}
};
class EmberScene : public AbstractScene
{
public:
EmberScene( int width, int height );
EmberScene( const EmberScene &other );
virtual ~EmberScene();
static bool initialiseRenderer( const QString &palettePath, int platform, int device );
static void destroyRenderer();
/// cross-breeds this scene with another one
virtual QPair< AbstractScene*, AbstractScene* > breed( AbstractScene *other, int mutationStrength );
// rendering methods
virtual bool renderTo( QImage &image );
virtual void saveToFile( const QString &fn );
virtual void randomise();
virtual AbstractScene *clone() const;
/// dumps the scene to a datastream for later processing
virtual void saveToStream( QDataStream &stream );
/// loads the scene from a datastream for later processing
virtual void loadFromStream( QDataStream &stream );
protected:
virtual void mutateOnce();
private:
static const unsigned int MAX_XFORMS;
static QMutex s_renderMutex;
static EmberCLns::RendererCL<EMBER_PRECISION> *s_renderer;
static EmberNs::SheepTools<EMBER_PRECISION, EMBER_PRECISION> *s_tools;
int m_width;
int m_height;
EmberNs::Ember<EMBER_PRECISION> m_ember;
static const std::vector<EmberNs::eVariationId> &vars();
};
#endif // EMBERSCENE_H