14 const uint8_t kSrc[12] = {255, 0, 0, 0, 255, 0, 0, 0, 255, 128, 128, 128};
15 const uint8_t kExpect[12] = {255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0};
21 memset(dst, 0xbd,
sizeof(dst));
22 pCal->TranslateImageLine(dst, kSrc, 4, 4, 1,
true);
23 for (size_t i = 0; i < 12; ++i)
24 EXPECT_EQ(dst[i], kExpect[i]) <<
" at " << i;
26 memset(dst, 0xbd,
sizeof(dst));
27 pCal->TranslateImageLine(dst, kSrc, 4, 4, 1,
false);
28 for (size_t i = 0; i < 12; ++i)
29 EXPECT_EQ(dst[i], kExpect[i]) <<
" at " << i;
33 const uint8_t kSrc[12] = {255, 0, 0, 0, 255, 0, 0, 0, 255, 128, 128, 128};
34 const uint8_t kExpectMask[12] = {255, 58, 0, 0, 255, 0,
35 70, 0, 255, 188, 188, 188};
36 const uint8_t kExpectNomask[12] = {0, 0, 255, 0, 255, 0,
37 255, 0, 0, 128, 128, 128};
43 memset(dst, 0xbd,
sizeof(dst));
44 pCal->TranslateImageLine(dst, kSrc, 4, 4, 1,
true);
45 for (size_t i = 0; i < 12; ++i)
46 EXPECT_EQ(dst[i], kExpectMask[i]) <<
" at " << i;
48 memset(dst, 0xbd,
sizeof(dst));
49 pCal->TranslateImageLine(dst, kSrc, 4, 4, 1,
false);
50 for (size_t i = 0; i < 12; ++i)
51 EXPECT_EQ(dst[i], kExpectNomask[i]) <<
" at " << i;