@@ -60,20 +60,16 @@ namespace agg
6060 value_type a;
6161
6262 // --------------------------------------------------------------------
63- gray64 () {}
63+ gray64 () = default ;
6464
6565 // --------------------------------------------------------------------
66- explicit gray64 (value_type v_, value_type a_ = 1 ) :
67- v(v_), a(a_) {}
66+ explicit gray64 (value_type v_, value_type a_ = 1 ) : v(v_), a(a_) {}
6867
6968 // --------------------------------------------------------------------
70- gray64 (const self_type& c, value_type a_) :
71- v (c.v), a(a_) {}
69+ gray64 (const self_type& c, value_type a_) : v(c.v), a(a_) {}
7270
7371 // --------------------------------------------------------------------
74- gray64 (const gray64& c) :
75- v (c.v),
76- a (c.a) {}
72+ gray64 (const gray64& c) = default ;
7773
7874 // --------------------------------------------------------------------
7975 static AGG_INLINE double to_double (value_type a)
@@ -246,7 +242,7 @@ namespace agg
246242 value_type a;
247243
248244 // --------------------------------------------------------------------
249- rgba64 () {}
245+ rgba64 () = default ;
250246
251247 // --------------------------------------------------------------------
252248 rgba64 (value_type r_, value_type g_, value_type b_, value_type a_= 1 ) :
@@ -503,51 +499,52 @@ typedef enum {
503499// T is rgba if and only if it has an T::r field.
504500template <typename T, typename = void > struct is_grayscale : std::true_type {};
505501template <typename T> struct is_grayscale <T, std::void_t <decltype (T::r)>> : std::false_type {};
502+ template <typename T> constexpr bool is_grayscale_v = is_grayscale<T>::value;
506503
507504
508505template <typename color_type>
509506struct type_mapping
510507{
511- using blender_type = typename std::conditional <
512- is_grayscale <color_type>::value ,
508+ using blender_type = std::conditional_t <
509+ is_grayscale_v <color_type>,
513510 agg::blender_gray<color_type>,
514- typename std::conditional <
515- std::is_same <color_type, agg::rgba8>::value ,
511+ std::conditional_t <
512+ std::is_same_v <color_type, agg::rgba8>,
516513 fixed_blender_rgba_plain<color_type, agg::order_rgba>,
517514 agg::blender_rgba_plain<color_type, agg::order_rgba>
518- >::type
519- >::type ;
520- using pixfmt_type = typename std::conditional <
521- is_grayscale <color_type>::value ,
515+ >
516+ >;
517+ using pixfmt_type = std::conditional_t <
518+ is_grayscale_v <color_type>,
522519 agg::pixfmt_alpha_blend_gray<blender_type, agg::rendering_buffer>,
523520 agg::pixfmt_alpha_blend_rgba<blender_type, agg::rendering_buffer>
524- >::type ;
525- using pixfmt_pre_type = typename std::conditional <
526- is_grayscale <color_type>::value ,
521+ >;
522+ using pixfmt_pre_type = std::conditional_t <
523+ is_grayscale_v <color_type>,
527524 pixfmt_type,
528525 agg::pixfmt_alpha_blend_rgba<
529- typename std::conditional <
530- std::is_same <color_type, agg::rgba8>::value ,
526+ std::conditional_t <
527+ std::is_same_v <color_type, agg::rgba8>,
531528 fixed_blender_rgba_pre<color_type, agg::order_rgba>,
532529 agg::blender_rgba_pre<color_type, agg::order_rgba>
533- >::type ,
530+ >,
534531 agg::rendering_buffer>
535- >::type ;
536- template <typename A> using span_gen_affine_type = typename std::conditional <
537- is_grayscale <color_type>::value ,
532+ >;
533+ template <typename A> using span_gen_affine_type = std::conditional_t <
534+ is_grayscale_v <color_type>,
538535 agg::span_image_resample_gray_affine<A>,
539536 agg::span_image_resample_rgba_affine<A>
540- >::type ;
541- template <typename A, typename B> using span_gen_filter_type = typename std::conditional <
542- is_grayscale <color_type>::value ,
537+ >;
538+ template <typename A, typename B> using span_gen_filter_type = std::conditional_t <
539+ is_grayscale_v <color_type>,
543540 agg::span_image_filter_gray<A, B>,
544541 agg::span_image_filter_rgba<A, B>
545- >::type ;
546- template <typename A, typename B> using span_gen_nn_type = typename std::conditional <
547- is_grayscale <color_type>::value ,
542+ >;
543+ template <typename A, typename B> using span_gen_nn_type = std::conditional_t <
544+ is_grayscale_v <color_type>,
548545 agg::span_image_filter_gray_nn<A, B>,
549546 agg::span_image_filter_rgba_nn<A, B>
550- >::type ;
547+ >;
551548};
552549
553550
0 commit comments