summaryrefslogtreecommitdiff
path: root/effects.h
diff options
context:
space:
mode:
authorFox Caminiti <fox@foxcam.net>2022-08-21 22:05:10 -0400
committerFox Caminiti <fox@foxcam.net>2022-08-21 22:05:10 -0400
commitd03d7187c1881237b1a98404a125507d33d85a0e (patch)
treee0409ebb4bec224b1231317e3e7743fb9349b989 /effects.h
parented51dab429e467fc144f0bfbed70a5291c8a0a27 (diff)
a bit of housekeeping
Diffstat (limited to 'effects.h')
-rw-r--r--effects.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/effects.h b/effects.h
new file mode 100644
index 0000000..58787c2
--- /dev/null
+++ b/effects.h
@@ -0,0 +1,76 @@
+enum effect_display_type
+{
+ standard,
+ levels
+};
+
+struct effect_supported_renderers
+{
+ bool32 renderer_effect_gpu;
+#if ARM
+ bool32 renderer_effect_neon;
+#else
+ bool32 renderer_effect_avx;
+ bool32 renderer_effect_sse;
+#endif
+ bool32 renderer_effect_scalar;
+};
+
+struct effect_header
+{
+ char *Name;
+ void (*func)(source *, layer_bitmap_info *, memory *, property_channel []);
+ uint16 NumberOfProperties;
+ effect_display_type DisplayType;
+ // effect_supported_renderers SupportedRenderers;
+ property_header PropertyHeader[MAX_PROPERTIES_PER_EFFECT];
+};
+
+struct effect {
+ char *Name;
+ void (*func)(source *, layer_bitmap_info *, memory *, property_channel []);
+ uint16 NumberOfProperties;
+ effect_display_type DisplayType;
+
+ struct gl_effect {
+ uint32 ShaderProgram;
+ };
+
+ gl_effect GL_Effect;
+ property_channel Property[MAX_PROPERTIES_PER_EFFECT];
+ bool32 UIIsCollapsed = 0;
+ bool32 IsActive = 1;
+};
+
+
+#if WINDOWS
+static effect_header EffectList[3];
+#else
+static effect_header EffectList[] {
+ {
+ "Solid Color",
+ &Effect_DrawColor, 2, standard, {
+ {"Color", {.col = V4(0.0f, 0.0f, 0.0f, 1.0f)}, type_color, NORMALIZED_COL_MIN, NORMALIZED_COL_MAX},
+ {"Blend mode", {.blendmode = blend_normal}, type_blendmode},
+ }
+ },
+ {
+ "Levels",
+ &Effect_Levels, 6, levels, {
+ {"Start point", {0.0f}, type_real},
+ {"Mid point", {1.0f}, type_real},
+ {"End point", {1.0f}, type_real},
+ {"Start Col", {.col = V4(0.0f)}, type_color},
+ {"Mid Col", {.col = V4(1.0f)}, type_color},
+ {"End Col", {.col = V4(1.0f)}, type_color},
+ }
+ },
+ {
+ "Gaussian Blur",
+ &Effect_GaussianBlur, 1, standard, {
+ {"Radius", {0.0f}, type_real, 0.0f, 500.0f},
+ }
+ }
+};
+#endif
+