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

Unified Diff: src/codec/SkRawCodec.cpp

Issue 1820073002: Add SkEncodedInfo to report properties of encoded image data (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Order of param eval bug Created 4 years, 8 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/codec/SkWbmpCodec.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkRawCodec.cpp
diff --git a/src/codec/SkRawCodec.cpp b/src/codec/SkRawCodec.cpp
index ef8ba700a46b22130bdfd262b610e2b66e1c72ee..51de2fcec02bd12b9a5a68faefc5add1011001e7 100644
--- a/src/codec/SkRawCodec.cpp
+++ b/src/codec/SkRawCodec.cpp
@@ -515,8 +515,16 @@ public:
}
}
- const SkImageInfo& getImageInfo() const {
- return fImageInfo;
+ const SkEncodedInfo& getEncodedInfo() const {
+ return fEncodedInfo;
+ }
+
+ int width() const {
+ return fWidth;
+ }
+
+ int height() const {
+ return fHeight;
}
bool isScalable() const {
@@ -545,8 +553,11 @@ private:
return 0x2A == get_endian_short(header + 2, littleEndian);
}
- void init(const int width, const int height, const dng_point& cfaPatternSize) {
- fImageInfo = SkImageInfo::Make(width, height, kN32_SkColorType, kOpaque_SkAlphaType);
+ void init(int width, int height, const dng_point& cfaPatternSize) {
+ fWidth = width;
+ fHeight = height;
+ fEncodedInfo = SkEncodedInfo::Make(SkEncodedInfo::kRGB_Color,
+ SkEncodedInfo::kOpaque_Alpha, 8);
// The DNG SDK scales only during demosaicing, so scaling is only possible when
// a mosaic info is available.
@@ -616,7 +627,9 @@ private:
SkAutoTDelete<dng_negative> fNegative;
SkAutoTDelete<dng_stream> fDngStream;
- SkImageInfo fImageInfo;
+ int fWidth;
+ int fHeight;
+ SkEncodedInfo fEncodedInfo;
bool fIsScalable;
bool fIsXtransImage;
};
@@ -764,5 +777,5 @@ bool SkRawCodec::onDimensionsSupported(const SkISize& dim) {
SkRawCodec::~SkRawCodec() {}
SkRawCodec::SkRawCodec(SkDngImage* dngImage)
- : INHERITED(dngImage->getImageInfo(), nullptr)
+ : INHERITED(dngImage->width(), dngImage->height(), dngImage->getEncodedInfo(), nullptr)
, fDngImage(dngImage) {}
« no previous file with comments | « src/codec/SkPngCodec.cpp ('k') | src/codec/SkWbmpCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698