forked from Hartmut/paradiso
- update copyright
- add instructions for cross-compilation - add utility function for Windows and Linux executable path
This commit is contained in:
parent
a4f6803c35
commit
317cde6fa1
30 changed files with 243 additions and 102 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2023-2024 Hartmut Seichter
|
||||
* Copyright 2023-2025 Hartmut Seichter and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2023-2024 Hartmut Seichter
|
||||
* Copyright 2023-2025 Hartmut Seichter and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -60,7 +60,8 @@ struct Bitmap final {
|
|||
* @param[in] data vector of RGBA values
|
||||
* @return bitmap with data from this call
|
||||
*/
|
||||
static constexpr Bitmap from_data(Size size, std::vector<RGBA> data) noexcept {
|
||||
static constexpr Bitmap from_data(Size size,
|
||||
std::vector<RGBA> data) noexcept {
|
||||
assert(data.size() == size.height * size.width);
|
||||
return {.size = size, .data = data};
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2023-2024 Hartmut Seichter
|
||||
* Copyright 2023-2025 Hartmut Seichter and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -25,8 +25,8 @@
|
|||
|
||||
#include <paradiso/bitmap.hpp>
|
||||
|
||||
#include <string_view>
|
||||
#include <memory>
|
||||
#include <string_view>
|
||||
|
||||
namespace paradiso {
|
||||
|
||||
|
@ -41,7 +41,6 @@ struct BitmapIO {
|
|||
std::string path() const;
|
||||
|
||||
private:
|
||||
|
||||
struct Impl;
|
||||
std::unique_ptr<Impl> impl_;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2023-2024 Hartmut Seichter
|
||||
* Copyright 2023-2025 Hartmut Seichter and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2023-2024 Hartmut Seichter
|
||||
* Copyright 2023-2025 Hartmut Seichter and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2023-2024 Hartmut Seichter
|
||||
* Copyright 2023-2025 Hartmut Seichter and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -23,22 +23,20 @@
|
|||
#ifndef PARADISO_GLOBALS_HPP
|
||||
#define PARADISO_GLOBALS_HPP
|
||||
|
||||
#include <cstdint>
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
|
||||
#include <memory>
|
||||
#include <array>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <vector>
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <numeric>
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
#include <numeric>
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2023-2024 Hartmut Seichter
|
||||
* Copyright 2023-2025 Hartmut Seichter and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -26,7 +26,6 @@
|
|||
#include <paradiso/globals.hpp>
|
||||
#include <paradiso/matrixbase.hpp>
|
||||
|
||||
|
||||
namespace paradiso {
|
||||
|
||||
template <std::size_t R, std::size_t C, typename Scalar, bool RowMajor = false>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2023-2024 Hartmut Seichter
|
||||
* Copyright 2023-2025 Hartmut Seichter and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -43,9 +43,13 @@ template <typename Scalar, typename Derived> struct MatrixBase {
|
|||
constexpr iterator begin() noexcept { return this->data(); }
|
||||
constexpr iterator end() noexcept { return this->data() + size(); }
|
||||
constexpr const_iterator begin() const noexcept { return this->data(); }
|
||||
constexpr const_iterator end() const noexcept { return this->data() + size(); }
|
||||
constexpr const_iterator end() const noexcept {
|
||||
return this->data() + size();
|
||||
}
|
||||
constexpr const_iterator cbegin() const noexcept { return this->data(); }
|
||||
constexpr const_iterator cend() const noexcept { return this->data() + size(); }
|
||||
constexpr const_iterator cend() const noexcept {
|
||||
return this->data() + size();
|
||||
}
|
||||
|
||||
constexpr Scalar& operator[](std::size_t i) { return this->data()[i]; }
|
||||
constexpr const Scalar& operator[](std::size_t i) const {
|
||||
|
@ -111,10 +115,12 @@ template <typename Scalar, typename Derived> struct MatrixBase {
|
|||
}
|
||||
|
||||
constexpr void operator+=(const Derived& b) {
|
||||
std::transform((*this).begin(),(*this).end(),b.begin(),(*this).begin(),std::plus<>());
|
||||
std::transform((*this).begin(), (*this).end(), b.begin(),
|
||||
(*this).begin(), std::plus<>());
|
||||
}
|
||||
constexpr void operator-=(const Derived& b) {
|
||||
std::transform((*this).begin(),(*this).end(),b.begin(),(*this).begin(),std::minus<>());
|
||||
std::transform((*this).begin(), (*this).end(), b.begin(),
|
||||
(*this).begin(), std::minus<>());
|
||||
}
|
||||
|
||||
constexpr const Derived operator*(const Scalar& b) const {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2023-2024 Hartmut Seichter
|
||||
* Copyright 2023-2025 Hartmut Seichter and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2023-2024 Hartmut Seichter
|
||||
* Copyright 2023-2025 Hartmut Seichter and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2023-2024 Hartmut Seichter
|
||||
* Copyright 2023-2025 Hartmut Seichter and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2023-2024 Hartmut Seichter
|
||||
* Copyright 2023-2025 Hartmut Seichter and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
38
src/lib/include/paradiso/utils.hpp
Normal file
38
src/lib/include/paradiso/utils.hpp
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright 2023-2025 Hartmut Seichter and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*/
|
||||
#ifndef PARADISO_UTILS_HPP
|
||||
#define PARADISO_UTILS_HPP
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
namespace paradiso {
|
||||
|
||||
using path = std::filesystem::path;
|
||||
|
||||
/**
|
||||
* @return executable path
|
||||
*/
|
||||
path get_executable_path();
|
||||
} // namespace paradiso
|
||||
|
||||
#endif
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2023-2024 Hartmut Seichter
|
||||
* Copyright 2023-2025 Hartmut Seichter and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2023-2024 Hartmut Seichter
|
||||
* Copyright 2023-2025 Hartmut Seichter and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -23,8 +23,8 @@
|
|||
#ifndef PARADISO_WINDOW_HPP
|
||||
#define PARADISO_WINDOW_HPP
|
||||
|
||||
#include <paradiso/globals.hpp>
|
||||
#include <paradiso/geometry.hpp>
|
||||
#include <paradiso/globals.hpp>
|
||||
|
||||
#include <functional>
|
||||
#include <stack>
|
||||
|
@ -72,7 +72,6 @@ struct Window final {
|
|||
|
||||
void set_resizecallback(on_resizecallback_t f) { on_resize_ = f; }
|
||||
|
||||
|
||||
bool visible() const;
|
||||
Window& set_visible(bool is_visible);
|
||||
|
||||
|
@ -83,8 +82,6 @@ struct Window final {
|
|||
std::unique_ptr<impl> impl_;
|
||||
|
||||
on_resizecallback_t on_resize_;
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace paradiso
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue