#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "content/browser/media/capture/frame_test_util.h"
#include <stdint.h>
#include <cmath>
#include "base/numerics/safe_conversions.h"
#include "media/base/video_frame.h"
#include "media/base/video_types.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkTypes.h"
#include "ui/gfx/color_space.h"
#include "ui/gfx/color_transform.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/geometry/transform.h"
namespace content {
namespace {
TriStim;
void LoadStimsFromYUV(const uint8_t y_src[],
const uint8_t u_src[],
const uint8_t v_src[],
int width,
TriStim stims[]) { … }
void LoadStimsFromYUV(const uint8_t y_src[],
const uint16_t uv_src[],
int width,
TriStim stims[]) { … }
uint8_t QuantizeAndClamp(float value) { … }
void StimsToN32Row(const TriStim row[], int width, uint8_t bgra_out[]) { … }
}
SkBitmap FrameTestUtil::ConvertToBitmap(const media::VideoFrame& frame) { … }
gfx::Rect FrameTestUtil::ToSafeIncludeRect(const gfx::RectF& rect_f,
int fuzzy_border) { … }
gfx::Rect FrameTestUtil::ToSafeExcludeRect(const gfx::RectF& rect_f,
int fuzzy_border) { … }
FrameTestUtil::RGB FrameTestUtil::ComputeAverageColor(
SkBitmap frame,
const gfx::Rect& raw_include_rect,
const gfx::Rect& raw_exclude_rect) { … }
bool FrameTestUtil::IsApproximatelySameColor(SkColor color,
const RGB& rgb,
int max_diff) { … }
bool FrameTestUtil::IsApproximatelySameColor(SkColor color,
SkColor expected_color,
int max_diff) { … }
bool FrameTestUtil::IsApproximatelySameColor(SkBitmap frame,
const gfx::Rect& raw_include_rect,
const gfx::Rect& raw_exclude_rect,
SkColor expected_color,
int max_diff) { … }
gfx::RectF FrameTestUtil::TransformSimilarly(const gfx::Rect& original,
const gfx::RectF& transformed,
const gfx::Rect& rect) { … }
std::ostream& operator<<(std::ostream& out, const FrameTestUtil::RGB& rgb) { … }
}