Index: remoting/base/util.h |
diff --git a/remoting/base/util.h b/remoting/base/util.h |
index c05ef2f99f9b24e262259ea7755ad063adcc9870..9d1f9c6975711ccc618b30dd26b12ed3fc6134b1 100644 |
--- a/remoting/base/util.h |
+++ b/remoting/base/util.h |
@@ -18,16 +18,32 @@ std::string GetTimestampString(); |
// TODO(sergeyu): Move these methods to media. |
int GetBytesPerPixel(media::VideoFrame::Format format); |
-// Convert YUV to RGB32 on a specific rectangle. |
-void ConvertYUVToRGB32WithRect(const uint8* y_plane, |
- const uint8* u_plane, |
- const uint8* v_plane, |
- uint8* rgb_plane, |
- const SkIRect& rect, |
- int y_stride, |
- int uv_stride, |
- int rgb_stride); |
+// Convert and scale YUV to RGB32 on a specific rectangle. The source and |
+// destination buffers are assumed to contain only |source_clip| and |dest_clip| |
+// areas correspondingly. The scaling factor is determined as ratio between |
+// |dest_size| and |source_size|. The target rectangle |dect_rect| is specified |
+// in the destination coordinates. |
+// |
+// The routine DCHECKs that clipping boundaries are completely contained within |
+// the corresponding images. It also DCHECKs that the source and target |
+// rectangle fits the corresponding clipping areas. |
+// |
+// N.B. The function requires the top left corner of |dect_rect| to have even |
+// X and Y coordinates. |
+void ConvertAndScaleYUVToRGB32Rect(const uint8* source_yplane, |
+ const uint8* source_uplane, |
+ const uint8* source_vplane, |
+ int source_ystride, |
+ int source_uvstride, |
+ const SkISize& source_size, |
+ const SkIRect& source_clip, |
+ uint8* dest_buffer, |
+ int dest_stride, |
+ const SkISize& dest_size, |
+ const SkIRect& dest_clip, |
+ const SkIRect& dest_rect); |
+// Convert RGB32 to YUV on a specific rectangle. |
void ConvertRGB32ToYUVWithRect(const uint8* rgb_plane, |
uint8* y_plane, |
uint8* u_plane, |
@@ -60,6 +76,14 @@ void CopyRect(const uint8* src_plane, |
int bytes_per_pixel, |
const SkIRect& rect); |
+void CopyRGB32Rect(const uint8* source_buffer, |
+ int source_stride, |
+ const SkIRect& source_clip, |
+ uint8* dest_buffer, |
+ int dest_stride, |
+ const SkIRect& dest_clip, |
+ const SkIRect& dest_rect); |
+ |
} // namespace remoting |
#endif // REMOTING_BASE_UTIL_H_ |