Beispiel #1
0
            if (src.format != dst.format)
                isIdentical = false;

            AssertThat(isIdentical, Equals(true));
        });

        it("should get the same image content", [&]() {
            ImageBuf srcImg = image.get();
            auto obj = image.serialize();

            Image newImage;
            newImage.deserialize(obj);
            ImageBuf dstImg = newImage.get();

            bool isIdentical = true;
            if (srcImg.channels() == dstImg.channels())
            {
                for (ImageBuf::Iterator<unsigned char> s(srcImg), d(dstImg); !s.done(), !d.done(); ++s, ++d)
                {
                    if (!s.exists() || !d.exists())
                        continue;
                    for (int c = 0; c < srcImg.channels(); ++c)
                    {
                        if (s[c] != d[c])
                            isIdentical = false;
                    }
                }
            }
            else
                isIdentical = false;