OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef REMOTING_BASE_UTIL_H_ | 5 #ifndef REMOTING_BASE_UTIL_H_ |
6 #define REMOTING_BASE_UTIL_H_ | 6 #define REMOTING_BASE_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 int height, | 47 int height, |
48 int rgb_stride, | 48 int rgb_stride, |
49 int y_stride, | 49 int y_stride, |
50 int uv_stride); | 50 int uv_stride); |
51 | 51 |
52 int RoundToTwosMultiple(int x); | 52 int RoundToTwosMultiple(int x); |
53 | 53 |
54 // Align the sides of the rectangle to multiples of 2 (expanding outwards). | 54 // Align the sides of the rectangle to multiples of 2 (expanding outwards). |
55 SkIRect AlignRect(const SkIRect& rect); | 55 SkIRect AlignRect(const SkIRect& rect); |
56 | 56 |
57 // Scale a rectangle by horizontal and vertical factors. If the result has | 57 // Scales the supplied rectangle from |in_size| coordinates to |out_size|. |
58 // non-integer coordinates then the smallest integer-coordinate rectangle that | 58 // If the result has non-integer coordinates then the smallest integer- |
59 // wholly encloses it is returned. | 59 // coordinate rectangle that wholly encloses it is returned. |
60 SkIRect ScaleRect(const SkIRect& rect, | 60 SkIRect ScaleRect(const SkIRect& rect, |
61 double horizontal_ratio, | 61 const SkISize& in_size, |
62 double vertical_ratio); | 62 const SkISize& out_size); |
63 | 63 |
64 // Copy pixels in the rectangle from source to destination. | 64 // Copy pixels in the rectangle from source to destination. |
65 void CopyRect(const uint8* src_plane, | 65 void CopyRect(const uint8* src_plane, |
66 int src_plane_stride, | 66 int src_plane_stride, |
67 uint8* dest_plane, | 67 uint8* dest_plane, |
68 int dest_plane_stride, | 68 int dest_plane_stride, |
69 int bytes_per_pixel, | 69 int bytes_per_pixel, |
70 const SkIRect& rect); | 70 const SkIRect& rect); |
71 | 71 |
72 } // namespace remoting | 72 } // namespace remoting |
73 | 73 |
74 #endif // REMOTING_BASE_UTIL_H_ | 74 #endif // REMOTING_BASE_UTIL_H_ |
OLD | NEW |