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

Unified Diff: ui/gfx/color_transform.h

Issue 2203663002: ColorTransform, transforms colors from one color space to another (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use floats Created 4 years, 4 months 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 | « ui/gfx/color_space.cc ('k') | 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
new file mode 100644
index 0000000000000000000000000000000000000000..19f48f1f1476bcfdf5b750d58f1093920a44e499
--- /dev/null
+++ b/ui/gfx/color_transform.h
@@ -0,0 +1,37 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_GFX_COLOR_TRANSFORM_H_
+#define UI_GFX_COLOR_TRANSFORM_H_
+
+#include <memory>
+#include <stdint.h>
+
+#include "build/build_config.h"
+#include "ui/gfx/geometry/point3_f.h"
+#include "ui/gfx/gfx_export.h"
+
+namespace gfx {
+
+class ColorSpace;
+
+class GFX_EXPORT ColorTransform {
+ public:
+ enum class Intent { ABSOLUTE, PERCEPTUAL };
+
+ // TriStimulus is a color coordinate in any color space.
+ // Channel order is XYZ, RGB or YUV.
+ typedef Point3F TriStim;
+
+ // Perform transformation of colors, |colors| is both input and output.
+ virtual void transform(TriStim* colors, size_t num) = 0;
+
+ static std::unique_ptr<ColorTransform> NewColorTransform(
+ const ColorSpace& from,
+ const ColorSpace& to,
+ Intent intent);
+};
+} // namespace gfx
+
+#endif // UI_GFX_COLOR_TRANSFORM_H_
« no previous file with comments | « ui/gfx/color_space.cc ('k') | ui/gfx/color_transform.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698