static constexpr auto kAmbientHeightFactor = 1.0f / 128.0f; static constexpr auto kAmbientGeomFactor = 64.0f; // Assuming that we have a light height of 600 for the spot shadow, // the spot values will reach their maximum at a height of approximately 292.3077. // We'll round up to 300 to keep it simple. static constexpr auto kMaxAmbientRadius = 300*kAmbientHeightFactor*kAmbientGeomFactor;
staticinlinefloat divide_and_pin(float numer, float denom, float min, float max) { float result = SkTPin(sk_ieee_float_divide(numer, denom), min, max); // ensure that SkTPin handled non-finites correctly
SkASSERT(result >= min && result <= max); return result;
}
// Create the transformation to apply to a path to get its base shadow outline, given the light // parameters and the path's 3D transformation (given by ctm and zPlaneParams). // Also computes the blur radius to apply the transformed outline. bool GetSpotShadowTransform(const SkPoint3& lightPos, SkScalar lightRadius, const SkMatrix& ctm, const SkPoint3& zPlaneParams, const SkRect& pathBounds, bool directional,
SkMatrix* shadowTransform, SkScalar* radius);
// get bounds prior to the ctm being applied void GetLocalBounds(const SkPath&, const SkDrawShadowRec&, const SkMatrix& ctm, SkRect* bounds);
} // namespace SkDrawShadowMetrics
#endif
Messung V0.5
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.