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

Unified Diff: third_party/WebKit/Source/core/html/ImageData.idl

Issue 2555213002: Implement color management for ImageData (Closed)
Patch Set: Addressing issues 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
Index: third_party/WebKit/Source/core/html/ImageData.idl
diff --git a/third_party/WebKit/Source/core/html/ImageData.idl b/third_party/WebKit/Source/core/html/ImageData.idl
index d52d253a70049da153f86574ce21973a3bae0ad3..673f6cb7fbb77163bb15e0f8e553d67734a76cf1 100644
--- a/third_party/WebKit/Source/core/html/ImageData.idl
+++ b/third_party/WebKit/Source/core/html/ImageData.idl
@@ -27,6 +27,9 @@
*/
// https://html.spec.whatwg.org/#dom-imagedata
+// https://github.com/junov/CanvasColorSpace/blob/master/CanvasColorSpaceProposal.md#imagedata
+
+enum ImageDataColorSpace { "legacy-srgb", "srgb", "linear-rgb" };
[
Constructor(unsigned long sw, unsigned long sh),
@@ -34,8 +37,15 @@
Exposed=(Window,Worker),
RaisesException=Constructor,
] interface ImageData {
+
+ [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] ImageData createImageData(unsigned long sw, unsigned long sh, ImageDataColorSpace colorSpace);
+ [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] ImageData createImageData(Uint8ClampedArray data, unsigned long sw, ImageDataColorSpace colorSpace);
+ [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] ImageData createImageData(Uint8ClampedArray data, unsigned long sw, unsigned long sh, ImageDataColorSpace colorSpace);
+
readonly attribute unsigned long width;
readonly attribute unsigned long height;
- // TODO(foolip): Expose data.
- // readonly attribute Uint8ClampedArray data;
+ readonly attribute Uint8ClampedArray data;
Justin Novosad 2016/12/16 18:38:11 Do you understand how this worked before, without
zakerinasab1 2016/12/19 19:57:39 Not yet. I've asked foolip about this but he could
+ readonly attribute ImageDataColorSpace colorSpace;
};
+
+
Justin Novosad 2016/12/16 18:38:11 remove whitespace
zakerinasab1 2016/12/19 19:57:39 Done.

Powered by Google App Engine
This is Rietveld 408576698