MCPcopy Create free account
hub / github.com/TruthHun/BookStack / writeDHT

Function writeDHT

static/webuploader/webuploader.js:6005–6041  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6003 }
6004
6005 function writeDHT()
6006 {
6007 writeWord(0xFFC4); // marker
6008 writeWord(0x01A2); // length
6009
6010 writeByte(0); // HTYDCinfo
6011 for (var i=0; i<16; i++) {
6012 writeByte(std_dc_luminance_nrcodes[i+1]);
6013 }
6014 for (var j=0; j<=11; j++) {
6015 writeByte(std_dc_luminance_values[j]);
6016 }
6017
6018 writeByte(0x10); // HTYACinfo
6019 for (var k=0; k<16; k++) {
6020 writeByte(std_ac_luminance_nrcodes[k+1]);
6021 }
6022 for (var l=0; l<=161; l++) {
6023 writeByte(std_ac_luminance_values[l]);
6024 }
6025
6026 writeByte(1); // HTUDCinfo
6027 for (var m=0; m<16; m++) {
6028 writeByte(std_dc_chrominance_nrcodes[m+1]);
6029 }
6030 for (var n=0; n<=11; n++) {
6031 writeByte(std_dc_chrominance_values[n]);
6032 }
6033
6034 writeByte(0x11); // HTUACinfo
6035 for (var o=0; o<16; o++) {
6036 writeByte(std_ac_chrominance_nrcodes[o+1]);
6037 }
6038 for (var p=0; p<=161; p++) {
6039 writeByte(std_ac_chrominance_values[p]);
6040 }
6041 }
6042
6043 function writeSOS()
6044 {

Callers 1

JPEGEncoderFunction · 0.70

Calls 2

writeWordFunction · 0.70
writeByteFunction · 0.70

Tested by

no test coverage detected