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

Unified Diff: src/codec/SkCodec_libbmp.h

Issue 1013743003: Adding premul and 565 swizzles for bmp: (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Clean up before public code review Created 5 years, 9 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 | « no previous file | src/codec/SkCodec_libbmp.cpp » ('j') | src/codec/SkCodec_libbmp.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkCodec_libbmp.h
diff --git a/src/codec/SkCodec_libbmp.h b/src/codec/SkCodec_libbmp.h
index f35b88dc69d880c2f3ec698437bd93298a979692..ba9db9e212f33a25e78009ef490b2c750e0628d4 100644
--- a/src/codec/SkCodec_libbmp.h
+++ b/src/codec/SkCodec_libbmp.h
@@ -75,6 +75,13 @@ private:
/*
*
+ * Creates the color table
+ *
+ */
+ bool createColorTable(const SkAlphaType alphaType);
scroggo 2015/03/17 13:27:22 nit: We typically do not mark enum parameters as c
msarett 2015/03/17 16:54:06 Done.
+
+ /*
+ *
* Performs the bitmap decoding for bit masks input format
*
*/
@@ -86,8 +93,17 @@ private:
* Set an RLE pixel using the color table
*
*/
- void setRLEPixel(SkPMColor* dst, size_t dstRowBytes, int height,
- uint32_t x, uint32_t y, uint8_t index);
+ void setRLEPixel(SkPMColor* dst, size_t dstRowBytes,
+ const SkImageInfo& dstInfo, uint32_t x, uint32_t y,
+ uint8_t index);
+ /*
+ *
+ * Set an RLE24 pixel from R, G, B values
+ *
+ */
+ void setRLE24Pixel(SkPMColor* dst, size_t dstRowBytes,
+ const SkImageInfo& dstInfo, uint32_t x, uint32_t y,
+ uint8_t red, uint8_t green, uint8_t blue);
/*
*
@@ -115,9 +131,11 @@ private:
* @param format the format of the bmp file
* @param masks optional color masks for certain bmp formats, passes
ownership to SkBmpCodec
- * @param colorTable array representing the color table for index-based bmp
- * formats, colors are unpremultiplied, passes ownership
- * to SkBmpCodec
+ * @param numColors the number of colors in the color table
+ * @param bytesPerColor the number of bytes in the stream used to represent
+ each color in the color table
+ * @param offset the offset of the image pixel data from the end of the
+ * color table
* @param rowOrder indicates whether rows are ordered top-down or bottom-up
* @param remainingBytes used only for RLE decodes, as we must decode all
* of the data at once rather than row by row
@@ -127,14 +145,17 @@ private:
*/
SkBmpCodec(const SkImageInfo& srcInfo, SkStream* stream,
uint16_t bitsPerPixel, BitmapInputFormat format,
- SkMasks* masks, SkPMColor* colorTable,
- RowOrder rowOrder, uint32_t remainingBytes);
+ SkMasks* masks, uint32_t numColors, uint32_t bytesPerColor,
+ uint32_t offset, RowOrder rowOrder, uint32_t remainingBytes);
// Fields
const uint16_t fBitsPerPixel;
const BitmapInputFormat fInputFormat;
SkAutoTDelete<SkMasks> fMasks; // owned
- const SkAutoTDeleteArray<SkPMColor> fColorTable; // owned, unpremul
+ SkAutoTDeleteArray<SkPMColor> fColorTable; // owned, unpremul
scroggo 2015/03/17 13:27:22 This is no longer necessarily unpremul.
msarett 2015/03/17 16:54:06 Sorry, I missed that.
+ const uint32_t fNumColors;
scroggo 2015/03/17 13:27:22 FWIW, you could use an SkColorTable which holds bo
msarett 2015/03/17 16:54:06 Unfortuntately, using SkColorTable does not allow
+ const uint32_t fBytesPerColor;
+ const uint32_t fOffset;
const RowOrder fRowOrder;
const uint32_t fRemainingBytes;
scroggo 2015/03/17 13:27:22 It seems like the meaning of fRemainingBytes has c
msarett 2015/03/17 16:54:06 Done.
« no previous file with comments | « no previous file | src/codec/SkCodec_libbmp.cpp » ('j') | src/codec/SkCodec_libbmp.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698