Move import math.h to ImagingPlatform

This commit is contained in:
Aleksandr Karpinskii 2024-09-01 21:14:51 +04:00 committed by Александр Карпинский
parent ff7c29ced9
commit 039869fe77
13 changed files with 3 additions and 23 deletions

View File

@ -85,8 +85,6 @@
#include "libImaging/Imaging.h" #include "libImaging/Imaging.h"
#define _USE_MATH_DEFINES
#include <math.h>
#include <stddef.h> #include <stddef.h>
#undef VERBOSE #undef VERBOSE

View File

@ -15,7 +15,6 @@
#include "libImaging/Imaging.h" #include "libImaging/Imaging.h"
#include <math.h>
#include <float.h> #include <float.h>
#define MAX_INT32 2147483647.0 #define MAX_INT32 2147483647.0

View File

@ -1,5 +1,4 @@
#include "Imaging.h" #include "Imaging.h"
#include <math.h>
/* 8 bits for result. Table can overflow [0, 1.0] range, /* 8 bits for result. Table can overflow [0, 1.0] range,
so we need extra bits for overflow and negative values. so we need extra bits for overflow and negative values.

View File

@ -34,8 +34,6 @@
#include "Imaging.h" #include "Imaging.h"
#include <math.h>
#define CEIL(v) (int)ceil(v) #define CEIL(v) (int)ceil(v)
#define FLOOR(v) ((v) >= 0.0 ? (int)(v) : (int)floor(v)) #define FLOOR(v) ((v) >= 0.0 ? (int)(v) : (int)floor(v))

View File

@ -17,8 +17,6 @@
#include "Imaging.h" #include "Imaging.h"
#include <math.h>
Imaging Imaging
ImagingEffectMandelbrot(int xsize, int ysize, double extent[4], int quality) { ImagingEffectMandelbrot(int xsize, int ysize, double extent[4], int quality) {
/* Generate a Mandelbrot set covering the given extent */ /* Generate a Mandelbrot set covering the given extent */

View File

@ -17,8 +17,6 @@
#include "Imaging.h" #include "Imaging.h"
#include "math.h"
Imaging Imaging
ImagingFill(Imaging im, const void *colour) { ImagingFill(Imaging im, const void *colour) {
int x, y; int x, y;

View File

@ -16,10 +16,6 @@
extern "C" { extern "C" {
#endif #endif
#ifndef M_PI
#define M_PI 3.1415926535897932384626433832795
#endif
/* -------------------------------------------------------------------- */ /* -------------------------------------------------------------------- */
/* /*

View File

@ -10,6 +10,9 @@
#define PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN
#include <Python.h> #include <Python.h>
#define _USE_MATH_DEFINES
#include <math.h>
/* Check that we have an ANSI compliant compiler */ /* Check that we have an ANSI compliant compiler */
#ifndef HAVE_PROTOTYPES #ifndef HAVE_PROTOTYPES
#error Sorry, this library requires support for ANSI prototypes. #error Sorry, this library requires support for ANSI prototypes.

View File

@ -18,8 +18,6 @@
#include "Imaging.h" #include "Imaging.h"
#include <math.h>
ImagingPalette ImagingPalette
ImagingPaletteNew(const char *mode) { ImagingPaletteNew(const char *mode) {
/* Create a palette object */ /* Create a palette object */

View File

@ -1428,7 +1428,6 @@ quantize(
} }
#ifdef TEST_NEAREST_NEIGHBOUR #ifdef TEST_NEAREST_NEIGHBOUR
#include <math.h>
{ {
uint32_t bestmatch, bestdist, dist; uint32_t bestmatch, bestdist, dist;
HashTable *h2; HashTable *h2;

View File

@ -1,7 +1,5 @@
#include "Imaging.h" #include "Imaging.h"
#include <math.h>
#define ROUND_UP(f) ((int)((f) >= 0.0 ? (f) + 0.5F : (f) - 0.5F)) #define ROUND_UP(f) ((int)((f) >= 0.0 ? (f) + 0.5F : (f) - 0.5F))
UINT32 UINT32

View File

@ -1,7 +1,5 @@
#include "Imaging.h" #include "Imaging.h"
#include <math.h>
#define ROUND_UP(f) ((int)((f) >= 0.0 ? (f) + 0.5F : (f) - 0.5F)) #define ROUND_UP(f) ((int)((f) >= 0.0 ? (f) + 0.5F : (f) - 0.5F))
struct filter { struct filter {

View File

@ -28,8 +28,6 @@
#include "libImaging/Imaging.h" #include "libImaging/Imaging.h"
#include "thirdparty/pythoncapi_compat.h" #include "thirdparty/pythoncapi_compat.h"
#include <math.h>
/* compatibility wrappers (defined in _imaging.c) */ /* compatibility wrappers (defined in _imaging.c) */
extern int extern int
PyImaging_CheckBuffer(PyObject *buffer); PyImaging_CheckBuffer(PyObject *buffer);