void CIppsSignalDC::SetPointsComplex() { double step = 1. / FactorX(); double x = 0.5; for (int i=0; i < m_NumPoints; i++, x+=step) { Ipp64fc value; m_pSignal->GetValue((int)x, value); value.re *= FactorY(); value.im *= FactorY(); m_Points[i].x = i + GetSpaceWidth(); m_Points[i].y = -(int)(value.re + .5); m_PointsIm[i].x = i + GetSpaceWidth(); m_PointsIm[i].y = -(int)(value.im + .5); } }
nsresult nsThebesFontMetrics::GetWidth(const char* aString, PRUint32 aLength, nscoord& aWidth, nsThebesRenderingContext *aContext) { if (aLength == 0) { aWidth = 0; return NS_OK; } // callers that hit this should not be so stupid if ((aLength == 1) && (aString[0] == ' ')) return GetSpaceWidth(aWidth); StubPropertyProvider provider; AutoTextRun textRun(this, aContext, aString, aLength); if (!textRun.get()) return NS_ERROR_FAILURE; aWidth = NSToCoordRound(textRun->GetAdvanceWidth(0, aLength, &provider)); return NS_OK; }
double CIppsSignalDC::FactorX() { return (double)(GetWidth() - GetSpaceWidth()*2) / (double)m_pSignal->Length(); }
int CIppsSignalDC::GetWidth() { int w = m_pSignal->Length() + GetSpaceWidth()*2; return (w < m_InitialWidth) ? w : m_InitialWidth; }
int CIppsSignalDC::GetX0() { return GetSpaceWidth(); }