Unfiy all sub projects back into 1 libpalladium

This commit is contained in:
2026-01-25 20:44:52 +01:00
parent d2806b2061
commit 337c016824
49 changed files with 3263 additions and 3321 deletions

12
include/pd/core/timetrace.hpp Executable file → Normal file
View File

@@ -102,12 +102,12 @@ class TimeStats {
* Get Data Buffer
* @return data bufer (not edidable)
*/
const std::vector<u64> &GetData() { return val; }
const std::vector<u64>& GetData() { return val; }
/**
* Access an element in the list [not edidable]
* @return value to access
*/
const u64 &operator[](int i) { return val[smart_idx(i)]; }
const u64& operator[](int i) { return val[smart_idx(i)]; }
/**
* Get List Lengh
* @return Lengh
@@ -160,7 +160,7 @@ class Res {
* Setter for the ID (Name)
* @param v ID of the Trace
*/
void SetID(const std::string &v) { id = v; }
void SetID(const std::string& v) { id = v; }
/**
* Getter for the traces ID
* @return Trace ID
@@ -218,12 +218,12 @@ class Res {
* Begin a Trace
* @param id Name of the Trace
*/
PD_CORE_API void Beg(const std::string &id);
PD_CORE_API void Beg(const std::string& id);
/**
* End a Trace
* @param id Name of the Trace
*/
PD_CORE_API void End(const std::string &id);
PD_CORE_API void End(const std::string& id);
/**
* Collect Start end end of the trace by tracking
* when the Scope object goes out of scope
@@ -245,7 +245,7 @@ class Scope {
* Constructor requiring a Name for the Trace
* @param id Name of the Trace
*/
Scope(const std::string &id) {
Scope(const std::string& id) {
this->ID = id;
Beg(id);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

4
include/pd/image/img_blur.hpp Executable file → Normal file
View File

@@ -49,7 +49,7 @@ PD_IMAGE_API std::vector<float> GaussianKernel(int radius, float si);
* @param idxfn Indexing function
*/
PD_IMAGE_API void GaussianBlur(
std::vector<u8> &buf, int w, int h, float radius, float si,
std::vector<u8>& buf, int w, int h, float radius, float si,
std::function<int(int, int, int)> idxfn = [](int x, int y, int w) -> int {
return y * w + x;
});
@@ -64,7 +64,7 @@ PD_IMAGE_API void GaussianBlur(
* @param idxfn Indexing function
*/
PD_IMAGE_API void GaussianBlur(
void *buf, int w, int h, int bpp, float radius, float si,
void* buf, int w, int h, int bpp, float radius, float si,
std::function<int(int, int, int)> idxfn = [](int x, int y, int w) -> int {
return y * w + x;
});

12
include/pd/image/img_convert.hpp Executable file → Normal file
View File

@@ -42,18 +42,18 @@ namespace ImgConvert {
* @param h height of the image
*/
PD_IMAGE_API
void RGB24toRGBA32(std::vector<PD::u8> &out, const std::vector<u8> &in,
const int &w, const int &h);
void RGB24toRGBA32(std::vector<PD::u8>& out, const std::vector<u8>& in,
const int& w, const int& h);
PD_IMAGE_API
void RGB32toRGBA24(std::vector<u8> &out, const std::vector<u8> &in,
const int &w, const int &h);
void RGB32toRGBA24(std::vector<u8>& out, const std::vector<u8>& in,
const int& w, const int& h);
/**
* Reverse 32 (RGBA -> ABGR || ABGR -> RGBA)
* @param buf Buffer to convert
* @param w width
* @param h height
*/
PD_IMAGE_API void Reverse32(std::vector<u8> &buf, const int &w, const int &h);
PD_IMAGE_API void ReverseBuf(std::vector<u8> &buf, size_t bpp, int w, int h);
PD_IMAGE_API void Reverse32(std::vector<u8>& buf, const int& w, const int& h);
PD_IMAGE_API void ReverseBuf(std::vector<u8>& buf, size_t bpp, int w, int h);
} // namespace ImgConvert
} // namespace PD

View File

@@ -37,5 +37,5 @@ struct FontFileData {
extern FontFileData pFontData[];
extern size_t pNumFonts;
extern PD::u8 pFontsDataRaw[];
} // namespace PD
} // namespace PD
#endif

28
include/pd/ui7/layout.hpp Executable file → Normal file
View File

@@ -37,7 +37,7 @@ namespace PD {
namespace UI7 {
class PD_UI7_API Layout {
public:
Layout(const ID &id, IO::Ref io) : ID(id) {
Layout(const ID& id, IO::Ref io) : ID(id) {
this->IO = io;
DrawList = Li::DrawList::New();
DrawList->SetFont(IO->Font);
@@ -58,9 +58,9 @@ class PD_UI7_API Layout {
* Render a Simple Label
* @param label The text to draw
*/
void Label(const std::string &label);
void Label(const std::string& label);
template <typename... Args>
void Label(std::format_string<Args...> s, Args &&...args) {
void Label(std::format_string<Args...> s, Args&&... args) {
Label(std::format(s, std::forward<Args>(args)...));
}
/**
@@ -68,13 +68,13 @@ class PD_UI7_API Layout {
* @param label The buttons text
* @return if the button was pressed
*/
bool Button(const std::string &label);
bool Button(const std::string& label);
/**
* Render a Checkbox
* @param label Label of the Checkbox
* @param v A value to update
*/
void Checkbox(const std::string &label, bool &v);
void Checkbox(const std::string& label, bool& v);
/**
* Render an Image
* @param img Texture reference of the image
@@ -90,7 +90,7 @@ class PD_UI7_API Layout {
* @param precission Difine the Format string len for float/double
*/
template <typename T>
void DragData(const std::string &label, T *data, size_t num_elms = 1,
void DragData(const std::string& label, T* data, size_t num_elms = 1,
T min = std::numeric_limits<T>::min(),
T max = std::numeric_limits<T>::max(), T step = 1,
int precision = 1) {
@@ -104,7 +104,7 @@ class PD_UI7_API Layout {
AddObject(r);
}
template <typename T>
void Slider(const std::string &label, T *data,
void Slider(const std::string& label, T* data,
T min = std::numeric_limits<T>::min(),
T max = std::numeric_limits<T>::max(), int precision = 1) {
u32 id = Strings::FastHash("drd" + label + std::to_string((uintptr_t)data));
@@ -119,20 +119,20 @@ class PD_UI7_API Layout {
/** SECTION OTHERSTUFF */
const std::string GetName() const { return ID.GetName(); }
const UI7::ID &GetID() const { return this->ID; }
const UI7::ID& GetID() const { return this->ID; }
const fvec2 &GetPosition() const { return Pos; }
void SetPosition(const fvec2 &v) { Pos = v; }
const fvec2 &GetSize() const { return Size; }
void SetSize(const fvec2 &v) { Size = v; }
const fvec2& GetPosition() const { return Pos; }
void SetPosition(const fvec2& v) { Pos = v; }
const fvec2& GetSize() const { return Size; }
void SetSize(const fvec2& v) { Size = v; }
Li::DrawList::Ref GetDrawList() { return DrawList; }
void CursorInit();
void SameLine();
void CursorMove(const fvec2 &size);
void CursorMove(const fvec2& size);
bool ObjectWorkPos(fvec2 &movpos);
bool ObjectWorkPos(fvec2& movpos);
/**
* Extended Object Add Func to Add Object in Front or disable

22
include/pd/ui7/menu.hpp Executable file → Normal file
View File

@@ -36,7 +36,7 @@ namespace PD {
namespace UI7 {
class PD_UI7_API Menu {
public:
Menu(const UI7::ID &id, UI7::IO::Ref pIO);
Menu(const UI7::ID& id, UI7::IO::Ref pIO);
~Menu() {}
PD_SHARED(Menu);
@@ -45,9 +45,9 @@ class PD_UI7_API Menu {
* Render a Simple Label
* @param label The text to draw
*/
void Label(const std::string &label);
void Label(const std::string& label);
template <typename... Args>
void Label(std::format_string<Args...> s, Args &&...args) {
void Label(std::format_string<Args...> s, Args&&... args) {
Label(std::format(s, std::forward<Args>(args)...));
}
/**
@@ -55,13 +55,13 @@ class PD_UI7_API Menu {
* @param label The buttons text
* @return if the button was pressed
*/
bool Button(const std::string &label);
bool Button(const std::string& label);
/**
* Render a Checkbox
* @param label Label of the Checkbox
* @param v A value to update
*/
void Checkbox(const std::string &label, bool &v);
void Checkbox(const std::string& label, bool& v);
/**
* Render an Image
* @param img Texture reference of the image
@@ -77,7 +77,7 @@ class PD_UI7_API Menu {
* @param precission Difine the Format string len for float/double
*/
template <typename T>
void DragData(const std::string &label, T *data, size_t num_elms = 1,
void DragData(const std::string& label, T* data, size_t num_elms = 1,
T min = std::numeric_limits<T>::min(),
T max = std::numeric_limits<T>::max(), T step = 1,
int precision = 1) {
@@ -94,7 +94,7 @@ class PD_UI7_API Menu {
pLayout->AddObject(r);
}
template <typename T>
void Slider(const std::string &label, T *data,
void Slider(const std::string& label, T* data,
T min = std::numeric_limits<T>::min(),
T max = std::numeric_limits<T>::max(), int precision = 1) {
u32 id = Strings::FastHash("drd" + label + std::to_string((uintptr_t)data));
@@ -105,11 +105,11 @@ class PD_UI7_API Menu {
}
pLayout->AddObject(r);
}
void ColorEdit(const std::string &label, u32 &clr);
void ColorEdit(const std::string& label, u32& clr);
void SameLine() { pLayout->SameLine(); }
void Separator();
void SeparatorText(const std::string &label);
bool BeginTreeNode(const ID &id);
void SeparatorText(const std::string& label);
bool BeginTreeNode(const ID& id);
void EndTreeNode();
void HandleFocus();
@@ -131,7 +131,7 @@ class PD_UI7_API Menu {
Layout::Ref pLayout;
IO::Ref pIO;
ID pID;
bool *pIsShown = nullptr;
bool* pIsShown = nullptr;
bool pIsOpen = true;
std::unordered_map<u32, bool> pTreeNodes;
fvec2 TempScrollXY;