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

Unified Diff: Source/platform/graphics/ColorSpace.h

Issue 134733016: Add support for converting Colors to linear RGB; Fix relevant filters (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase; update TestExpectations Created 6 years, 11 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 | « Source/platform/blink_platform.gypi ('k') | Source/platform/graphics/ColorSpace.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/ColorSpace.h
diff --git a/Source/platform/graphics/ColorSpace.h b/Source/platform/graphics/ColorSpace.h
index 06918f7ff1f9217d43aca2426ab69fdd4597a244..9b1735a24638ba163f2d14abc68f367690d7059d 100644
--- a/Source/platform/graphics/ColorSpace.h
+++ b/Source/platform/graphics/ColorSpace.h
@@ -27,6 +27,7 @@
#define ColorSpace_h
#include "platform/PlatformExport.h"
+#include "platform/graphics/Color.h"
namespace WebCore {
@@ -36,6 +37,20 @@ enum ColorSpace {
ColorSpaceLinearRGB
};
+namespace ColorSpaceUtilities {
+
+// Get a pointer to a 8-bit lookup table that will convert color components
+// in the |srcColorSpace| to the |dstColorSpace|.
+// If the conversion cannot be performed, or is a no-op (identity transform),
+// then 0 is returned.
+// (Note that a round-trip - f(B,A)[f(A,B)[x]] - is not lossless in general.)
+const uint8_t* getConversionLUT(ColorSpace dstColorSpace, ColorSpace srcColorSpace = ColorSpaceDeviceRGB);
+
+// Convert a Color assumed to be in the |srcColorSpace| into the |dstColorSpace|.
+Color convertColor(const Color& srcColor, ColorSpace dstColorSpace, ColorSpace srcColorSpace = ColorSpaceDeviceRGB);
+
+} // namespace ColorSpaceUtilities
+
} // namespace WebCore
#endif // ColorSpace_h
« no previous file with comments | « Source/platform/blink_platform.gypi ('k') | Source/platform/graphics/ColorSpace.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698