MCPcopy Create free account
hub / github.com/MapServer/MapServer / stack_blur_rgb24

Function stack_blur_rgb24

renderers/agg/include/agg_blur.h:520–768  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

518 //========================================================stack_blur_rgb24
519 template<class Img>
520 void stack_blur_rgb24(Img& img, unsigned rx, unsigned ry)
521 {
522 typedef typename Img::color_type color_type;
523 typedef typename Img::order_type order_type;
524 enum order_e
525 {
526 R = order_type::R,
527 G = order_type::G,
528 B = order_type::B
529 };
530
531 unsigned x, y, xp, yp, i;
532 unsigned stack_ptr;
533 unsigned stack_start;
534
535 const int8u* src_pix_ptr;
536 int8u* dst_pix_ptr;
537 color_type* stack_pix_ptr;
538
539 unsigned sum_r;
540 unsigned sum_g;
541 unsigned sum_b;
542 unsigned sum_in_r;
543 unsigned sum_in_g;
544 unsigned sum_in_b;
545 unsigned sum_out_r;
546 unsigned sum_out_g;
547 unsigned sum_out_b;
548
549 unsigned w = img.width();
550 unsigned h = img.height();
551 unsigned wm = w - 1;
552 unsigned hm = h - 1;
553
554 unsigned div;
555 unsigned mul_sum;
556 unsigned shr_sum;
557
558 pod_vector<color_type> stack;
559
560 if(rx > 0)
561 {
562 if(rx > 254) rx = 254;
563 div = rx * 2 + 1;
564 mul_sum = stack_blur_tables<int>::g_stack_blur8_mul[rx];
565 shr_sum = stack_blur_tables<int>::g_stack_blur8_shr[rx];
566 stack.allocate(div);
567
568 for(y = 0; y < h; y++)
569 {
570 sum_r =
571 sum_g =
572 sum_b =
573 sum_in_r =
574 sum_in_g =
575 sum_in_b =
576 sum_out_r =
577 sum_out_g =

Callers

nothing calls this directly

Calls 5

widthMethod · 0.45
heightMethod · 0.45
allocateMethod · 0.45
pix_ptrMethod · 0.45
strideMethod · 0.45

Tested by

no test coverage detected