Skip to content

Commit e87be28

Browse files
committed
Fix alpha blending in NEAREST neighbor interpolation.
1 parent bd94c0d commit e87be28

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/_image.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
#include "mplutils.h"
3434

3535

36-
typedef agg::pixfmt_rgba32_pre pixfmt;
36+
typedef agg::pixfmt_rgba32 pixfmt;
37+
typedef agg::pixfmt_rgba32_pre pixfmt_pre;
3738
typedef agg::renderer_base<pixfmt> renderer_base;
3839
typedef agg::span_interpolator_linear<> interpolator_type;
3940
typedef agg::rasterizer_scanline_aa<agg::rasterizer_sl_clip_dbl> rasterizer;
@@ -430,9 +431,9 @@ Image::resize(const Py::Tuple& args, const Py::Dict& kwargs)
430431
ras.add_path(imageBox);
431432

432433
typedef agg::wrap_mode_reflect reflect_type;
433-
typedef agg::image_accessor_wrap<pixfmt, reflect_type, reflect_type> img_accessor_type;
434+
typedef agg::image_accessor_wrap<pixfmt_pre, reflect_type, reflect_type> img_accessor_type;
434435

435-
pixfmt pixfmtin(*rbufIn);
436+
pixfmt_pre pixfmtin(*rbufIn);
436437
img_accessor_type ia(pixfmtin);
437438
switch (interpolation)
438439
{
@@ -1989,7 +1990,3 @@ init_image(void)
19891990
return _image->module().ptr();
19901991
#endif
19911992
}
1992-
1993-
1994-
1995-

0 commit comments

Comments
 (0)