| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_GFX_SKIA_COLOR_SPACE_UTIL_H_ | 5 #ifndef UI_GFX_SKIA_COLOR_SPACE_UTIL_H_ |
| 6 #define UI_GFX_SKIA_COLOR_SPACE_UTIL_H_ | 6 #define UI_GFX_SKIA_COLOR_SPACE_UTIL_H_ |
| 7 | 7 |
| 8 #include "third_party/skia/include/core/SkColorSpace.h" | 8 #include "third_party/skia/include/core/SkColorSpace.h" |
| 9 #include "third_party/skia/include/core/SkICC.h" | 9 #include "third_party/skia/include/core/SkICC.h" |
| 10 #include "ui/gfx/gfx_export.h" | 10 #include "ui/gfx/gfx_color_export.h" |
| 11 | 11 |
| 12 namespace gfx { | 12 namespace gfx { |
| 13 | 13 |
| 14 float GFX_EXPORT SkTransferFnEval(const SkColorSpaceTransferFn& fn, float x); | 14 float GFX_COLOR_EXPORT SkTransferFnEval(const SkColorSpaceTransferFn& fn, |
| 15 float x); |
| 15 | 16 |
| 16 SkColorSpaceTransferFn GFX_EXPORT | 17 SkColorSpaceTransferFn GFX_COLOR_EXPORT |
| 17 SkTransferFnInverse(const SkColorSpaceTransferFn& fn); | 18 SkTransferFnInverse(const SkColorSpaceTransferFn& fn); |
| 18 | 19 |
| 19 bool GFX_EXPORT | 20 bool GFX_COLOR_EXPORT |
| 20 SkTransferFnsApproximatelyCancel(const SkColorSpaceTransferFn& a, | 21 SkTransferFnsApproximatelyCancel(const SkColorSpaceTransferFn& a, |
| 21 const SkColorSpaceTransferFn& b); | 22 const SkColorSpaceTransferFn& b); |
| 22 | 23 |
| 23 bool GFX_EXPORT | 24 bool GFX_COLOR_EXPORT |
| 24 SkTransferFnIsApproximatelyIdentity(const SkColorSpaceTransferFn& fn); | 25 SkTransferFnIsApproximatelyIdentity(const SkColorSpaceTransferFn& fn); |
| 25 | 26 |
| 26 // Approximates the |n| points in |x| and |t| by the transfer function |fn|. | 27 // Approximates the |n| points in |x| and |t| by the transfer function |fn|. |
| 27 // Returns true if the approximation converged. | 28 // Returns true if the approximation converged. |
| 28 bool GFX_EXPORT SkApproximateTransferFn(const float* x, | 29 bool GFX_COLOR_EXPORT SkApproximateTransferFn(const float* x, |
| 29 const float* t, | 30 const float* t, |
| 30 size_t n, | 31 size_t n, |
| 31 SkColorSpaceTransferFn* fn); | 32 SkColorSpaceTransferFn* fn); |
| 32 | 33 |
| 33 // Approximates |sk_icc| by the transfer function |fn|. Returns in |max_error| | 34 // Approximates |sk_icc| by the transfer function |fn|. Returns in |max_error| |
| 34 // the maximum pointwise of all color channels' transfer functions with |fn|. | 35 // the maximum pointwise of all color channels' transfer functions with |fn|. |
| 35 // Returns false if no approximation was possible, or no approximation | 36 // Returns false if no approximation was possible, or no approximation |
| 36 // converged. | 37 // converged. |
| 37 bool GFX_EXPORT SkApproximateTransferFn(sk_sp<SkICC> sk_icc, | 38 bool GFX_COLOR_EXPORT SkApproximateTransferFn(sk_sp<SkICC> sk_icc, |
| 38 float* max_error, | 39 float* max_error, |
| 39 SkColorSpaceTransferFn* fn); | 40 SkColorSpaceTransferFn* fn); |
| 40 | 41 |
| 41 bool GFX_EXPORT SkMatrixIsApproximatelyIdentity(const SkMatrix44& m); | 42 bool GFX_COLOR_EXPORT SkMatrixIsApproximatelyIdentity(const SkMatrix44& m); |
| 42 | 43 |
| 43 } // namespace gfx | 44 } // namespace gfx |
| 44 | 45 |
| 45 #endif // UI_GFX_SKIA_COLOR_SPACE_UTIL_H_ | 46 #endif // UI_GFX_SKIA_COLOR_SPACE_UTIL_H_ |
| OLD | NEW |