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

Unified Diff: src/core/SkColorSpaceXform.h

Issue 2184543003: Perform color correction on png decodes (Closed) Base URL: https://skia.googlesource.com/skia.git@colorjpegs
Patch Set: Rebase on Sk4u Created 4 years, 5 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
Index: src/core/SkColorSpaceXform.h
diff --git a/src/core/SkColorSpaceXform.h b/src/core/SkColorSpaceXform.h
index 2696b8582accdca6352fe7c5ef70d4b925e702ed..d0a46e38626e4cf980a13899724c01bbd4595e3b 100644
--- a/src/core/SkColorSpaceXform.h
+++ b/src/core/SkColorSpaceXform.h
@@ -10,6 +10,7 @@
#include "SkColorSpace.h"
#include "SkColorSpace_Base.h"
+#include "SkImageInfo.h"
class SkColorSpaceXform : SkNoncopyable {
public:
@@ -30,12 +31,17 @@ public:
/**
* Apply the color conversion to a src buffer, storing the output in the dst buffer.
- * The src is stored as RGBA (8888) and is treated as opaque.
- * TODO (msarett): Support non-opaque srcs.
+ * The src is stored as RGBA (8888). If Premul is requested, the output will be
+ * premultiplied by alpha.
*/
virtual void applyToRGBA(RGBA32* dst, const RGBA32* src, int len) const = 0;
virtual void applyToBGRA(BGRA32* dst, const RGBA32* src, int len) const = 0;
virtual void applyToF16(RGBAF16* dst, const RGBA32* src, int len) const = 0;
+ virtual void applyToRGBAPremul(RGBA32* dst, const RGBA32* src, int len) const = 0;
+ virtual void applyToBGRAPremul(BGRA32* dst, const RGBA32* src, int len) const = 0;
+ virtual void applyToF16Premul(RGBAF16* dst, const RGBA32* src, int len) const = 0;
+ virtual void apply(void* dst, const RGBA32* src, int len, SkColorType dstColorType,
msarett 2016/07/29 18:23:01 I'm noticing that this is really the only public f
mtklein 2016/07/29 18:48:56 This sounds like a good move to me. I think that
msarett 2016/07/29 20:07:51 Done.
+ bool premul) const = 0;
virtual ~SkColorSpaceXform() {}
};
@@ -47,6 +53,11 @@ public:
void applyToRGBA(RGBA32* dst, const RGBA32* src, int len) const override;
void applyToBGRA(BGRA32* dst, const RGBA32* src, int len) const override;
void applyToF16(RGBAF16* dst, const RGBA32* src, int len) const override;
+ void applyToRGBAPremul(RGBA32* dst, const RGBA32* src, int len) const override;
+ void applyToBGRAPremul(BGRA32* dst, const RGBA32* src, int len) const override;
+ void applyToF16Premul(RGBAF16* dst, const RGBA32* src, int len) const override;
+ void apply(void* dst, const RGBA32* src, int len, SkColorType dstColorType, bool premul)
+ const override;
static constexpr int kDstGammaTableSize = 1024;

Powered by Google App Engine
This is Rietveld 408576698