MCPcopy Create free account
hub / github.com/Tencent/libpag / GetAlphaFromRGBA

Function GetAlphaFromRGBA

exporter/src/export/encode/VideoEncoder.cpp:25–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23namespace exporter {
24
25static void GetAlphaFromRGBA(uint8_t* dstData[4], int dstStride[4], uint8_t* srcData, int srcStride,
26 int width, int height, int alphaStartX, int alphaStartY) {
27 uint8_t* alphaData = dstData[0] + alphaStartY * dstStride[0] + alphaStartX;
28 uint8_t* data = srcData;
29
30 for (int j = 0; j < height; j++) {
31 for (int i = 0; i < width; i++) {
32 alphaData[i] = (data[i * 4 + 3] * 219 >> 8) + 16;
33 }
34
35 alphaData += dstStride[0];
36 data += srcStride;
37 }
38}
39
40static void FillYUVPadding(uint8_t* data[4], int stride[4], int width, int height, int alphaStartX,
41 int alphaStartY) {

Callers 1

encodeRGBAMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected