MCPcopy Index your code
hub / github.com/plotly/plotly.js / correctRGB

Function correctRGB

src/plots/gl3d/scene.js:1073–1088  ·  view source on GitHub ↗
(pixels, w, h)

Source from the content-addressed store, hash-verified

1071}
1072
1073function correctRGB(pixels, w, h) {
1074 for(var i = 0; i < h; ++i) {
1075 for(var j = 0; j < w; ++j) {
1076 var k = 4 * (w * i + j);
1077
1078 var a = pixels[k + 3]; // alpha
1079 if(a > 0) {
1080 var q = 255 / a;
1081
1082 for(var l = 0; l < 3; ++l) { // RGB
1083 pixels[k + l] = Math.min(q * pixels[k + l], 255);
1084 }
1085 }
1086 }
1087 }
1088}
1089
1090proto.toImage = function(format) {
1091 var scene = this;

Callers 1

scene.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…