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

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: More review feedback. Created 8 years, 10 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
« no previous file with comments | « remoting/base/decoder_vp8.cc ('k') | remoting/base/util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/util.h
diff --git a/remoting/base/util.h b/remoting/base/util.h
index c05ef2f99f9b24e262259ea7755ad063adcc9870..c4621cc0a3661ac1fc4a2e0eb532b29fa427c359 100644
--- a/remoting/base/util.h
+++ b/remoting/base/util.h
@@ -18,16 +18,33 @@ 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.
+//
+// |source_buffer_rect| and |dest_buffer_rect| must fall entirely within
+// the source and destination dimensions, respectively. |dest_rect| must be
+// completely contained within the source and destinations buffers boundaries
+// including the case when scaling is requested.
+//
+// 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 +77,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_
« no previous file with comments | « remoting/base/decoder_vp8.cc ('k') | remoting/base/util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698