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

Method prewitt

src_generators/normalmapgenerator.cpp:129–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129QVector3D NormalmapGenerator::prewitt(const double convolution_kernel[3][3], double strengthInv) const {
130 const double top_side = convolution_kernel[0][0] + convolution_kernel[0][1] + convolution_kernel[0][2];
131 const double bottom_side = convolution_kernel[2][0] + convolution_kernel[2][1] + convolution_kernel[2][2];
132 const double right_side = convolution_kernel[0][2] + convolution_kernel[1][2] + convolution_kernel[2][2];
133 const double left_side = convolution_kernel[0][0] + convolution_kernel[1][0] + convolution_kernel[2][0];
134
135 const double dY = right_side - left_side;
136 const double dX = top_side - bottom_side;
137 const double dZ = strengthInv;
138
139 return QVector3D(dX, dY, dZ).normalized();
140}
141
142int NormalmapGenerator::handleEdges(int iterator, int maxValue) const {
143 if(iterator >= maxValue) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected