Let's just use 1 PD_API header

This commit is contained in:
2026-01-25 20:57:14 +01:00
parent 337c016824
commit fb46f4d36a
63 changed files with 289 additions and 459 deletions

View File

@@ -25,10 +25,10 @@ SOFTWARE.
*/
#include <pd/core/core.hpp>
#include <pd/image/pd_p_api.hpp>
#include <pd/pd_p_api.hpp>
namespace PD {
class PD_IMAGE_API Image {
class PD_API Image {
public:
enum Format {
RGBA, // bpp == 4

View File

@@ -25,7 +25,7 @@ SOFTWARE.
*/
#include <pd/core/core.hpp>
#include <pd/image/pd_p_api.hpp>
#include <pd/pd_p_api.hpp>
namespace PD {
/**
@@ -38,7 +38,7 @@ namespace ImgBlur {
* @param si sigma value to use
* @return list of kernel values
*/
PD_IMAGE_API std::vector<float> GaussianKernel(int radius, float si);
PD_API std::vector<float> GaussianKernel(int radius, float si);
/**
* Gaussian Blur for basic Image Buffer
* @param buf Image Buffer (unsigned char)
@@ -48,7 +48,7 @@ PD_IMAGE_API std::vector<float> GaussianKernel(int radius, float si);
* @param si Blur sigma
* @param idxfn Indexing function
*/
PD_IMAGE_API void GaussianBlur(
PD_API void GaussianBlur(
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;
@@ -63,7 +63,7 @@ PD_IMAGE_API void GaussianBlur(
* @param si Blur sigma
* @param idxfn Indexing function
*/
PD_IMAGE_API void GaussianBlur(
PD_API void GaussianBlur(
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;

View File

@@ -26,7 +26,7 @@ SOFTWARE.
#include <pd/core/core.hpp>
#include <pd/image/image.hpp>
#include <pd/image/pd_p_api.hpp>
#include <pd/pd_p_api.hpp>
namespace PD {
/**
@@ -41,10 +41,10 @@ namespace ImgConvert {
* @param w width of the image
* @param h height of the image
*/
PD_IMAGE_API
PD_API
void RGB24toRGBA32(std::vector<PD::u8>& out, const std::vector<u8>& in,
const int& w, const int& h);
PD_IMAGE_API
PD_API
void RGB32toRGBA24(std::vector<u8>& out, const std::vector<u8>& in,
const int& w, const int& h);
/**
@@ -53,7 +53,7 @@ void RGB32toRGBA24(std::vector<u8>& out, const std::vector<u8>& in,
* @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_API void Reverse32(std::vector<u8>& buf, const int& w, const int& h);
PD_API void ReverseBuf(std::vector<u8>& buf, size_t bpp, int w, int h);
} // namespace ImgConvert
} // namespace PD

View File

@@ -1,51 +0,0 @@
#pragma once
/*
MIT License
Copyright (c) 2024 - 2025 René Amthor (tobid7)
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.
*/
/** Generated with ppam */
#ifdef _WIN32 // Windows (MSVC Tested)
#ifdef PD_IMAGE_BUILD_SHARED
#define PD_IMAGE_API __declspec(dllexport)
#else
#define PD_IMAGE_API __declspec(dllimport)
#endif
#elif defined(__APPLE__) // macOS (untested yet)
#ifdef PD_IMAGE_BUILD_SHARED
#define PD_IMAGE_API __attribute__((visibility("default")))
#else
#define PD_IMAGE_API
#endif
#elif defined(__linux__) // Linux (untested yet)
#ifdef PD_IMAGE_BUILD_SHARED
#define PD_IMAGE_API __attribute__((visibility("default")))
#else
#define PD_IMAGE_API
#endif
#elif defined(__3DS__) // 3ds Specific
// Only Static supported
#define PD_IMAGE_API
#else
#define PD_IMAGE_API
#endif