Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1455)

Unified Diff: ui/gfx/color_transform.h

Issue 2559273002: color: general transformation -> affine transformation
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/gfx/color_transform.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/color_transform.h
diff --git a/ui/gfx/color_transform.h b/ui/gfx/color_transform.h
index 2d18f3d9cd80817a5b70717e164c7ebaaa79d967..198c640aa0bd438c57c19f3b71791653ab48b751 100644
--- a/ui/gfx/color_transform.h
+++ b/ui/gfx/color_transform.h
@@ -11,6 +11,7 @@
#include "build/build_config.h"
#include "ui/gfx/geometry/point3_f.h"
#include "ui/gfx/gfx_export.h"
+#include "ui/gfx/transform.h"
namespace gfx {
@@ -27,7 +28,14 @@ class GFX_EXPORT ColorTransform {
virtual ~ColorTransform() {}
// Perform transformation of colors, |colors| is both input and output.
- virtual void transform(TriStim* colors, size_t num) = 0;
+ virtual void transform(TriStim* colors, size_t num) const = 0;
+
+ // Create an affine approximation of this transform. No guarantees
+ // are made as to how accurate the approximation is.
+ // Returns true if successful, false if there was a failure.
+ // This operation can be somewhat costly, considering caching the result
+ // if you plan to use this frequently.
+ virtual bool GetAffineApproximation(Transform* transform) const;
static std::unique_ptr<ColorTransform> NewColorTransform(
const ColorSpace& from,
« no previous file with comments | « no previous file | ui/gfx/color_transform.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698