#!/bin/node

const fs = require('fs')

const fileContents = fs.readFileSync('./icon.h').toString()

let arr = fileContents.split('static unsigned char header_data[] = {');
let imgcode = arr[1].replace('};','').replace('\n','').replace('\t','')
let str = imgcode.split(',')

let charWidth = 32

let output = []
let cur = 0;
let idx = 0;
let line = 0;
for(let e of str){
    if(idx >=8){
        idx = 0;
        output.push('0x'+cur.toString(16)+',')
        ++line;
        cur = 0;
        if(line >= 9){
            output.push('\n');
            line = 0;
        }
    }
    if(e == 0){
        cur |= (0x1 << (7-idx));
    }
    ++idx;

}
idx = 0;
output.push('0x'+cur.toString(16)+',')


console.log(output.join(''))