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

int wxPdfDocument::SetAlpha ( double  lineAlpha = 1,
double  fillAlpha = 1,
wxPdfBlendMode  blendMode = wxPDF_BLENDMODE_NORMAL 
) [virtual]

Sets alpha values and blend mode.

Parameters:
lineAlphaalpha value for stroking operations, from 0 (transparent) to 1 (opaque)
fillAlphaalpha value for non-stroking operations, from 0 (transparent) to 1 (opaque)
blendModeone of the following: Normal, Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn, HardLight, SoftLight, Difference, Exclusion, Hue, Saturation, Color, Luminosity

Definition at line 41 of file pdfgraphics.cpp.

References m_currentExtGState, and SetAlphaState().

{
  int n = 0;

  // Force alpha into range 0 .. 1
  if (lineAlpha < 0) lineAlpha = 0;
  else if (lineAlpha > 1) lineAlpha = 1;
  if (fillAlpha < 0) fillAlpha = 0;
  else if (fillAlpha > 1) fillAlpha = 1;

  // Create state id for lookup map
  int id = ((int) blendMode) * 100000000 + (int) (lineAlpha * 1000) * 10000 + (int) (fillAlpha * 1000);

  // Lookup state
  wxPdfExtGSLookupMap::iterator extGState = (*m_extGSLookup).find(id);
  if (extGState == (*m_extGSLookup).end())
  {
    n = (*m_extGStates).size() + 1;
    (*m_extGStates)[n] = new wxPdfExtGState(lineAlpha, fillAlpha, blendMode);
    (*m_extGSLookup)[id] = n;
  }
  else
  {
    n = extGState->second;
  }

  if (n != m_currentExtGState)
  {
    SetAlphaState(n);
  }

  return n;
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index