LCOV - code coverage report
Current view: top level - include - Image.h (source / functions) Hit Total Coverage
Test: lcov.info Lines: 4 4 100.0 %
Date: 2024-12-28 17:36:05 Functions: 1 1 100.0 %

          Line data    Source code
       1             : /**
       2             :  * @file Image.h
       3             :  * @author Damien Balima (www.dams-labs.net)
       4             :  * @brief Image data
       5             :  * @date 2024-04-30
       6             :  *
       7             :  * @copyright Damien Balima (c) CC-BY-NC-SA-4.0 2024
       8             :  *
       9             :  */
      10             : #pragma once
      11             : #include <cstddef>
      12             : #include <memory>
      13             : #include <opencv2/opencv.hpp>
      14             : 
      15             : namespace sipai {
      16             : struct Image {
      17             :   cv::Mat data;
      18             :   size_t orig_height;
      19             :   size_t orig_width;
      20             :   int orig_type;
      21             :   int orig_channels;
      22             : 
      23         207 :   void resize(size_t width, size_t height) {
      24         207 :     if (width > 0 && height > 0) {
      25         131 :       cv::resize(data, data, cv::Size((int)width, (int)height));
      26             :     }
      27         207 :   }
      28             : };
      29             : } // namespace sipai

Generated by: LCOV version 1.16