Vuo
2.0.0
base
VuoShaderFile.hh
Go to the documentation of this file.
1
10
#pragma once
11
12
#include <vector>
13
14
#include "
VuoFileUtilities.hh
"
15
16
typedef
struct
_VuoShader
*
VuoShader
;
17
class
VuoShaderIssues
;
18
class
VuoCompositionMetadata
;
19
29
class
VuoShaderFile
30
{
31
public
:
32
36
enum
Type
37
{
38
GLSLImageFilter,
39
GLSLImageGenerator,
40
GLSLImageTransition,
41
GLSLObjectRenderer,
42
GLSLObjectFilter,
43
};
44
48
enum
Stage
49
{
50
Vertex,
51
Geometry,
52
Fragment,
53
54
Program,
55
};
56
60
struct
Port
61
{
62
string
key;
63
string
vuoTypeName;
64
json_object
*vuoPortDetails;
65
};
66
67
VuoShaderFile
(
Type
type
);
68
VuoShaderFile
(
VuoFileUtilities::File
file,
const
string
&overriddenFragmentSource=
""
);
69
70
static
VuoFileUtilities::File
getTemplate
(
Type
type
);
71
static
string
stageName
(
Stage
stage);
72
void
dump
();
73
74
string
name
();
75
76
Type
type
();
77
string
typeName
();
78
string
typeNameISF
();
79
80
// bool typeAllowsVertexShader(); // All types allow a Vertex Shader.
81
bool
typeAllowsGeometryShader
();
82
bool
typeAllowsFragmentShader
();
83
84
static
set<string>
supportedVuoTypes
();
85
86
VuoCompositionMetadata
*
metadata
();
87
void
setMetadata
(
VuoCompositionMetadata
*
metadata
);
88
89
json_object
*
vuoModuleMetadata
();
90
void
setVuoModuleMetadata
(
json_object
*
metadata
);
91
92
vector<Port>
inputPorts
();
93
void
setInputPorts
(vector<Port> ports);
94
bool
showsTime
();
95
96
Port
outputPort
();
97
98
string
&
vertexSource
();
99
void
setVertexSource
(
const
string
&source);
100
string
expandedVertexSource
();
101
102
string
&
geometrySource
();
103
void
setGeometrySource
(
const
string
&source);
104
string
expandedGeometrySource
();
105
106
string
&
fragmentSource
();
107
void
setFragmentSource
(
const
string
&source);
108
string
expandedFragmentSource
();
109
110
void
save
(
string
filePath);
111
string
fragmentFileContents
();
112
113
private
:
114
void
init(
VuoFileUtilities::File
file,
const
string
&overriddenFragmentSource=
""
);
115
string
readStage(
VuoFileUtilities::File
path);
116
void
splitMetadataAndSource(
string
inputString,
json_object
**outputMetadata,
string
&outputSourceString);
117
void
parseMetadata(
json_object
*
metadata
);
118
string
vuoTypeForIsfType(
string
isfType);
119
string
isfTypeForVuoType(
string
vuoType);
120
string
glslDeclarationForPort(
Port
port);
121
void
saveStage(
string
filePath,
string
&source,
json_object
*
vuoModuleMetadata
=NULL);
122
string
stageFileContents(
string
&source,
json_object
*
vuoModuleMetadata
=NULL);
123
string
spacesToTabs(
string
&str);
124
void
insertPreamble(ostringstream &oss,
bool
isFragment);
125
126
json_object
*_vuoModuleMetadata;
127
128
string
basename;
129
string
extension;
130
131
Type
_type;
132
133
vector<Port> _inputPorts;
134
string
outputKey;
135
string
outputName;
136
137
string
_vertexSource;
138
string
_geometrySource;
139
string
_fragmentSource;
140
141
string
isfVersion;
142
string
shaderVersion;
143
string
_name;
144
string
copyright;
145
string
license;
146
string
description;
147
string
homepageLink;
148
string
documentationLink;
149
vector<string> categories;
150
vector<string> keywords;
151
vector<string> examples;
152
bool
_showsTime;
153
};
Generated on Wed Feb 26 2020 23:19:29 for Vuo by
1.8.17