1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9 #include "nsPrintfCString.h"
15 std::ostream
& operator<<(std::ostream
& aOut
, const Side
& aSide
) {
27 NS_ERROR("unknown side");
38 std::ostream
& operator<<(std::ostream
& aOut
, const SurfaceFormat
& aFormat
) {
45 Emit(SurfaceFormat::B8G8R8A8
);
46 Emit(SurfaceFormat::B8G8R8X8
);
47 Emit(SurfaceFormat::R8G8B8A8
);
48 Emit(SurfaceFormat::R8G8B8X8
);
49 Emit(SurfaceFormat::A8R8G8B8
);
50 Emit(SurfaceFormat::X8R8G8B8
);
51 Emit(SurfaceFormat::R8G8B8
);
52 Emit(SurfaceFormat::B8G8R8
);
53 Emit(SurfaceFormat::R5G6B5_UINT16
);
54 Emit(SurfaceFormat::A8
);
55 Emit(SurfaceFormat::A16
);
56 Emit(SurfaceFormat::R8G8
);
57 Emit(SurfaceFormat::R16G16
);
58 Emit(SurfaceFormat::YUV
);
59 Emit(SurfaceFormat::NV12
);
60 Emit(SurfaceFormat::P016
);
61 Emit(SurfaceFormat::P010
);
62 Emit(SurfaceFormat::YUV422
);
63 Emit(SurfaceFormat::HSV
);
64 Emit(SurfaceFormat::Lab
);
65 Emit(SurfaceFormat::Depth
);
67 NS_ERROR("unknown surface format");
76 std::ostream
& operator<<(std::ostream
& aOut
, const DeviceColor
& aColor
) {
77 aOut
<< nsPrintfCString("dev_rgba(%d, %d, %d, %f)", uint8_t(aColor
.r
* 255.f
),
78 uint8_t(aColor
.g
* 255.f
), uint8_t(aColor
.b
* 255.f
),
84 std::ostream
& operator<<(std::ostream
& aOut
, const SamplingFilter
& aFilter
) {
86 case SamplingFilter::GOOD
:
87 aOut
<< "SamplingFilter::GOOD";
89 case SamplingFilter::LINEAR
:
90 aOut
<< "SamplingFilter::LINEAR";
92 case SamplingFilter::POINT
:
93 aOut
<< "SamplingFilter::POINT";
102 } // namespace mozilla