Chromium Code Reviews| Index: third_party/ktx/ktx.h |
| diff --git a/third_party/ktx/ktx.h b/third_party/ktx/ktx.h |
| index 0e4ed9b9900721b3c9700ee8af2b9e57b15b9097..dc432409a21e7f590b3502d3da176e05cab3e3fd 100644 |
| --- a/third_party/ktx/ktx.h |
| +++ b/third_party/ktx/ktx.h |
| @@ -16,7 +16,9 @@ |
| #include "SkString.h" |
| #include "SkRefCnt.h" |
| +class SkBitmap; |
| class SkStreamRewindable; |
| +class SkWStream; |
| // KTX Image File |
| // --- |
| @@ -49,6 +51,11 @@ public: |
| return this->valid() ? fPixelData[mipmap].data() : NULL; |
| } |
| + // If the decoded KTX file has the following key, then it will |
| + // return the associated value. If not found, the empty string |
| + // is returned. |
|
robertphillips
2014/06/05 19:12:21
const SkString& key ?
krajcevski
2014/06/05 19:29:44
Done.
|
| + SkString getValueForKey(SkString key) const; |
| + |
| int numMipmaps() const { return static_cast<int>(fHeader.fNumberOfMipmapLevels); } |
| bool isETC1() const; |
| @@ -58,6 +65,9 @@ public: |
| static bool is_ktx(const uint8_t *data); |
| static bool is_ktx(SkStreamRewindable* stream); |
| + static bool WriteETC1ToKTX(SkWStream* stream, const uint8_t *etc1Data, |
| + uint32_t width, uint32_t height); |
| + static bool WriteBitmapToKTX(SkWStream* stream, const SkBitmap& bitmap); |
| private: |
| // The blob holding the file data. |
| @@ -88,13 +98,18 @@ private: |
| public: |
| KeyValue(size_t size) : fDataSz(size) { } |
| bool readKeyAndValue(const uint8_t *data); |
| - |
| + size_t size() const { return fDataSz; } |
|
robertphillips
2014/06/05 19:12:21
return "const SkString &" ?
krajcevski
2014/06/05 19:29:45
Done.
|
| + SkString key() const { return fKey; } |
| + SkString value() const { return fValue; } |
| + bool writeKeyAndValueForKTX(SkWStream* strm); |
| private: |
|
robertphillips
2014/06/05 19:12:21
Line up the member variable names ?
krajcevski
2014/06/05 19:29:44
Done.
|
| const size_t fDataSz; |
| SkString fKey; |
| SkString fValue; |
| }; |
| + static KeyValue CreateKeyValue(const char *key, const char *value); |
| + |
| // The pixel data for a single mipmap level in an image. Based on how |
| // the rest of the data is stored, this may be compressed, a cubemap, etc. |
| // The header will describe the format of this data. |