Chromium Code Reviews| Index: include/codec/SkScaledCodec.h |
| diff --git a/include/codec/SkScaledCodec.h b/include/codec/SkScaledCodec.h |
| index 1bcdf085b213f7eaab1cb9d9eca51a491138c58f..30925c0cf49e40c5cd6f146adb2e74947945d1d5 100644 |
| --- a/include/codec/SkScaledCodec.h |
| +++ b/include/codec/SkScaledCodec.h |
| @@ -40,6 +40,28 @@ 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. |
|
scroggo
2015/08/28 14:35:01
Maybe add comments that these do not need to be (a
msarett
2015/08/28 15:09:18
Done.
|
| + */ |
| + static inline int GetStartCoord(int sampleFactor); |
|
scroggo
2015/08/28 14:35:01
I believe inline functions need to be written in o
msarett
2015/08/28 15:09:18
You are right that this is silly. Just typing inl
|
| + |
| + /* |
| + * 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. |
| + */ |
| + static inline int GetDstCoord(int srcCoord, int 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. |
| + */ |
| + static bool IsCoordNecessary(int srcCoord, int sampleFactor, int scaledDim); |
| + |
| static void ComputeSampleSize(const SkImageInfo& dstInfo, const SkImageInfo& srcInfo, |
| int* sampleSizeX, int* sampleSizeY); |