Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

BOOL PVideoOutputDeviceRGB::SetFrameData ( unsigned  x,
unsigned  y,
unsigned  width,
unsigned  height,
const BYTE *  data,
BOOL  endFrame = TRUE 
) [virtual]

Set a section of the output frame buffer.

Implements PVideoOutputDevice.

Definition at line 1092 of file videoio.cxx.

{
  PWaitAndSignal m(mutex);

  if (x+width > frameWidth || y+height > frameHeight)
    return FALSE;

  if (x == 0 && width == frameWidth && y == 0 && height == frameHeight) {
    if (converter != NULL)
      converter->Convert(data, frameStore.GetPointer());
    else
      memcpy(frameStore.GetPointer(), data, height*scanLineWidth);
  }
  else {
    if (converter != NULL) {
      PAssertAlways("Converted output of partial RGB frame not supported");
      return FALSE;
    }

    if (x == 0 && width == frameWidth)
      memcpy(frameStore.GetPointer() + y*scanLineWidth, data, height*scanLineWidth);
    else {
      for (unsigned dy = 0; dy < height; dy++)
        memcpy(frameStore.GetPointer() + (y+dy)*scanLineWidth + x*bytesPerPixel,
               data + dy*width*bytesPerPixel, width*bytesPerPixel);
    }
  }

  if (endFrame)
    return FrameComplete();

  return TRUE;
}

Generated by  Doxygen 1.6.0   Back to index