本文整理汇总了C++中Glyph::Transform方法的典型用法代码示例。如果您正苦于以下问题:C++ Glyph::Transform方法的具体用法?C++ Glyph::Transform怎么用?C++ Glyph::Transform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Glyph
的用法示例。
在下文中一共展示了Glyph::Transform方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Lookup
//.........这里部分代码省略.........
rsize.cx = rsize.cy = r->width;
if(vertical) {
p.y = GetAlignPoint(style.placement, scale, frame, rsize).y;
for(POSITION gpos = r->GetHeadPosition(); gpos; r->GetNext(gpos)) {
CAutoPtr<Glyph> g = r->GetAt(gpos);
g->tl.x = p.x + (int)(g->style.placement.offset.x * scale.cx + 0.5) + r->ascent - g->ascent;
g->tl.y = p.y + (int)(g->style.placement.offset.y * scale.cy + 0.5);
p.y += g->width + g->spacing;
rs->m_glyphs.AddTail(g);
}
p.x += r->ascent + r->descent;
} else {
p.x = GetAlignPoint(style.placement, scale, frame, rsize).x;
for(POSITION gpos = r->GetHeadPosition(); gpos; r->GetNext(gpos)) {
CAutoPtr<Glyph> g = r->GetAt(gpos);
g->tl.x = p.x + (int)(g->style.placement.offset.x * scale.cx + 0.5);
g->tl.y = p.y + (int)(g->style.placement.offset.y * scale.cy + 0.5) + r->ascent - g->ascent;
p.x += g->width + g->spacing;
rs->m_glyphs.AddTail(g);
}
p.y += r->ascent + r->descent;
}
}
// bkg, precalc style.placement.path, transform
pos = rs->m_glyphs.GetHeadPosition();
while(pos) {
Glyph* g = rs->m_glyphs.GetNext(pos);
g->CreateBkg();
g->CreateSplineCoeffs(spdrc);
g->Transform(org, subrect);
}
// merge glyphs (TODO: merge 'fill' too)
Glyph* g0 = NULL;
pos = rs->m_glyphs.GetHeadPosition();
while(pos) {
POSITION cur = pos;
Glyph* g = rs->m_glyphs.GetNext(pos);
CRect r = g->bbox + g->tl;
int size = (int)(g->GetBackgroundSize() + 0.5);
int depth = (int)(g->GetShadowDepth() + 0.5);
r.InflateRect(size, size);
r.InflateRect(depth, depth);
r.left >>= 6;
r.top >>= 6;
r.right = (r.right + 32) >> 6;
r.bottom = (r.bottom + 32) >> 6;
if((r & clip).IsRectEmpty()) { // clip
rs->m_glyphs.RemoveAt(cur);
} else if(g0 && g0->style.IsSimilar(g->style)) { // append
CPoint o = g->tl - g0->tl;
g->path.MovePoints(o);
g0->path.types.Append(g->path.types);
g0->path.points.Append(g->path.points);
g->path_bkg.MovePoints(o);
g0->path_bkg.types.Append(g->path_bkg.types);
g0->path_bkg.points.Append(g->path_bkg.points);
g0->bbox |= g->bbox + o;
rs->m_glyphs.RemoveAt(cur);
} else { // leave alone
g0 = g;
}
}
// rasterize
pos = rs->m_glyphs.GetHeadPosition();
while(pos) {
rs->m_glyphs.GetNext(pos)->Rasterize();
}
// cache
m_rsc.Add(s->m_name, rs);
m_fc.Flush();
return rs;
}