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

Side by Side Diff: webrtc/modules/desktop_capture/rgba_color.h

Issue 2726983005: Revert of BlankDetectorDesktopCapturerWrapper to detect a blank DesktopFrame (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_RGBA_COLOR_H_ 11 #ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_RGBA_COLOR_H_
12 #define WEBRTC_MODULES_DESKTOP_CAPTURE_RGBA_COLOR_H_ 12 #define WEBRTC_MODULES_DESKTOP_CAPTURE_RGBA_COLOR_H_
13 13
14 #include <stdint.h> 14 #include <stdint.h>
15 15
16 #include "webrtc/modules/desktop_capture/desktop_frame.h" 16 #include "webrtc/modules/desktop_capture/desktop_frame.h"
17 17
18 namespace webrtc { 18 namespace webrtc {
19 19
20 // A four-byte structure to store a color in BGRA format. This structure also 20 // A four-byte structure to store a color in BGRA format. This structure also
21 // provides functions to be created from uint8_t array, say, 21 // provides functions to be created from uint8_t array, say,
22 // DesktopFrame::data(). It always uses BGRA order for internal storage to match 22 // DesktopFrame::data(). It always uses BGRA order for internal storage to match
23 // DesktopFrame::data(). 23 // DesktopFrame::data().
24 //
25 // This struct is for testing purpose only, and should not be used in production
26 // logic.
24 struct RgbaColor final { 27 struct RgbaColor final {
25 // Creates a color with BGRA channels. 28 // Creates a color with BGRA channels.
26 RgbaColor(uint8_t blue, uint8_t green, uint8_t red, uint8_t alpha); 29 RgbaColor(uint8_t blue, uint8_t green, uint8_t red, uint8_t alpha);
27 30
28 // Creates a color with BGR channels, and set alpha channel to 255 (opaque). 31 // Creates a color with BGR channels, and set alpha channel to 255 (opaque).
29 RgbaColor(uint8_t blue, uint8_t green, uint8_t red); 32 RgbaColor(uint8_t blue, uint8_t green, uint8_t red);
30 33
31 // Creates a color from four-byte in BGRA order, i.e. DesktopFrame::data(). 34 // Creates a color from four-byte in BGRA order, i.e. DesktopFrame::data().
32 explicit RgbaColor(const uint8_t* bgra); 35 explicit RgbaColor(const uint8_t* bgra);
33 36
(...skipping 16 matching lines...) Expand all
50 uint8_t red; 53 uint8_t red;
51 uint8_t alpha; 54 uint8_t alpha;
52 }; 55 };
53 static_assert( 56 static_assert(
54 DesktopFrame::kBytesPerPixel == sizeof(RgbaColor), 57 DesktopFrame::kBytesPerPixel == sizeof(RgbaColor),
55 "A pixel in DesktopFrame should be safe to be represented by a RgbaColor"); 58 "A pixel in DesktopFrame should be safe to be represented by a RgbaColor");
56 59
57 } // namespace webrtc 60 } // namespace webrtc
58 61
59 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_RGBA_COLOR_H_ 62 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_RGBA_COLOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698