jsjpeg.js
/**
 * Implements the RECEIVE function to read a sequence of bits
 * 
 * F.2.2.4
 * 
 * @param {DataViewReader} reader Data source
 * @param {*} img Struct with information about the image, including frame + components
 * @param {*} ssss Number of bits to read
 */
Implements the RECEIVE function to read a sequence of bits



@param {DataViewReader} reader Data source
@param {*} img Struct with information about the image, including frame + components
@param {*} ssss Number of bits to read
Implements the RECEIVE function to read a sequence of bits @param { DataViewReader } reader Data source @param { * } img Struct with information about the image including frame + components @param { * } ssss Number of bits to read
function receive(reader, img, ssss) {
    let v = 0;
    for (let i = 0; i < ssss; i++) {
        v = (v << 1) + reader.nextBit(img);
    }
    return v;
}
function receive ( reader , img , ssss ) { let v = 0 ; for ( let i = 0 ; i < ssss ; i ++ ) { v = ( v << 1 ) + reader . nextBit ( img ) ; } return v ; }
Implements the RECEIVE function to read a sequence of bits
Implements the RECEIVE function to read a sequence of bits