ICCTest.cpp 837 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Copyright 2016 Google Inc.
  3. *
  4. * Use of this source code is governed by a BSD-style license that can be
  5. * found in the LICENSE file.
  6. */
  7. #include "include/core/SkTypes.h"
  8. #include "include/core/SkICC.h"
  9. #include "include/core/SkString.h"
  10. #include "include/third_party/skcms/skcms.h"
  11. #include "src/core/SkColorSpacePriv.h"
  12. #include "tests/Test.h"
  13. #include "tools/Resources.h"
  14. DEF_TEST(AdobeRGB, r) {
  15. if (sk_sp<SkData> profile = GetResourceAsData("icc_profiles/AdobeRGB1998.icc")) {
  16. skcms_ICCProfile parsed;
  17. REPORTER_ASSERT(r, skcms_Parse(profile->data(), profile->size(), &parsed));
  18. auto got = SkColorSpace::Make(parsed);
  19. auto want = SkColorSpace::MakeRGB(SkNamedTransferFn::k2Dot2, SkNamedGamut::kAdobeRGB);
  20. REPORTER_ASSERT(r, SkColorSpace::Equals(got.get(), want.get()));
  21. }
  22. }