Lines Matching defs:norm
240 static inline void norm_to_rgb(SkBitmap* bm, int x, int y, const SkVector3& norm) {
241 SkASSERT(SkScalarNearlyEqual(norm.length(), 1.0f));
242 unsigned char r = static_cast<unsigned char>((0.5f * norm.fX + 0.5f) * 255);
243 unsigned char g = static_cast<unsigned char>((-0.5f * norm.fY + 0.5f) * 255);
244 unsigned char b = static_cast<unsigned char>((0.5f * norm.fZ + 0.5f) * 255);
253 SkVector3 norm;
257 norm.fX = (x + 0.5f - center.fX) / halfSize.fX;
258 norm.fY = (y + 0.5f - center.fY) / halfSize.fY;
260 SkScalar tmp = norm.fX * norm.fX + norm.fY * norm.fY;
262 norm.set(0.0f, 0.0f, 1.0f);
264 norm.fZ = sqrtf(1.0f - tmp);
267 norm_to_rgb(bm, x, y, norm);
279 SkPoint3 norm;
288 norm.set(0.0f, 0.0f, 1.0f);
295 norm = locX >= locY ? right : down; // LR corner
297 norm = locX > -locY ? right : up; // UR corner
301 norm = -locX > locY ? left : down; // LL corner
303 norm = locX > locY ? up : left; // UL corner
308 norm_to_rgb(bm, x, y, norm);
319 SkPoint3 norm;
331 norm = locX >= locY ? rightUp : down; // LR corner
333 norm = rightUp;
337 norm = -locX > locY ? leftUp : down; // LL corner
339 norm = leftUp;
343 norm_to_rgb(bm, x, y, norm);