Sha256: 05541d0d2e545ee76ce4ebcd385435349cbcc437dc08b92d6f093ec9c48db168
Contents?: true
Size: 989 Bytes
Versions: 11
Compression:
Stored size: 989 Bytes
Contents
package toxi.processing; import toxi.color.ReadonlyTColor; import toxi.color.ToneMap; import toxi.geom.Vec3D; /** * * @author tux */ public class DeltaOrientationMapper implements NormalMapper { /** * */ protected Vec3D dir; /** * */ protected ToneMap toneMap; /** * */ protected double toneScale; /** * * @param dir * @param toneMap */ public DeltaOrientationMapper(Vec3D dir, ToneMap toneMap) { this.dir = dir; setToneMap(toneMap); } /** * * @param normal * @return */ @Override public ReadonlyTColor getRGBForNormal(Vec3D normal) { float dot = (float) (dir.dot(normal) * toneScale + toneScale); return toneMap.getToneFor(dot); } /** * * @param toneMap */ public final void setToneMap(ToneMap toneMap) { this.toneMap = toneMap; this.toneScale = toneMap.map.getInputMedian(); } }
Version data entries
11 entries across 11 versions & 1 rubygems