@@ -36,11 +36,8 @@ float BuddyRotate2DAngle;
3636// Define sizes of input.
3737intptr_t sizesInputBuddyRotate2D[2 ];
3838
39- // Declare Angle option supported.
40- enum AngleOption { ANGLE_DEGREE, ANGLE_RADIAN };
41-
4239// Define Angle option selected.
43- AngleOption AngleType;
40+ dip::ANGLE_TYPE AngleType;
4441
4542void initializeBuddyRotate2D (char **argv) {
4643 inputImageBuddyRotate2D = imread (argv[1 ], IMREAD_GRAYSCALE);
@@ -49,9 +46,9 @@ void initializeBuddyRotate2D(char **argv) {
4946 sizesInputBuddyRotate2D[1 ] = inputImageBuddyRotate2D.cols ;
5047
5148 if (static_cast <string>(argv[2 ]) == " DEGREE" ) {
52- AngleType = ANGLE_DEGREE ;
49+ AngleType = dip::ANGLE_TYPE::DEGREE ;
5350 } else {
54- AngleType = ANGLE_RADIAN ;
51+ AngleType = dip::ANGLE_TYPE::RADIAN ;
5552 }
5653
5754 std::string argAngle = argv[3 ];
@@ -62,7 +59,7 @@ void initializeBuddyRotate2D(char **argv) {
6259 }
6360}
6461
65- static void Buddy_Rotate2D_ANGLE_DEGREE (benchmark::State &state) {
62+ static void Buddy_Rotate2D_DEGREE (benchmark::State &state) {
6663 // Define the MemRef descriptor for input.
6764 Img<float , 2 > inputBuddyRotate2D (inputImageBuddyRotate2D);
6865
@@ -90,8 +87,8 @@ static void Buddy_Rotate2D_ANGLE_RADIAN(benchmark::State &state) {
9087
9188// Register benchmarking function.
9289void registerBenchmarkBuddyRotate2D () {
93- if (AngleType == ANGLE_DEGREE ) {
94- BENCHMARK (Buddy_Rotate2D_ANGLE_DEGREE )
90+ if (AngleType == dip::ANGLE_TYPE::DEGREE ) {
91+ BENCHMARK (Buddy_Rotate2D_DEGREE )
9592 ->Arg (1 )
9693 ->Unit (benchmark::kMillisecond );
9794 } else {
@@ -106,8 +103,8 @@ void generateResultBuddyRotate2D() {
106103 // Define the MemRef descriptor for input.
107104 Img<float , 2 > input (inputImageBuddyRotate2D);
108105 MemRef<float , 2 > output (sizesInputBuddyRotate2D);
109- // Run the resize 2D operation.
110- if (AngleType == ANGLE_DEGREE ) {
106+ // Run the rotate 2D operation.
107+ if (AngleType == dip::ANGLE_TYPE::DEGREE ) {
111108 // Call the MLIR Rotate2D function.
112109 output = dip::Rotate2D (&input, BuddyRotate2DAngle,
113110 dip::ANGLE_TYPE::DEGREE);
@@ -117,7 +114,7 @@ void generateResultBuddyRotate2D() {
117114 dip::ANGLE_TYPE::RADIAN);
118115 }
119116
120- // Define a cv::Mat with the output of the resize operation.
117+ // Define a cv::Mat with the output of the rotate operation.
121118 Mat outputImage (output.getSizes ()[0 ], output.getSizes ()[1 ], CV_32FC1,
122119 output.getData ());
123120
0 commit comments