mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-05-02 23:13:40 +03:00
remove unused filter_data
This commit is contained in:
parent
bc51928171
commit
4cfc791a5b
|
@ -288,7 +288,7 @@ quad_transform(double* xin, double* yin, int x, int y, void* data)
|
||||||
/* transform filters (ImagingTransformFilter) */
|
/* transform filters (ImagingTransformFilter) */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
nearest_filter8(void* out, Imaging im, double xin, double yin, void* data)
|
nearest_filter8(void* out, Imaging im, double xin, double yin)
|
||||||
{
|
{
|
||||||
int x = COORD(xin);
|
int x = COORD(xin);
|
||||||
int y = COORD(yin);
|
int y = COORD(yin);
|
||||||
|
@ -299,7 +299,7 @@ nearest_filter8(void* out, Imaging im, double xin, double yin, void* data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
nearest_filter16(void* out, Imaging im, double xin, double yin, void* data)
|
nearest_filter16(void* out, Imaging im, double xin, double yin)
|
||||||
{
|
{
|
||||||
int x = COORD(xin);
|
int x = COORD(xin);
|
||||||
int y = COORD(yin);
|
int y = COORD(yin);
|
||||||
|
@ -310,7 +310,7 @@ nearest_filter16(void* out, Imaging im, double xin, double yin, void* data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
nearest_filter32(void* out, Imaging im, double xin, double yin, void* data)
|
nearest_filter32(void* out, Imaging im, double xin, double yin)
|
||||||
{
|
{
|
||||||
int x = COORD(xin);
|
int x = COORD(xin);
|
||||||
int y = COORD(yin);
|
int y = COORD(yin);
|
||||||
|
@ -355,7 +355,7 @@ nearest_filter32(void* out, Imaging im, double xin, double yin, void* data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
bilinear_filter8(void* out, Imaging im, double xin, double yin, void* data)
|
bilinear_filter8(void* out, Imaging im, double xin, double yin)
|
||||||
{
|
{
|
||||||
BILINEAR_HEAD(UINT8);
|
BILINEAR_HEAD(UINT8);
|
||||||
BILINEAR_BODY(UINT8, im->image8, 1, 0);
|
BILINEAR_BODY(UINT8, im->image8, 1, 0);
|
||||||
|
@ -364,7 +364,7 @@ bilinear_filter8(void* out, Imaging im, double xin, double yin, void* data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
bilinear_filter32I(void* out, Imaging im, double xin, double yin, void* data)
|
bilinear_filter32I(void* out, Imaging im, double xin, double yin)
|
||||||
{
|
{
|
||||||
BILINEAR_HEAD(INT32);
|
BILINEAR_HEAD(INT32);
|
||||||
BILINEAR_BODY(INT32, im->image32, 1, 0);
|
BILINEAR_BODY(INT32, im->image32, 1, 0);
|
||||||
|
@ -373,7 +373,7 @@ bilinear_filter32I(void* out, Imaging im, double xin, double yin, void* data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
bilinear_filter32F(void* out, Imaging im, double xin, double yin, void* data)
|
bilinear_filter32F(void* out, Imaging im, double xin, double yin)
|
||||||
{
|
{
|
||||||
BILINEAR_HEAD(FLOAT32);
|
BILINEAR_HEAD(FLOAT32);
|
||||||
BILINEAR_BODY(FLOAT32, im->image32, 1, 0);
|
BILINEAR_BODY(FLOAT32, im->image32, 1, 0);
|
||||||
|
@ -382,7 +382,7 @@ bilinear_filter32F(void* out, Imaging im, double xin, double yin, void* data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
bilinear_filter32LA(void* out, Imaging im, double xin, double yin, void* data)
|
bilinear_filter32LA(void* out, Imaging im, double xin, double yin)
|
||||||
{
|
{
|
||||||
BILINEAR_HEAD(UINT8);
|
BILINEAR_HEAD(UINT8);
|
||||||
BILINEAR_BODY(UINT8, im->image, 4, 0);
|
BILINEAR_BODY(UINT8, im->image, 4, 0);
|
||||||
|
@ -395,7 +395,7 @@ bilinear_filter32LA(void* out, Imaging im, double xin, double yin, void* data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
bilinear_filter32RGB(void* out, Imaging im, double xin, double yin, void* data)
|
bilinear_filter32RGB(void* out, Imaging im, double xin, double yin)
|
||||||
{
|
{
|
||||||
int b;
|
int b;
|
||||||
BILINEAR_HEAD(UINT8);
|
BILINEAR_HEAD(UINT8);
|
||||||
|
@ -462,7 +462,7 @@ bilinear_filter32RGB(void* out, Imaging im, double xin, double yin, void* data)
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
bicubic_filter8(void* out, Imaging im, double xin, double yin, void* data)
|
bicubic_filter8(void* out, Imaging im, double xin, double yin)
|
||||||
{
|
{
|
||||||
BICUBIC_HEAD(UINT8);
|
BICUBIC_HEAD(UINT8);
|
||||||
BICUBIC_BODY(UINT8, im->image8, 1, 0);
|
BICUBIC_BODY(UINT8, im->image8, 1, 0);
|
||||||
|
@ -476,7 +476,7 @@ bicubic_filter8(void* out, Imaging im, double xin, double yin, void* data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
bicubic_filter32I(void* out, Imaging im, double xin, double yin, void* data)
|
bicubic_filter32I(void* out, Imaging im, double xin, double yin)
|
||||||
{
|
{
|
||||||
BICUBIC_HEAD(INT32);
|
BICUBIC_HEAD(INT32);
|
||||||
BICUBIC_BODY(INT32, im->image32, 1, 0);
|
BICUBIC_BODY(INT32, im->image32, 1, 0);
|
||||||
|
@ -485,7 +485,7 @@ bicubic_filter32I(void* out, Imaging im, double xin, double yin, void* data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
bicubic_filter32F(void* out, Imaging im, double xin, double yin, void* data)
|
bicubic_filter32F(void* out, Imaging im, double xin, double yin)
|
||||||
{
|
{
|
||||||
BICUBIC_HEAD(FLOAT32);
|
BICUBIC_HEAD(FLOAT32);
|
||||||
BICUBIC_BODY(FLOAT32, im->image32, 1, 0);
|
BICUBIC_BODY(FLOAT32, im->image32, 1, 0);
|
||||||
|
@ -494,7 +494,7 @@ bicubic_filter32F(void* out, Imaging im, double xin, double yin, void* data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
bicubic_filter32LA(void* out, Imaging im, double xin, double yin, void* data)
|
bicubic_filter32LA(void* out, Imaging im, double xin, double yin)
|
||||||
{
|
{
|
||||||
BICUBIC_HEAD(UINT8);
|
BICUBIC_HEAD(UINT8);
|
||||||
BICUBIC_BODY(UINT8, im->image, 4, 0);
|
BICUBIC_BODY(UINT8, im->image, 4, 0);
|
||||||
|
@ -522,7 +522,7 @@ bicubic_filter32LA(void* out, Imaging im, double xin, double yin, void* data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
bicubic_filter32RGB(void* out, Imaging im, double xin, double yin, void* data)
|
bicubic_filter32RGB(void* out, Imaging im, double xin, double yin)
|
||||||
{
|
{
|
||||||
int b;
|
int b;
|
||||||
BICUBIC_HEAD(UINT8);
|
BICUBIC_HEAD(UINT8);
|
||||||
|
@ -550,51 +550,51 @@ getfilter(Imaging im, int filterid)
|
||||||
if (im->image8)
|
if (im->image8)
|
||||||
switch (im->type) {
|
switch (im->type) {
|
||||||
case IMAGING_TYPE_UINT8:
|
case IMAGING_TYPE_UINT8:
|
||||||
return (ImagingTransformFilter) nearest_filter8;
|
return nearest_filter8;
|
||||||
case IMAGING_TYPE_SPECIAL:
|
case IMAGING_TYPE_SPECIAL:
|
||||||
switch (im->pixelsize) {
|
switch (im->pixelsize) {
|
||||||
case 1:
|
case 1:
|
||||||
return (ImagingTransformFilter) nearest_filter8;
|
return nearest_filter8;
|
||||||
case 2:
|
case 2:
|
||||||
return (ImagingTransformFilter) nearest_filter16;
|
return nearest_filter16;
|
||||||
case 4:
|
case 4:
|
||||||
return (ImagingTransformFilter) nearest_filter32;
|
return nearest_filter32;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return (ImagingTransformFilter) nearest_filter32;
|
return nearest_filter32;
|
||||||
break;
|
break;
|
||||||
case IMAGING_TRANSFORM_BILINEAR:
|
case IMAGING_TRANSFORM_BILINEAR:
|
||||||
if (im->image8)
|
if (im->image8)
|
||||||
return (ImagingTransformFilter) bilinear_filter8;
|
return bilinear_filter8;
|
||||||
else if (im->image32) {
|
else if (im->image32) {
|
||||||
switch (im->type) {
|
switch (im->type) {
|
||||||
case IMAGING_TYPE_UINT8:
|
case IMAGING_TYPE_UINT8:
|
||||||
if (im->bands == 2)
|
if (im->bands == 2)
|
||||||
return (ImagingTransformFilter) bilinear_filter32LA;
|
return bilinear_filter32LA;
|
||||||
else
|
else
|
||||||
return (ImagingTransformFilter) bilinear_filter32RGB;
|
return bilinear_filter32RGB;
|
||||||
case IMAGING_TYPE_INT32:
|
case IMAGING_TYPE_INT32:
|
||||||
return (ImagingTransformFilter) bilinear_filter32I;
|
return bilinear_filter32I;
|
||||||
case IMAGING_TYPE_FLOAT32:
|
case IMAGING_TYPE_FLOAT32:
|
||||||
return (ImagingTransformFilter) bilinear_filter32F;
|
return bilinear_filter32F;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IMAGING_TRANSFORM_BICUBIC:
|
case IMAGING_TRANSFORM_BICUBIC:
|
||||||
if (im->image8)
|
if (im->image8)
|
||||||
return (ImagingTransformFilter) bicubic_filter8;
|
return bicubic_filter8;
|
||||||
else if (im->image32) {
|
else if (im->image32) {
|
||||||
switch (im->type) {
|
switch (im->type) {
|
||||||
case IMAGING_TYPE_UINT8:
|
case IMAGING_TYPE_UINT8:
|
||||||
if (im->bands == 2)
|
if (im->bands == 2)
|
||||||
return (ImagingTransformFilter) bicubic_filter32LA;
|
return bicubic_filter32LA;
|
||||||
else
|
else
|
||||||
return (ImagingTransformFilter) bicubic_filter32RGB;
|
return bicubic_filter32RGB;
|
||||||
case IMAGING_TYPE_INT32:
|
case IMAGING_TYPE_INT32:
|
||||||
return (ImagingTransformFilter) bicubic_filter32I;
|
return bicubic_filter32I;
|
||||||
case IMAGING_TYPE_FLOAT32:
|
case IMAGING_TYPE_FLOAT32:
|
||||||
return (ImagingTransformFilter) bicubic_filter32F;
|
return bicubic_filter32F;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -609,7 +609,7 @@ Imaging
|
||||||
ImagingGenericTransform(
|
ImagingGenericTransform(
|
||||||
Imaging imOut, Imaging imIn, int x0, int y0, int x1, int y1,
|
Imaging imOut, Imaging imIn, int x0, int y0, int x1, int y1,
|
||||||
ImagingTransformMap transform, void* transform_data,
|
ImagingTransformMap transform, void* transform_data,
|
||||||
int filterid, void* filter_data, int fill)
|
int filterid, int fill)
|
||||||
{
|
{
|
||||||
/* slow generic transformation. use ImagingTransformAffine or
|
/* slow generic transformation. use ImagingTransformAffine or
|
||||||
ImagingScaleAffine where possible. */
|
ImagingScaleAffine where possible. */
|
||||||
|
@ -642,8 +642,8 @@ ImagingGenericTransform(
|
||||||
for (y = y0; y < y1; y++) {
|
for (y = y0; y < y1; y++) {
|
||||||
out = imOut->image[y] + x0*imOut->pixelsize;
|
out = imOut->image[y] + x0*imOut->pixelsize;
|
||||||
for (x = x0; x < x1; x++) {
|
for (x = x0; x < x1; x++) {
|
||||||
if (!transform(&xx, &yy, x-x0, y-y0, transform_data) ||
|
if ( ! transform(&xx, &yy, x-x0, y-y0, transform_data) ||
|
||||||
!filter(out, imIn, xx, yy, filter_data)) {
|
! filter(out, imIn, xx, yy)) {
|
||||||
if (fill)
|
if (fill)
|
||||||
memset(out, 0, imOut->pixelsize);
|
memset(out, 0, imOut->pixelsize);
|
||||||
}
|
}
|
||||||
|
@ -831,7 +831,7 @@ ImagingTransformAffine(Imaging imOut, Imaging imIn,
|
||||||
imOut, imIn,
|
imOut, imIn,
|
||||||
x0, y0, x1, y1,
|
x0, y0, x1, y1,
|
||||||
affine_transform, a,
|
affine_transform, a,
|
||||||
filterid, NULL, fill);
|
filterid, fill);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (a[2] == 0 && a[4] == 0)
|
if (a[2] == 0 && a[4] == 0)
|
||||||
|
@ -930,5 +930,5 @@ ImagingTransform(Imaging imOut, Imaging imIn, int method,
|
||||||
return ImagingGenericTransform(
|
return ImagingGenericTransform(
|
||||||
imOut, imIn,
|
imOut, imIn,
|
||||||
x0, y0, x1, y1,
|
x0, y0, x1, y1,
|
||||||
transform, a, filterid, NULL, fill);
|
transform, a, filterid, fill);
|
||||||
}
|
}
|
||||||
|
|
|
@ -236,8 +236,7 @@ extern void ImagingError_Clear(void);
|
||||||
typedef int (*ImagingTransformMap)(double* X, double* Y,
|
typedef int (*ImagingTransformMap)(double* X, double* Y,
|
||||||
int x, int y, void* data);
|
int x, int y, void* data);
|
||||||
typedef int (*ImagingTransformFilter)(void* out, Imaging im,
|
typedef int (*ImagingTransformFilter)(void* out, Imaging im,
|
||||||
double x, double y,
|
double x, double y);
|
||||||
void* data);
|
|
||||||
|
|
||||||
/* Image Manipulation Methods */
|
/* Image Manipulation Methods */
|
||||||
/* -------------------------- */
|
/* -------------------------- */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user