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

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: Fixes 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 | « src/codec/SkPngCodec.cpp ('k') | src/core/SkColorSpaceXform.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkColorSpaceXform.h
diff --git a/src/core/SkColorSpaceXform.h b/src/core/SkColorSpaceXform.h
index 2696b8582accdca6352fe7c5ef70d4b925e702ed..91dbf54295e63e28171ba092051beaf1b897fadf 100644
--- a/src/core/SkColorSpaceXform.h
+++ b/src/core/SkColorSpaceXform.h
@@ -10,14 +10,11 @@
#include "SkColorSpace.h"
#include "SkColorSpace_Base.h"
+#include "SkImageInfo.h"
class SkColorSpaceXform : SkNoncopyable {
public:
- typedef uint32_t RGBA32;
- typedef uint32_t BGRA32;
- typedef uint64_t RGBAF16;
-
/**
* Create an object to handle color space conversions.
*
@@ -30,23 +27,21 @@ 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). The dst is stored in the format indicated by
+ * |dstColorType| and is premultiplied by alpha if |premul| is set.
*/
- 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 apply(void* dst, const uint32_t* src, int len, SkColorType dstColorType,
+ SkAlphaType dstAlphaType) const = 0;
virtual ~SkColorSpaceXform() {}
};
-template <SkColorSpace::GammaNamed Dst>
+template <SkColorSpace::GammaNamed kDst>
class SkColorSpaceXform_Base : public SkColorSpaceXform {
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 apply(void* dst, const uint32_t* src, int len, SkColorType dstColorType,
+ SkAlphaType dstAlphaType) const override;
static constexpr int kDstGammaTableSize = 1024;
« no previous file with comments | « src/codec/SkPngCodec.cpp ('k') | src/core/SkColorSpaceXform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698