本文整理汇总了C++中AffineTransform::map方法的典型用法代码示例。如果您正苦于以下问题:C++ AffineTransform::map方法的具体用法?C++ AffineTransform::map怎么用?C++ AffineTransform::map使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AffineTransform
的用法示例。
在下文中一共展示了AffineTransform::map方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fillRect
void GraphicsContext::fillRect(const IntRect& rectWK, const Color& color, bool solidFill)
{
if (paintingDisabled())
return;
const IntSize& o = origin();
EA::Raster::Rect rect(rectWK.x() + o.width(), rectWK.y() + o.height(), rectWK.width(), rectWK.height());
EA::Raster::ISurface* const pSurface = m_data->surface;
EA::Raster::IEARaster* pRaster = EA::WebKit::GetEARasterInstance();
EA::Raster::Color c(color.red(), color.green(), color.blue(), color.alpha());
if( (!solidFill) && (color.alpha()) )
{
// To do: What really want to do is modify the alpha of 'color' in place instead of create temporary.
// 12/8/10 CSidhall - Replaced the alpha stroke by the color alpha to fix background color fills with alpha and text highlight bug.
// Note: Still remains an issue with overlapping child nodes with a same alpha which should not be darker.
// const int alpha = m_data->layers.isEmpty() ? strokeColor().alpha() : static_cast<int>(strokeColor().alpha() * m_data->layers.last());
const int alpha = m_data->layers.isEmpty() ? color.alpha() : static_cast<int>(color.alpha() * m_data->layers.last());
c.setAlpha(alpha);
}
// 12/18/10 CSidhall - Added transform support for fill.
if(hasTransform())
{
AffineTransform t = getCTM();
double x[4];
double y[4];
double x1 = double (rect.x - origin().width());
double y1 = double (rect.y - origin().height());
t.map( x1, y1, &x[0],&y[0]);
t.map((x1 + (double) rect.w), (y1 + (double) rect.h), &x[1],&y[1]);
t.map((x1 + (double) rect.w), y1, &x[2],&y[2]);
t.map( x1, (y1 + (double) rect.h), &x[3],&y[3]);
int orgW = origin().width();
int orgH = origin().height();
int vx[3] ={ (int) x[0] + orgW ,(int) x[2] + orgW,(int) x[3] + orgW};
int vy[3] ={ (int) y[0] + orgH,(int) y[2] + orgH,(int) y[3] + orgH};
pRaster->FilledPolygonColor( pSurface, &vx[0], &vy[0], 3 ,c);
vx[0] = (int) x[1] + orgW;
vy[0] = (int) y[1] + orgH;
pRaster->FilledPolygonColor( pSurface, &vx[0], &vy[0], 3 ,c);
}
else if(solidFill)
{
pRaster->FillRectSolidColor(pSurface, &rect, c);
}
else
{
pRaster->FillRectColor(pSurface, &rect, c);
}
}
示例2: viewport
FloatRect SVGSVGElement::viewport() const
{
double _x = 0.0;
double _y = 0.0;
if (!isOutermostSVG()) {
_x = x().value(this);
_y = y().value(this);
}
float w = width().value(this);
float h = height().value(this);
AffineTransform viewBox = viewBoxToViewTransform(w, h);
double wDouble = w;
double hDouble = h;
viewBox.map(_x, _y, _x, _y);
viewBox.map(w, h, wDouble, hDouble);
return FloatRect::narrowPrecision(_x, _y, wDouble, hDouble);
}
示例3: viewport
FloatRect SVGSVGElement::viewport() const
{
double _x = 0.0;
double _y = 0.0;
if (renderer() && renderer()->parent() &&
!renderer()->parent()->isSVGContainer()) {
_x = x().value();
_y = y().value();
}
float w = width().value();
float h = height().value();
AffineTransform viewBox = viewBoxToViewTransform(w, h);
double wDouble = w;
double hDouble = h;
viewBox.map(_x, _y, &_x, &_y);
viewBox.map(w, h, &wDouble, &hDouble);
return FloatRect::narrowPrecision(_x, _y, wDouble, hDouble);
}
示例4: matrixTransform
FloatPoint FloatPoint::matrixTransform(const AffineTransform& transform) const
{
double newX, newY;
transform.map(static_cast<double>(m_x), static_cast<double>(m_y), newX, newY);
return narrowPrecision(newX, newY);
}
示例5: matrixTransform
FloatPoint SVGPoint::matrixTransform(const AffineTransform& transform) const
{
double newX, newY;
transform.map(static_cast<double>(x()), static_cast<double>(y()), newX, newY);
return FloatPoint::narrowPrecision(newX, newY);
}