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