Add log for designQR 61/316061/2
authorKwanghoon Son <k.son@samsung.com>
Wed, 4 Dec 2024 09:51:11 +0000 (18:51 +0900)
committerkwang son <k.son@samsung.com>
Wed, 11 Dec 2024 04:03:32 +0000 (04:03 +0000)
Change-Id: I633346e07207cbd008f838c5389ba946e8f3e64b
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
mv_barcode/barcode_generator/src/BarcodeGenerator.cpp

index 7372d4bae95672e423e02dd1322b9c02b9e3c8f0..18634a5df11f507ea25dc3d8a16ecfacae3abd25 100644 (file)
@@ -299,6 +299,7 @@ static cv::Size makeEven(cv::Size orgSize)
 
 static void drawLogo(cv::Mat &image, const BarcodeConfig &config)
 {
+       MEDIA_VISION_FUNCTION_ENTER();
        if (config.logo_path.empty() || config.type != MV_BARCODE_QR)
                return;
 
@@ -327,10 +328,12 @@ static void drawLogo(cv::Mat &image, const BarcodeConfig &config)
        cv::multiply(cv::Scalar::all(1.0) - maskMat, image, image);
        cv::multiply(maskMat / 255, logoMat, logoMat);
        cv::add(logoMat, image, image);
+       MEDIA_VISION_FUNCTION_LEAVE();
 }
 
 static int write_buffer_to_img(const cv::Mat &buf, const BarcodeConfig &config)
 {
+       MEDIA_VISION_FUNCTION_ENTER();
        std::string imageFileName = config.image_path;
        /* find directory */
        std::string prefix_imageFileName = imageFileName.substr(0, imageFileName.find_last_of('/'));
@@ -382,7 +385,7 @@ static int write_buffer_to_img(const cv::Mat &buf, const BarcodeConfig &config)
                LOGE("Write barcode image to file %s operation failed.", resultFilePath.c_str());
                return error;
        }
-
+       MEDIA_VISION_FUNCTION_LEAVE();
        return error;
 }
 
@@ -534,6 +537,7 @@ static inline bool is_finder(int x, int y, int w, int h)
 static void drawFinderPattern(cv::Mat &resize_buf, int resize_scale, int org_height, int org_width,
                                                          mv_barcode_generate_attr_shape_e shape)
 {
+       MEDIA_VISION_FUNCTION_ENTER();
        int posx[3] = { 2, org_width - 16, 2 };
        int posy[3] = { 2, 2, org_height - 16 };
        for (int pos = 0; pos < 3; pos++) {
@@ -561,6 +565,7 @@ static void drawFinderPattern(cv::Mat &resize_buf, int resize_scale, int org_hei
                        }
                }
        }
+       MEDIA_VISION_FUNCTION_LEAVE();
 }
 
 static inline float l2_distance(int x1, int y1, int x2, int y2)
@@ -587,6 +592,7 @@ static bool is_inside_logo(int x, int y, int org_width, int org_height, mv_barco
 static void drawDataPattern(cv::Mat &resize_buf, const cv::Mat &buf, int resize_scale, int org_height, int org_width,
                                                        const BarcodeConfig &config)
 {
+       MEDIA_VISION_FUNCTION_ENTER();
        for (int y = 2; y < org_height - 2; y += 2) {
                for (int x = 2; x < org_width - 2; x += 2) {
                        if (is_finder(x, y, org_width, org_height) || buf.at<unsigned char>(y, x, 0) == 255)
@@ -608,10 +614,12 @@ static void drawDataPattern(cv::Mat &resize_buf, const cv::Mat &buf, int resize_
                                                   resize_scale - resize_scale / 4, cv::Scalar(0), -1);
                }
        }
+       MEDIA_VISION_FUNCTION_LEAVE();
 }
 
 static void drawDesignQR(cv::Mat &buf, const BarcodeConfig &config)
 {
+       MEDIA_VISION_FUNCTION_ENTER();
        if (config.type != MV_BARCODE_QR || ((config.data_shape == MV_BARCODE_GENERATE_ATTR_SHAPE_RECT &&
                                                                                  config.finder_shape == MV_BARCODE_GENERATE_ATTR_SHAPE_RECT) &&
                                                                                 config.logo_path.empty()))
@@ -623,6 +631,7 @@ static void drawDesignQR(cv::Mat &buf, const BarcodeConfig &config)
        drawDataPattern(resize_buf, buf, resize_scale, buf.rows, buf.cols, config);
 
        cv::cvtColor(resize_buf, buf, cv::COLOR_GRAY2BGR);
+       MEDIA_VISION_FUNCTION_LEAVE();
 }
 
 static int symbol_to_buf(zint_symbol *symbol, const BarcodeConfig &config, cv::Mat &buf)