Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 85cfca2

Browse files
committed
Merge pull request #868 from mdboom/nearest_alpha
Fix alpha blending when using nearest neighbor interpolation
2 parents 834ddcc + 66d070c commit 85cfca2

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

2.52 KB
Loading

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
{
@@ -1993,7 +1994,3 @@ init_image(void)
19931994
return _image->module().ptr();
19941995
#endif
19951996
}
1996-
1997-
1998-
1999-

0 commit comments

Comments
 (0)