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

Unified Diff: remoting/base/util.h

Issue 9320025: Introducing a helper wrapper for YUV-to-RGB convertion and/or scaling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make VC++ happy, take two. Created 8 years, 11 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: remoting/base/util.h
diff --git a/remoting/base/util.h b/remoting/base/util.h
index c05ef2f99f9b24e262259ea7755ad063adcc9870..9f61adacf6aa345a7ab406d8cc284e1259fef9e0 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_buffer_rect| and
+// |dest_buffer_rect| 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 top left corner coordinates of YUV buffer should 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_buffer_rect,
+ uint8* dest_buffer,
+ int dest_stride,
+ const SkISize& dest_size,
+ const SkIRect& dest_buffer_rect,
+ 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_buffer_rect,
+ uint8* dest_buffer,
+ int dest_stride,
+ const SkIRect& dest_buffer_rect,
+ const SkIRect& dest_rect);
+
} // namespace remoting
#endif // REMOTING_BASE_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698