FuncDoodle
Loading...
Searching...
No Matches
DynArr.h
Go to the documentation of this file.
1
19
20#pragma once
21
29
30#include "Project/Frame.h"
31
32namespace FuncDoodle {
45 public:
56 int width, int height, Col bgCol, unsigned long initialcap = 10);
58
65 void PushBack(const Frame* value);
70 void PushBackEmpty();
77 void InsertAfterEmpty(unsigned long index);
84 void InsertBeforeEmpty(unsigned long index);
91 void InsertAfter(unsigned long index, const Frame* value);
98 void InsertAfter(unsigned long index, Frame val);
105 void InsertBefore(unsigned long index, const Frame* value);
112 void InsertBefore(unsigned long index, Frame val);
119 void MoveBackward(unsigned long i);
126 void MoveForward(unsigned long i);
133 void Remove(unsigned long index);
134
137 Frame* operator[](unsigned long index);
140 const Frame* operator[](unsigned long index) const;
148 Frame* Get(unsigned long index);
149
156 [[nodiscard]] unsigned long Size() const { return size; }
163 [[nodiscard]] unsigned long Capacity() const { return m_Capacity; }
164
165 private:
166 std::vector<Frame> m_Data;
167 unsigned long m_Capacity;
168 unsigned long size = 0;
172
173 void Resize(unsigned long newCap);
174 };
175} // namespace FuncDoodle
Defines pixel color structures and frame/image data containers.
Wraps an ImageArray with higher-level frame editing operations.
Definition Frame.h:248
int m_Height
Definition DynArr.h:170
unsigned long Size() const
Returns the number of stored frames.
Definition DynArr.h:156
void PushBack(const Frame *value)
Appends a copy of a frame.
Definition DynArr.cc:20
Frame * operator[](unsigned long index)
Returns mutable frame access by index.
Definition DynArr.cc:165
LongIndexArray(int width, int height, Col bgCol, unsigned long initialcap=10)
Creates a frame array with default empty frames.
Definition DynArr.cc:8
void MoveBackward(unsigned long i)
Moves a frame one slot toward the beginning.
Definition DynArr.cc:139
void Remove(unsigned long index)
Removes a frame at an index.
Definition DynArr.cc:155
unsigned long Capacity() const
Returns the reserved frame capacity.
Definition DynArr.h:163
void MoveForward(unsigned long i)
Moves a frame one slot toward the end.
Definition DynArr.cc:147
void InsertBeforeEmpty(unsigned long index)
Inserts an empty frame before an index.
Definition DynArr.cc:58
Frame * Get(unsigned long index)
Returns mutable frame access by index.
Definition DynArr.cc:181
Col m_BG
Definition DynArr.h:171
void InsertBefore(unsigned long index, const Frame *value)
Inserts a frame copy before an index.
Definition DynArr.cc:106
unsigned long m_Capacity
Definition DynArr.h:167
void Resize(unsigned long newCap)
Definition DynArr.cc:189
unsigned long size
Definition DynArr.h:168
void PushBackEmpty()
Appends a newly created empty frame.
Definition DynArr.cc:34
void InsertAfter(unsigned long index, const Frame *value)
Inserts a frame copy after an index.
Definition DynArr.cc:73
std::vector< Frame > m_Data
Definition DynArr.h:166
int m_Width
Definition DynArr.h:169
void InsertAfterEmpty(unsigned long index)
Inserts an empty frame after an index.
Definition DynArr.cc:43
The FuncDoodle C++ namespace.
Definition Common.h:12
A struct holding an RGB8 color.
Definition Frame.h:47