summaryrefslogtreecommitdiff
path: root/effects.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'effects.cpp')
-rw-r--r--effects.cpp45
1 files changed, 26 insertions, 19 deletions
diff --git a/effects.cpp b/effects.cpp
index 6c3c946..d427778 100644
--- a/effects.cpp
+++ b/effects.cpp
@@ -1,4 +1,4 @@
-internal void
+static void
DrawColor(pixel_buffer *Buffer, memory *Memory, property_channel Property[])
{
v4 FloatColor = Property[0].CurrentValue.col;
@@ -177,17 +177,22 @@ DrawColor(pixel_buffer *Buffer, memory *Memory, property_channel Property[])
}
}
-internal void
+static void
DrawGradient(pixel_buffer *Buffer, memory *Memory, property_channel Property[])
{
v4 StartColor = Property[0].CurrentValue.col;
v4 EndColor = Property[1].CurrentValue.col;
}
+static void
+Levels(pixel_buffer *Buffer, memory *Memory, property_channel Property[])
+{
+}
+
#if WINDOWS
-global_variable effect_header EffectList[3];
+static effect_header EffectList[3];
#else
-global_variable effect_header EffectList[] {
+static effect_header EffectList[] {
{
"Solid Color",
&DrawColor, 2, standard, {
@@ -205,7 +210,7 @@ global_variable effect_header EffectList[] {
},
{
"Levels",
- &DrawColor, 6, levels, {
+ &Levels, 6, levels, {
{"Start point", {0.0f}, type_real},
{"Mid point", {1.0f}, type_real},
{"End point", {1.0f}, type_real},
@@ -275,9 +280,11 @@ global_variable effect_header EffectList[] {
}
#endif
-internal void
+static void
AddEffect(project_layer *Layer, memory *Memory, uint16 EffectListIndex)
{
+ if (Layer == NULL)
+ return;
Layer->Effect[Layer->NumberOfEffects] = (effect *)AllocateMemory(Memory, sizeof(effect), F_Effects);
effect *Effect = Layer->Effect[Layer->NumberOfEffects];
effect_header EffectHeader = EffectList[EffectListIndex];
@@ -296,13 +303,13 @@ AddEffect(project_layer *Layer, memory *Memory, uint16 EffectListIndex)
Layer->NumberOfEffects++;
}
-internal void
+static void
CopyToBuffer(pixel_buffer *, uint16 asda = 0);
-internal void
+static void
UpdateEffects(project_layer *Layer, memory *Memory)
{
- image_source *Source = (image_source *)Layer->RenderInfo;
+ source_image *Source = (source_image *)Layer->RenderInfo;
if (!Source->Raster.EffectBuffer) {
Source->Raster.EffectBuffer = AllocateMemory(Memory, Source->Raster.Width * Source->Raster.Height * Source->Raster.BytesPerPixel,
B_Scratch);
@@ -317,7 +324,7 @@ UpdateEffects(project_layer *Layer, memory *Memory)
#if 0
-internal void
+static void
DrawColor(pixel_buffer *Buffer, memory *Memory, property_channel Property[])
{
v4 FloatColor = Property[0].CurrentValue.col;
@@ -344,7 +351,7 @@ DrawColor(pixel_buffer *Buffer, memory *Memory, property_channel Property[])
}
}
-internal void
+static void
Invert(pixel_buffer *Buffer, memory *Memory, property_channel Property[])
{
uint8 *Row = ((uint8 *)Buffer->EffectBuffer);
@@ -368,7 +375,7 @@ Invert(pixel_buffer *Buffer, memory *Memory, property_channel Property[])
}
}
-internal void
+static void
DrawGradient(pixel_buffer *Buffer, memory *Memory, property_channel Property[])
{
v4 StartColor = Property[0].CurrentValue.col;
@@ -399,7 +406,7 @@ DrawGradient(pixel_buffer *Buffer, memory *Memory, property_channel Property[])
}
}
-internal void
+static void
DrawGrid(pixel_buffer *Buffer, memory *Memory, property_channel Property[])
{
v4 StartColor = Property[0].CurrentValue.col;
@@ -427,7 +434,7 @@ DrawGrid(pixel_buffer *Buffer, memory *Memory, property_channel Property[])
}
}
-internal real32
+static real32
KernLoop(pixel_buffer *Buffer, int16 Xp, int16 Yp, real32 Value[8])
{
real32 P[9];
@@ -457,7 +464,7 @@ KernLoop(pixel_buffer *Buffer, int16 Xp, int16 Yp, real32 Value[8])
return Sum;
}
-internal void
+static void
SpacialFilter(pixel_buffer *Buffer, memory *Memory, property_channel Property[])
{
real32 P[9];
@@ -515,7 +522,7 @@ SpacialFilter(pixel_buffer *Buffer, memory *Memory, property_channel Property[])
}
-internal void
+static void
Gaussian(pixel_buffer *Buffer, void *FloatStorage, real32 Radius)
{
if (Radius < 1.0f)
@@ -581,7 +588,7 @@ Gaussian(pixel_buffer *Buffer, void *FloatStorage, real32 Radius)
}
}
-internal void
+static void
Canny(pixel_buffer *Buffer, memory *Memory, property_channel Property[])
{
real32 SH[9] = { -1, 0, 1,
@@ -711,7 +718,7 @@ Canny(pixel_buffer *Buffer, memory *Memory, property_channel Property[])
}
}
-internal void
+static void
Levels(pixel_buffer *Buffer, memory *Memory, property_channel Property[])
{
real32 Min = Property[0].CurrentValue.f;
@@ -777,7 +784,7 @@ Levels(pixel_buffer *Buffer, memory *Memory, property_channel Property[])
}
-internal void
+static void
GaussianBlur(pixel_buffer *Buffer, memory *Memory, property_channel Property[])
{
real32 Radius = Property[0].CurrentValue.f;