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

BOOL PVideoOutputDeviceRGB::SetColourFormat ( const PString colourFormat ) [virtual]

Set the colour format to be used. Note that this function does not do any conversion. If it returns TRUE then the video device does the colour format in native mode.

To utilise an internal converter use the SetColourFormatConverter() function.

Default behaviour sets the value of the colourFormat variable and then returns TRUE.

Reimplemented from PVideoDevice.

Reimplemented in PVideoOutputDevice_Window.

Definition at line 1025 of file videoio.cxx.

References PVideoDevice::SetColourFormat().

Referenced by PVideoOutputDevice_Window::SetColourFormat().

{
  PWaitAndSignal m(mutex);

  PINDEX newBytesPerPixel;
  bool newSwappedRedAndBlue;
  if (colourFormat *= "RGB32") {
    newBytesPerPixel = 4;
    newSwappedRedAndBlue = false;
  }
  else if (colourFormat *= "RGB24") {
    newBytesPerPixel = 3;
    newSwappedRedAndBlue = false;
  }
  else if (colourFormat *= "BGR32") {
    newBytesPerPixel = 4;
    newSwappedRedAndBlue = true;
  }
  else if (colourFormat *= "BGR24") {
    newBytesPerPixel = 3;
    newSwappedRedAndBlue = true;
  }
  else
    return FALSE;

  if (!PVideoOutputDevice::SetColourFormat(colourFormat))
    return FALSE;

  bytesPerPixel = newBytesPerPixel;
  scanLineWidth = ((frameWidth*bytesPerPixel+3)/4)*4;
  return frameStore.SetSize(frameHeight*scanLineWidth);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index