From b26f27d9e3fd44ec5775accdc3666a339684be4c Mon Sep 17 00:00:00 2001 From: Fox Caminiti Date: Mon, 1 Aug 2022 20:03:12 -0400 Subject: large changes to bitmap structure --- effects.cpp | 45 ++++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) (limited to 'effects.cpp') 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; -- cgit v1.2.3