From 6eb627210eb2b77bcde7ca75d9bcb5b50d240f64 Mon Sep 17 00:00:00 2001 From: Fox Caminiti Date: Mon, 28 Nov 2022 15:03:08 -0500 Subject: recursion improvements --- functions.h | 75 ++----------------------------------------------------------- 1 file changed, 2 insertions(+), 73 deletions(-) (limited to 'functions.h') diff --git a/functions.h b/functions.h index 9cd6c6a..2825f85 100644 --- a/functions.h +++ b/functions.h @@ -1,5 +1,3 @@ -// static bool32 AV_IsFileSupported(char *filename, bool32 *IsVideo); - static void Memory_Copy(uint8 *Address_Write, uint8 *Address_Read, uint64 Size); static void Arbitrary_Zero(uint8 *Address_Write, uint64 Size); static void Arbitrary_SwapData(memory *Memory, uint8 *Address_0, uint8 *Address_1, uint64 Size); @@ -17,6 +15,8 @@ static ImVec2 Layer_LocalToScreenSpace(project_state *State, memory *Memory, blo static v2 TransformPoint(layer_transforms T, real32 Width, real32 Height, v2 Point); +static void Layer_GetDimensions(memory *Memory, block_layer *Layer, int *Width, int *Height); + static void * Memory_PushScratch(memory *Memory, uint64 Size); static void Memory_PopScratch(memory *Memory, uint64 Size); @@ -35,75 +35,4 @@ static layer_transforms Layer_GetTransforms(block_layer *Layer); void GL_GenAndBindTexture(GLuint *GLTexture, int Width, int Height, int BytesPerPixel, void *BufferAddress); static real32 Bezier_SolveYForX(v2 Point_P0, v2 Point_P1, v2 Point_P2, v2 Point_P3, real32 X); -# if 0 - -// Buffer management - -static void * Layer_AllocateBitmap(memory *Memory, uint16 Width, uint16 Height, uint16 BytesPerPixel); // -static project_layer * Layer_Init(project_data *File, memory *Memory); // Initializes a layer's name and properties. Add a source manually. - - -static void Bitmap_CalcPackedDimensions(uint16 Width, uint16 Height, uint16 *WidthP, uint16 *HeightP); // Returns the dimensions a packed bitmap should be in memory. -static void Bitmap_ConvertPacking(void *Buffer, void *DestBuffer, uint16 Width, uint16 Height, uint16 BytesPerPixel, uint16 Which); -static void Bitmap_CalcHistogram(void *Data, void *Input, uint16 BytesPerPixel, uint64 TotalBytes); -static uint16 Bitmap_CalcByteOffset(uint16 BytesPerPixel); // Returns the amount of bytes a loop goes through depending on the InstructionMode. -static uint64 Bitmap_CalcTotalBytes(uint16 Width, uint16 Height, uint16 BytesPerPixel); // Returns the total amount of bytes a bitmap takes up. -static uint64 Bitmap_CalcUnpackedBytes(uint16 Width, uint16 Height, uint16 BytesPerPixel); - -static bool32 Source_Generate(project_data *File, project_state *State, memory *Memory, void *Path); // Fills out source info if the source is a supported file. - -// Libav (ffmpeg) backend for decoding video - -static void AV_Init(char *filename, source *Source, memory *Memory); // Initializes all internal structs and calculates average PTS. -static cached_bitmap * AV_LoadVideoFrame(source *Source, memory *Memory, int32 TimelineFrame); // Loads video frame at TimelineFrame. - -static cached_bitmap * Cache_CheckBitmap(source *Source, layer_bitmap_info *BitmapInfo, memory *Memory, int32 TimelineFrame); - -// OpenGL - -static void GL_UpdateTexture(gl_effect_layer *Test, void *Data, uint16 Width, uint16 Height, bool32 Multisample); -static void GL_RasterizeShape(project_layer *Layer, mask *Mask); - -static v2 Line_RatioToPoint(v2 a, v2 b, float ratio); -static v2 ImGui_ScreenPointToCompUV(ImVec2 ViewportMin, ImVec2 CompPos, ImVec2 CompZoom, ImVec2 MousePos); - -void Bezier_CubicCalcPoints(v2 p1, v2 p2, v2 p3, v2 p4, void *Data, uint32 *Increment); - -static void Mask_TriangulateAndRasterize(memory *Memory, project_layer *Layer, mask *Mask); - - -static void History_Undo(memory *Memory); -static void History_Redo(memory *Memory); - -static void History_Entry_Commit(memory *Memory, action_entry_type Type, char *Name); -static void History_Entry_End(memory *Memory); -static void History_Entry_SetPointer(memory *Memory, void *Data); - -static void History_Action_Change(memory *Memory, void *DataLocation, void *OriginalData, void *NewData, action_type ActionChange); -static void History_Action_Change_SwapBool(memory *Memory, bool32 *Bool); -static void History_Action_Change_V2(memory *Memory, v2 *DataAddress, v2 *OriginalData, v2 *NewData); -static void History_Action_Change_Increment(memory *Memory, void *Data, action_type); -static void History_Action_Change_Decrement(memory *Memory, void *Data, action_type); -static void History_Action_Shift(memory *Memory, action_type ActionChange, void *DataAddress, int16 Direction, int16 Index); -static void History_Action_Shift_2(memory *Memory, void *StartingAddress, uint32 Size, uint16 NumberOf, int16 Direction, int16 Index); -static void History_Action_StoreData(memory *Memory, void *DataAddress, uint64 ByteSize); -static void History_Action_Undo(memory *Memory); -static void History_Action_Redo(memory *Memory); - -#if ARM -static void NEON_RenderLayer(transform_info T, comp_buffer *Buffer, rectangle RenderRegion); -#else -static void AVX2_RenderLayer(transform_info TransformInfo, comp_buffer *Buffer, rectangle RenderRegion); -static void SSE2_RenderLayer(transform_info TransformInfo, comp_buffer *Buffer, rectangle RenderRegion); -#endif -static void Fallback_RenderLayer(transform_info TransformInfo, comp_buffer *Buffer, rectangle RenderRegion); -static void PushRect(rectangle RenderRegion); -static bool32 CheckQueue(render_queue RenderInfo, uint16 Index); - -// Effects - -static void Effect_DrawColor(source *Source, layer_bitmap_info *BitmapInfo, memory *Memory, property_channel Property[]); -static void Effect_Levels(source *Source, layer_bitmap_info *BitmapInfo, memory *Memory, property_channel Property[]); -static void Effect_GaussianBlur(source *Source, layer_bitmap_info *BitmapInfo, memory *Memory, property_channel Property[]); -#endif -- cgit v1.2.3