Lines Matching +full:- +full:r

2  * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved.
69 pImpl->rs.path.cmds.clear(); in reset()
70 pImpl->rs.path.pts.clear(); in reset()
72 pImpl->flag |= RenderUpdateFlag::Path; in reset()
80 if (cmds) *cmds = pImpl->rs.path.cmds.data; in pathCommands()
81 return pImpl->rs.path.cmds.count; in pathCommands()
87 if (pts) *pts = pImpl->rs.path.pts.data; in pathCoords()
88 return pImpl->rs.path.pts.count; in pathCoords()
96 pImpl->grow(cmdCnt, ptsCnt); in appendPath()
97 pImpl->append(cmds, cmdCnt, pts, ptsCnt); in appendPath()
99 pImpl->flag |= RenderUpdateFlag::Path; in appendPath()
107 pImpl->moveTo(x, y); in moveTo()
115 pImpl->lineTo(x, y); in lineTo()
117 pImpl->flag |= RenderUpdateFlag::Path; in lineTo()
125 pImpl->cubicTo(cx1, cy1, cx2, cy2, x, y); in cubicTo()
127 pImpl->flag |= RenderUpdateFlag::Path; in cubicTo()
135 pImpl->close(); in close()
137 pImpl->flag |= RenderUpdateFlag::Path; in close()
148 pImpl->grow(6, 13); in appendCircle()
149 pImpl->moveTo(cx + rx, cy); in appendCircle()
150 pImpl->cubicTo(cx + rx, cy + ryKappa, cx + rxKappa, cy + ry, cx, cy + ry); in appendCircle()
151 pImpl->cubicTo(cx - rxKappa, cy + ry, cx - rx, cy + ryKappa, cx - rx, cy); in appendCircle()
152 pImpl->cubicTo(cx - rx, cy - ryKappa, cx - rxKappa, cy - ry, cx, cy - ry); in appendCircle()
153 pImpl->cubicTo(cx + rxKappa, cy - ry, cx + rx, cy - ryKappa, cx + rx, cy); in appendCircle()
154 pImpl->close(); in appendCircle()
156 pImpl->flag |= RenderUpdateFlag::Path; in appendCircle()
165 if (sweep >= 360.0f || sweep <= -360.0f) return appendCircle(cx, cy, radius, radius); in appendArc()
167 const float arcPrecision = 1e-5f; in appendArc()
172 if (fabsf(sweep / MATH_PI2) - nCurves > arcPrecision) ++nCurves; in appendArc()
173 auto sweepSign = (sweep < 0 ? -1 : 1); in appendArc()
181 pImpl->moveTo(cx, cy); in appendArc()
182 pImpl->lineTo(start.x + cx, start.y + cy); in appendArc()
184 pImpl->moveTo(start.x + cx, start.y + cy); in appendArc()
188 auto endAngle = startAngle + ((i != nCurves - 1) ? MATH_PI2 * sweepSign : fract); in appendArc()
201 auto k2 = (4.0f/3.0f) * ((sqrtf(2 * q1 * q2) - q2) / (ax * by - ay * bx)); in appendArc()
208 Point ctrl1 = {ax - k2 * ay + cx, ay + k2 * ax + cy}; in appendArc()
209 Point ctrl2 = {bx + k2 * by + cx, by - k2 * bx + cy}; in appendArc()
211 pImpl->cubicTo(ctrl1.x, ctrl1.y, ctrl2.x, ctrl2.y, end.x, end.y); in appendArc()
216 if (pie) pImpl->close(); in appendArc()
218 pImpl->flag |= RenderUpdateFlag::Path; in appendArc()
235 pImpl->grow(5, 4); in appendRect()
236 pImpl->moveTo(x, y); in appendRect()
237 pImpl->lineTo(x + w, y); in appendRect()
238 pImpl->lineTo(x + w, y + h); in appendRect()
239 pImpl->lineTo(x, y + h); in appendRect()
240 pImpl->close(); in appendRect()
245 pImpl->grow(10, 17); in appendRect()
246 pImpl->moveTo(x + rx, y); in appendRect()
247 pImpl->lineTo(x + w - rx, y); in appendRect()
248 pImpl->cubicTo(x + w - rx + hrx, y, x + w, y + ry - hry, x + w, y + ry); in appendRect()
249 pImpl->lineTo(x + w, y + h - ry); in appendRect()
250 pImpl->cubicTo(x + w, y + h - ry + hry, x + w - rx + hrx, y + h, x + w - rx, y + h); in appendRect()
251 pImpl->lineTo(x + rx, y + h); in appendRect()
252 pImpl->cubicTo(x + rx - hrx, y + h, x, y + h - ry + hry, x, y + h - ry); in appendRect()
253 pImpl->lineTo(x, y + ry); in appendRect()
254 pImpl->cubicTo(x, y + ry - hry, x + rx - hrx, y, x + rx, y); in appendRect()
255 pImpl->close(); in appendRect()
258 pImpl->flag |= RenderUpdateFlag::Path; in appendRect()
264 Result Shape::fill(uint8_t r, uint8_t g, uint8_t b, uint8_t a) noexcept in fill() argument
266 if (pImpl->rs.fill) { in fill()
267 delete(pImpl->rs.fill); in fill()
268 pImpl->rs.fill = nullptr; in fill()
269 pImpl->flag |= RenderUpdateFlag::Gradient; in fill()
272 …if (r == pImpl->rs.color[0] && g == pImpl->rs.color[1] && b == pImpl->rs.color[2] && a == pImpl->r… in fill()
274 pImpl->rs.color[0] = r; in fill()
275 pImpl->rs.color[1] = g; in fill()
276 pImpl->rs.color[2] = b; in fill()
277 pImpl->rs.color[3] = a; in fill()
278 pImpl->flag |= RenderUpdateFlag::Color; in fill()
289 if (pImpl->rs.fill && pImpl->rs.fill != p) delete(pImpl->rs.fill); in fill()
290 pImpl->rs.fill = p; in fill()
291 pImpl->flag |= RenderUpdateFlag::Gradient; in fill()
297 Result Shape::fillColor(uint8_t* r, uint8_t* g, uint8_t* b, uint8_t* a) const noexcept in fillColor() argument
299 pImpl->rs.fillColor(r, g, b, a); in fillColor()
307 return pImpl->rs.fill; in fill()
313 pImpl->strokeFirst(strokeFirst); in order()
320 pImpl->strokeWidth(width); in stroke()
327 return pImpl->rs.strokeWidth(); in strokeWidth()
331 Result Shape::stroke(uint8_t r, uint8_t g, uint8_t b, uint8_t a) noexcept in stroke() argument
333 pImpl->strokeColor(r, g, b, a); in stroke()
338 Result Shape::strokeColor(uint8_t* r, uint8_t* g, uint8_t* b, uint8_t* a) const noexcept in strokeColor() argument
340 if (!pImpl->rs.strokeColor(r, g, b, a)) return Result::InsufficientCondition; in strokeColor()
348 return pImpl->strokeFill(std::move(f)); in stroke()
354 return pImpl->rs.strokeFill(); in strokeFill()
360 return pImpl->strokeDash(dashPattern, cnt, 0); in stroke()
366 return pImpl->rs.strokeDash(dashPattern, nullptr); in strokeDash()
372 pImpl->strokeCap(cap); in stroke()
379 pImpl->strokeJoin(join); in stroke()
387 // - A negative value for stroke-miterlimit must be treated as an illegal value. in strokeMiterlimit()
390 pImpl->strokeMiterlimit(miterlimit); in strokeMiterlimit()
397 return pImpl->rs.strokeCap(); in strokeCap()
403 return pImpl->rs.strokeJoin(); in strokeJoin()
409 return pImpl->rs.strokeMiterlimit(); in strokeMiterlimit()
415 pImpl->strokeTrim(begin, end, simultaneous); in strokeTrim()
420 Result Shape::fill(FillRule r) noexcept in fill() argument
422 pImpl->rs.rule = r; in fill()
430 return pImpl->rs.rule; in fillRule()