MCPcopy Create free account
hub / github.com/Aleksoid1978/VideoRenderer / CopyFrameR210

Function CopyFrameR210

Source/Helper.cpp:769–787  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

767}
768
769void CopyFrameR210(const UINT lines, BYTE* dst, UINT dst_pitch, const BYTE* src, int src_pitch)
770{
771 ASSERT(src_pitch > 0);
772 UINT line_pixels = src_pitch / 4;
773
774 for (UINT y = 0; y < lines; ++y) {
775 uint32_t* src32 = (uint32_t*)src;
776 uint32_t* dst32 = (uint32_t*)dst;
777 for (UINT i = 0; i < line_pixels; i++) {
778 const uint32_t t = src32[i];
779 uint32_t r = ((t & 0x0000003f) << 4) | ((t & 0x0000f000) >> 12);
780 uint32_t g = ((t & 0x00fc0000) >> 8) | ((t & 0x00000f00) << 8);
781 uint32_t b = ((t & 0xff000000) >> 4) | ((t & 0x00030000) << 12);
782 dst32[i] = r | g | b;
783 }
784 src += src_pitch;
785 dst += dst_pitch;
786 }
787}
788
789void CopyPlane10to16(const UINT lines, BYTE* dst, UINT dst_pitch, const BYTE* src, int src_pitch)
790{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected