FireBirdLib - Topfield TMS PVR TAP Programming Library
VideoToBMP.c
Go to the documentation of this file.
1#include "FBLib_av.h"
2#include "libFireBird.h"
3
4void VideoToBMP(TYPE_VideoFrame *VideoFrame, int BMPwidth, int BMPheight, byte *BMPPixelBuffer, int DstX, int DstY, int DstWidth, int DstHeight)
5{
7
8 dword *VideoData;
9 dword *SrcPixel;
10 byte *DstPixel;
11 int SX, SY;
12 register int x, y;
13
14 VideoData = (dword*)VideoFrame->data;
15 for(y = DstY; y < (DstY + DstHeight); y++)
16 {
17 SY = (y - DstY) * VideoFrame->height / DstHeight;
18 for(x = DstX; x < (DstX + DstWidth); x++)
19 {
20 SX = (x - DstX) * VideoFrame->width / DstWidth;
21 SrcPixel = (dword*)&VideoData[SX + SY * VideoFrame->width];
22
23 DstPixel = &BMPPixelBuffer[((BMPheight - y - 1) * BMPwidth + x) * 3];
24 DstPixel[0] = B8888(*SrcPixel);
25 DstPixel[1] = G8888(*SrcPixel);
26 DstPixel[2] = R8888(*SrcPixel);
27 }
28 }
29
30 TRACEEXIT();
31}
void VideoToBMP(TYPE_VideoFrame *VideoFrame, int BMPwidth, int BMPheight, byte *BMPPixelBuffer, int DstX, int DstY, int DstWidth, int DstHeight)
Definition: VideoToBMP.c:4
#define B8888(x)
Definition: libFireBird.h:243
#define TRACEEXIT()
Definition: libFireBird.h:1244
#define TRACEENTER()
Definition: libFireBird.h:1243
#define R8888(x)
Definition: libFireBird.h:241
#define G8888(x)
Definition: libFireBird.h:242