| 4 | #include <inspireface/image_process/nexus_processor/image_processor.h> |
| 5 | |
| 6 | void test_resize(std::unique_ptr<inspire::nexus::ImageProcessor>& processor, int aligned_width) { |
| 7 | processor->SetAlignedWidth(aligned_width); |
| 8 | // Create image |
| 9 | inspirecv::Image img = inspirecv::Image::Create("kun.jpg", 3); |
| 10 | // Resize image |
| 11 | uint8_t* dst_data = nullptr; |
| 12 | int dst_width = 112; |
| 13 | int dst_height = 112; |
| 14 | processor->Resize(img.Data(), img.Width(), img.Height(), 3, &dst_data, dst_width, dst_height); |
| 15 | inspirecv::Image dst_img(dst_width, dst_height, 3, dst_data, false); |
| 16 | dst_img.Write("dst_w" + std::to_string(aligned_width) + ".jpg"); |
| 17 | std::cout << "Save dst image to dst_w" << aligned_width << ".jpg" << std::endl; |
| 18 | } |
| 19 | |
| 20 | int main() { |
| 21 | // Create image processor |
no test coverage detected