MCPcopy Create free account
hub / github.com/Theverat/NormalmapGenerator / mapComponent

Method mapComponent

src_generators/normalmapgenerator.cpp:163–165  ·  view source on GitHub ↗

transform -1..1 to 0..255

Source from the content-addressed store, hash-verified

161
162//transform -1..1 to 0..255
163int NormalmapGenerator::mapComponent(double value) const {
164 return (value + 1.0) * (255.0 / 2.0);
165}
166
167//uses a similar algorithm like "soft light" in PS,
168//see http://www.michael-kreil.de/algorithmen/photoshop-layer-blending-equations/index.php

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected