Skip to content

Commit

Permalink
Refactor iqa BUILD file
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 4af5013958994b3b28b310c23967262de524c00f
  • Loading branch information
Vertexwahn committed Aug 14, 2024
1 parent 785c8ad commit eed551f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 23 deletions.
22 changes: 0 additions & 22 deletions devertexwahn/imaging/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -69,25 +69,3 @@ cc_test(
"@googletest//:gtest_main",
],
)

cc_library(
name = "iqa",
srcs = ["iqa/iqa.cpp"],
hdrs = ["iqa/iqa.h"],
deps = [
"//core:reference_counted",
"//imaging:image",
],
)

cc_test(
name = "iqa_test",
size = "small",
srcs = [
"iqa/iqa_test.cpp",
],
deps = [
":iqa",
"@googletest//:gtest_main",
],
)
22 changes: 22 additions & 0 deletions devertexwahn/imaging/iqa/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
cc_library(
name = "iqa",
srcs = ["iqa.cpp"],
hdrs = ["iqa.h"],
visibility = ["//visibility:public"],
deps = [
"//core:reference_counted",
"//imaging:image",
],
)

cc_test(
name = "iqa_test",
size = "small",
srcs = [
"iqa_test.cpp",
],
deps = [
":iqa",
"@googletest//:gtest_main",
],
)
9 changes: 8 additions & 1 deletion devertexwahn/imaging/iqa/iqa_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,20 @@ TEST(IQA_Image3b, GivenIdenticalImages_WhenComparing_ExpectEqual) {
EXPECT_THAT(are_equal(a, b), true);
}

TEST(IQA, GivenDifferentImages_WhenComparing_ExpectNotEqual) {
TEST(IQA, GivenDifferentImages3f_WhenComparing_ExpectNotEqual) {
Image3f a{100, 100};
Image3f b{100, 100};
b.set_pixel(0, 0, Color3f{1.f, .5f, .25f});
EXPECT_THAT(are_equal(a, b), false);
}

TEST(IQA, GivenDifferentImages3b_WhenComparing_ExpectNotEqual) {
Image3b a{100, 100};
Image3b b{100, 100};
b.set_pixel(0, 0, Color3b{255, 128, 64});
EXPECT_THAT(are_equal(a, b), false);
}

TEST(IQA, mse) {
// Arrange
Image3f a{4, 4};
Expand Down

0 comments on commit eed551f

Please sign in to comment.