MCPcopy Create free account
hub / github.com/alandefreitas/matplotplusplus / imresize

Function imresize

source/matplot/util/common.cpp:626–659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

624 }
625
626 image_channels_t imresize(const image_channels_t &A, size_t height,
627 size_t width, image_interpolation m) {
628 auto cimg_image = channels2cimg(A);
629 int interpolation_type = 0;
630 switch (m) {
631 case image_interpolation::raw:
632 interpolation_type = -1;
633 break;
634 case image_interpolation::additional_space:
635 interpolation_type = 0;
636 break;
637 case image_interpolation::nearest:
638 interpolation_type = 1;
639 break;
640 case image_interpolation::moving_average:
641 interpolation_type = 2;
642 break;
643 case image_interpolation::bilinear:
644 interpolation_type = 3;
645 break;
646 case image_interpolation::grid:
647 interpolation_type = 4;
648 break;
649 case image_interpolation::bicubic:
650 interpolation_type = 5;
651 break;
652 case image_interpolation::lanczos:
653 interpolation_type = 6;
654 break;
655 }
656 cimg_image.resize(static_cast<int>(width), static_cast<int>(height), 1,
657 static_cast<int>(A.size()), interpolation_type);
658 return cimg2channels(cimg_image);
659 }
660
661 image_channels_t imresize(const image_channels_t &A, double scale,
662 image_interpolation m) {

Callers 2

mainFunction · 0.85
mainFunction · 0.85

Calls 5

channels2cimgFunction · 0.85
cimg2channelsFunction · 0.85
sizeFunction · 0.85
emptyMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected