Skip to content

Commit 7c2e0c9

Browse files
committed
Remove duplicate enum class for angle type.
1 parent 2052341 commit 7c2e0c9

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

benchmarks/ImageProcessing/BuddyRotate2DBenchmark.cpp

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,8 @@ float BuddyRotate2DAngle;
3636
// Define sizes of input.
3737
intptr_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

4542
void 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.
9289
void 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

benchmarks/ImageProcessing/OpenCVRotate2DBenchmark.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void registerBenchmarkOpenCVRotate2D() {
9696

9797
// Generate result image.
9898
void generateResultOpenCVRotate2D() {
99-
// Run the resize 2D operation.
99+
// Run the rotate 2D operation.
100100
if (OpenCVAngleType == ANGLE_DEGREE && OpenCVRunRotate == true) {
101101
cv::rotate(inputImageOpenCVRotate2D, outputImageOpenCVRotate2D, OpenCVRotate2DAngle);
102102

0 commit comments

Comments
 (0)