I wan't to translate some code from JS to C# but can't really imagine one part...
function getHisto(pixels) {
var histosize = 1 << (3 * sigbits),
histo = new Array(histosize),
index, rval, gval, bval;
pixels.forEach(function(pixel) {
rval = pixel[0] >> rshift;
gval = pixel[1] >> rshift;
bval = pixel[2] >> rshift;
index = getColorIndex(rval, gval, bval);
histo[index] = (histo[index] || 0) + 1;
});
return histo;
}
what exactly have can I expect from histo[]? I don't understand that line:
histo[index] = (histo[index] || 0) + 1;
If you need any additional information I'll try to give it.
Edit 1: I specifically meant histo[index] || 0