8000 Remove some unused resample code by QuLogic · Pull Request #29450 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
8000

Remove some unused resample code #29450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions src/_image_resample.h
Original file line number Diff line number Diff line change
Expand Up @@ -519,17 +519,6 @@ struct type_mapping
agg::pixfmt_alpha_blend_gray<blender_type, agg::rendering_buffer>,
agg::pixfmt_alpha_blend_rgba<blender_type, agg::rendering_buffer>
>;
using pixfmt_pre_type = std::conditional_t<
is_grayscale_v<color_type>,
pixfmt_type,
agg::pixfmt_alpha_blend_rgba<
std::conditional_t<
std::is_same_v<color_type, agg::rgba8>,
fixed_blender_rgba_pre<color_type, agg::order_rgba>,
agg::blender_rgba_pre<color_type, agg::order_rgba>
>,
agg::rendering_buffer>
>;
template<typename A> using span_gen_affine_type = std::conditional_t<
is_grayscale_v<color_type>,
agg::span_image_resample_gray_affine<A>,
Expand Down
40 changes: 0 additions & 40 deletions src/agg_workaround.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,6 @@
blending of RGBA32 pixels does not preserve enough precision
*/

template<class ColorT, class Order>
struct fixed_blender_rgba_pre : agg::conv_rgba_pre<ColorT, Order>
{
typedef ColorT color_type;
typedef Order order_type;
typedef typename color_type::value_type value_type;
typedef typename color_type::calc_type calc_type;
typedef typename color_type::long_type long_type;
enum base_scale_e
{
base_shift = color_type::base_shift,
base_mask = color_type::base_mask
};

//--------------------------------------------------------------------
static AGG_INLINE void blend_pix(value_type* p,
value_type cr, value_type cg, value_type cb,
value_type alpha, agg::cover_type cover)
{
blend_pix(p,
color_type::mult_cover(cr, cover),
color_type::mult_cover(cg, cover),
color_type::mult_cover(cb, cover),
color_type::mult_cover(alpha, cover));
}

//--------------------------------------------------------------------
static AGG_INLINE void blend_pix(value_type* p,
value_type cr, value_type cg, value_type cb,
value_type alpha)
{
alpha = base_mask - alpha;
p[Order::R] = (value_type)(((p[Order::R] * alpha) >> base_shift) + cr);
p[Order::G] = (value_type)(((p[Order::G] * alpha) >> base_shift) + cg);
p[Order::B] = (value_type)(((p[Order::B] * alpha) >> base_shift) + cb);
p[Order::A] = (value_type)(base_mask - ((alpha * (base_mask - p[Order::A])) >> base_shift));
}
};


template<class ColorT, class Order>
struct fixed_blender_rgba_plain : agg::conv_rgba_plain<ColorT, Order>
{
Expand Down
Loading
0