Chromium Code Reviews| Index: ui/gfx/color_transform.h |
| diff --git a/ui/gfx/color_transform.h b/ui/gfx/color_transform.h |
| index 1d99617716e6d7bc5156ca64263a46011b88354d..cd23aa1caaed131cf8ab7a9750aafc49c5516342 100644 |
| --- a/ui/gfx/color_transform.h |
| +++ b/ui/gfx/color_transform.h |
| @@ -5,8 +5,8 @@ |
| #ifndef UI_GFX_COLOR_TRANSFORM_H_ |
| #define UI_GFX_COLOR_TRANSFORM_H_ |
| +#include <list> |
| #include <memory> |
| -#include <stdint.h> |
| #include "build/build_config.h" |
| #include "ui/gfx/color_space.h" |
| @@ -18,24 +18,36 @@ namespace gfx { |
| class GFX_EXPORT ColorTransform { |
| public: |
| enum class Intent { INTENT_ABSOLUTE, INTENT_PERCEPTUAL, TEST_NO_OPT }; |
| + class Step; |
| // TriStimulus is a color coordinate in any color space. |
| // Channel order is XYZ, RGB or YUV. |
| typedef Point3F TriStim; |
| - virtual ~ColorTransform() {} |
| + ~ColorTransform(); |
| // Perform transformation of colors, |colors| is both input and output. |
| - virtual void transform(TriStim* colors, size_t num) = 0; |
| + void transform(TriStim* colors, size_t num); |
|
hubbe
2017/02/13 22:03:18
I'm not a big fan of this, because it makes it imp
|
| static std::unique_ptr<ColorTransform> NewColorTransform( |
| const ColorSpace& from, |
| const ColorSpace& to, |
| Intent intent); |
| - static float ToLinearForTesting(ColorSpace::TransferID id, float v); |
| - static float FromLinearForTesting(ColorSpace::TransferID id, float v); |
| + size_t NumberOfStepsForTesting() { return steps_.size(); } |
| + |
| + private: |
| + typedef std::list<std::unique_ptr<Step>> StepList; |
| + StepList steps_; |
| + |
| + ColorTransform(StepList); |
| + static void Append(ColorSpace from, |
| + const ColorSpace& to, |
| + ColorTransform::Intent intent, |
| + StepList* builder); |
| + static void Simplify(StepList* steps); |
| }; |
| + |
| } // namespace gfx |
| #endif // UI_GFX_COLOR_TRANSFORM_H_ |