1 /*
2  * Copyright (C) 2024 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 namespace cuttlefish {
20 
21 // Read from the given [src] buffer, expected to be in WebRTC YUV format,
22 // writing data the [dst] buffer in v4l2 BGRX32 format. [width] and [height]
23 // must be valid to describe the frame size, so that indexing calculations are
24 // accurate. Note that [src] and [dst] buffers are both required to be
25 // pre-allocated, [src] will need to contain valid YUV data, and [dst] contents
26 // will be overwritten.
27 void Yuv2Rgb(unsigned char *src, unsigned char *dst, int width, int height);
28 
29 }  // namespace cuttlefish