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

Unified Diff: include/codec/SkScaledCodec.h

Issue 1287423002: Scanline decoding for bmp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Response to comments from Patch Set 15 Created 5 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
Index: include/codec/SkScaledCodec.h
diff --git a/include/codec/SkScaledCodec.h b/include/codec/SkScaledCodec.h
index 1bcdf085b213f7eaab1cb9d9eca51a491138c58f..14b7f65f5c2600ae819b193826f7076fb37c356f 100644
--- a/include/codec/SkScaledCodec.h
+++ b/include/codec/SkScaledCodec.h
@@ -40,6 +40,34 @@ public:
return true;
}
+ /*
+ * Returns the first coordinate that we will keep during sampling.
+ * The output can be interpreted as an x-coordinate or a y-coordinate.
+ *
+ * This does not need to be called and is not called when sampleFactor == 1.
+ */
+ static int GetStartCoord(int sampleFactor) { return sampleFactor / 2 };
msarett 2015/08/28 15:09:18 It occurs to me that maybe we don't want these imp
+
+ /*
+ * Given a coordinate in the original image, this returns the corresponding
+ * coordinate in the scaled image. This function is meaningless if
+ * IsCoordNecessary returns false.
+ * The output can be interpreted as an x-coordinate or a y-coordinate.
+ *
+ * This does not need to be called and is not called when sampleFactor == 1.
+ */
+ static int GetDstCoord(int srcCoord, int sampleFactor) { return srcCoord / sampleFactor; }
+
+ /*
+ * When sampling, we will discard certain y-coordinates (rows) and
+ * x-coordinates (columns). This function returns true if we should keep the
+ * coordinate and false otherwise.
+ * The inputs may be x-coordinates or y-coordinates.
+ *
+ * This does not need to be called and is not called when sampleFactor == 1.
+ */
+ static bool IsCoordNecessary(int srcCoord, int sampleFactor, int scaledDim);
+
static void ComputeSampleSize(const SkImageInfo& dstInfo, const SkImageInfo& srcInfo,
int* sampleSizeX, int* sampleSizeY);
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | include/codec/SkScanlineDecoder.h » ('j') | src/codec/SkBmpRLECodec.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698