我有一个RGB24格式的流。每个缓冲区都是一个视频帧。我需要在每个帧中添加一些文本。问题是我不知道libgd是否有方法从RGB24 raw添加缓冲区作为背景。任何想法如何做到这一点?
void * AddHello(void * pRGB24RAW)
{
int black;
gdImagePtr im;
im = gdImageCreateTrueColor(320,240);
// Here i should set background from the pRGB24RAW pointer
black = gdImageColorResolveAlpha(im, 0, 0, 0, gdAlphaOpaque);
gdImageStringFT (im, NULL, black, "Arial", 12, 0, 2, 14, "Hello");
// Here i should copy modified buffer back to the pRGB24RAW pointer
gdImageDestroy (im);
return pRGB24RAW;
}