Lines Matching defs:SkPoint

152 struct SkPoint;
154 /** SkVector provides an alternative name for SkPoint. SkVector and SkPoint can
157 typedef SkPoint SkVector;
159 /** \struct SkPoint
160 SkPoint holds two 32-bit floating point coordinates.
162 struct SK_API SkPoint {
166 /** Writes text representation of SkPoint to string.
173 /** Sets fX to x, fY to y. Used both to set SkPoint and vector.
175 @param x SkScalar x-axis value of constructed SkPoint or vector
176 @param y SkScalar y-axis value of constructed SkPoint or vector
177 @return SkPoint (x, y)
179 static constexpr SkPoint Make(SkScalar x, SkScalar y) {
183 /** Returns x-axis value of SkPoint or vector.
189 /** Returns y-axis value of SkPoint or vector.
242 void setAbs(const SkPoint& pt) {
247 /** Adds offset to each SkPoint in points array with count entries.
249 @param points SkPoint array
253 static void Offset(SkPoint points[], int count, const SkVector& offset) {
257 /** Adds offset (dx, dy) to each SkPoint in points array of length count.
259 @param points SkPoint array
264 static void Offset(SkPoint points[], int count, SkScalar dx, SkScalar dy) {
270 /** Adds offset (dx, dy) to SkPoint.
288 SkScalar length() const { return SkPoint::Length(fX, fY); }
346 /** Sets dst to SkPoint times scale. dst may be SkPoint to modify SkPoint in place.
348 @param scale factor to multiply SkPoint by
349 @param dst storage for scaled SkPoint
353 void scale(SkScalar scale, SkPoint* dst) const;
355 /** Scales SkPoint in place by scale.
357 @param value factor to multiply SkPoint by
368 /** Returns SkPoint changing the signs of fX and fY.
370 @return SkPoint as (-fX, -fY)
372 SkPoint operator-() const {
376 /** Adds vector v to SkPoint. Sets SkPoint to: (fX + v.fX, fY + v.fY).
385 /** Subtracts vector v from SkPoint. Sets SkPoint to: (fX - v.fX, fY - v.fY).
394 /** Returns SkPoint multiplied by scale.
397 @return SkPoint as (fX * scale, fY * scale)
399 SkPoint operator*(SkScalar scale) const {
403 /** Multiplies SkPoint by scale. Sets SkPoint to: (fX * scale, fY * scale).
406 @return reference to SkPoint
408 SkPoint& operator*=(SkScalar scale) {
431 /** Returns true if SkPoint is equivalent to SkPoint constructed from (x, y).
435 @return true if SkPoint equals (x, y)
443 @param a SkPoint to compare
444 @param b SkPoint to compare
447 friend bool operator==(const SkPoint& a, const SkPoint& b) {
453 @param a SkPoint to compare
454 @param b SkPoint to compare
457 friend bool operator!=(const SkPoint& a, const SkPoint& b) {
463 Can also be used to subtract vector from SkPoint, returning SkPoint.
466 @param a SkPoint to subtract from
467 @param b SkPoint to subtract
470 friend SkVector operator-(const SkPoint& a, const SkPoint& b) {
474 /** Returns SkPoint resulting from SkPoint a offset by vector b, computed as:
477 Can also be used to offset SkPoint b by vector a, returning SkPoint.
480 @param a SkPoint or vector to add to
481 @param b SkPoint or vector to add
482 @return SkPoint equal to a offset by b
484 friend SkPoint operator+(const SkPoint& a, const SkVector& b) {
523 static SkScalar Distance(const SkPoint& a, const SkPoint& b) {