summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/WebKit/Source/platform/graphics/ColorSpace.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/WebKit/Source/platform/graphics/ColorSpace.h')
-rw-r--r--chromium/third_party/WebKit/Source/platform/graphics/ColorSpace.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/chromium/third_party/WebKit/Source/platform/graphics/ColorSpace.h b/chromium/third_party/WebKit/Source/platform/graphics/ColorSpace.h
index 06918f7ff1f..9b1735a2463 100644
--- a/chromium/third_party/WebKit/Source/platform/graphics/ColorSpace.h
+++ b/chromium/third_party/WebKit/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