Commit dbb7dccf authored by wang's avatar wang

ws 测试

parent daa15b36
// const canvas = require('canvas')
//
// let c = new canvas.Canvas(96,96)
// let d = c.getContext('2d')
// console.log(c, d)
// d.font = '94px sans-serif'
// d.fillStyle = '#000'
// d.fillText('☕️', -1, 96)
// console.log('☕️')
// console.log(d.getImageData(40, 51, 1, 1))
//
// console.log(c.toDataURL())
let emojis = new Proxy({}, {
get(target, p, receiver) {
if (target.hasOwnProperty(p) === false){
Reflect.set(target, p, {});
}
return Reflect.get(target, p, receiver)
}
})
emojis['👨‍🚀'][`${[53, 46, 1, 1]+''}`] = [215, 159, 32, 255]
emojis['👨‍🚀'][`${[55, 42, 1, 1]+''}`] = [189, 139, 67, 255]
emojis['👨‍🚀'][`${[53, 54, 1, 1]+''}`] = [240, 231, 177, 255]
emojis['👨‍🚀'][`${[55, 41, 1, 1]+''}`] = [171, 130, 80, 255]
emojis['🚵'][`${[55, 52, 1, 1]+''}`] = [101, 101, 101, 255]
emojis['🚵'][`${[44, 54, 1, 1]+''}`] = [152, 89, 5, 255]
emojis['🚵'][`${[56, 39, 1, 1]+''}`] = [77, 77, 77, 255]
emojis['🚵'][`${[55, 52, 1, 1]+''}`] = [101, 101, 101, 255]
emojis['👩‍👩‍👧'][`${[44, 40, 1, 1]+''}`] = [134, 157, 177, 255]
emojis['👩‍👩‍👧'][`${[45, 54, 1, 1]+''}`] = [117, 151, 181, 255]
emojis['🥘'][`${[53, 46, 1, 1]+''}`] = [239, 164, 46, 255]
emojis['🥘'][`${[55, 42, 1, 1]+''}`] = [241, 156, 42, 255]
emojis['🗺️'][`${[42, 49, 1, 1]+''}`] = [72, 137, 174, 255]
emojis['🗺️'][`${[45, 54, 1, 1]+''}`] = [168, 153, 100, 255]
emojis['🧭'][`${[58, 53, 1, 1]+''}`] = [183, 80, 86, 255]
emojis['🧭'][`${[55, 52, 1, 1]+''}`] = [215, 2, 1, 255]
emojis['🥙'][`${[38, 38, 1, 1]+''}`] = [193, 177, 85, 255]
emojis['🥙'][`${[56, 39, 1, 1]+''}`] = [227, 86, 82, 255]
emojis['🦪'][`${[44, 40, 1, 1]+''}`] = [129, 113, 95, 255]
emojis['🦪'][`${[53, 54, 1, 1]+''}`] = [170, 156, 134, 255]
emojis['🧶'][`${[56, 39, 1, 1]+''}`] = [249, 104, 14, 255]
emojis['🧶'][`${[53, 46, 1, 1]+''}`] = [243, 99, 12, 255]
emojis['🪔'][`${[58, 53, 1, 1]+''}`] = [135, 43, 20, 255]
emojis['🪔'][`${[53, 46, 1, 1]+''}`] = [129, 47, 38, 87]
emojis['🦚'][`${[40, 51, 1, 1]+''}`] = [60, 145, 97, 255]
emojis['🦚'][`${[55, 52, 1, 1]+''}`] = [45, 68, 89, 253]
emojis['👹'][`${[52, 51, 1, 1]+''}`] = [208, 51, 39, 255]
emojis['👹'][`${[42, 49, 1, 1]+''}`] = [253, 92, 55, 255]
emojis['🌌'][`${[53, 54, 1, 1]+''}`] = [48, 79, 143, 255]
emojis['🌌'][`${[42, 49, 1, 1]+''}`] = [36, 61, 100, 255]
emojis['☕'][`${[40, 51, 1, 1]+''}`] = [69, 52, 39, 255]
emojis['☕'][`${[52, 57, 1, 1]+''}`] = [51, 34, 22, 255]
emojis['🌞'][`${[44, 40, 1, 1]+''}`] = [255, 207, 83, 255]
emojis['🌞'][`${[39, 47, 1, 1]+''}`] = [224, 143, 7, 255]
emojis['🐻‍❄️'][`${[52, 57, 1, 1]+''}`] = [230, 231, 232, 255]
emojis['🐻‍❄️'][`${[40, 51, 1, 1]+''}`] = [244, 244, 245, 255]
emojis['👰‍'][`${[58, 39, 1, 1]+''}`] = [232, 172, 28, 255]
emojis['👰‍'][`${[42, 52, 1, 1]+''}`] = [255, 204, 49, 255]
emojis['😎'][`${[18, 90, 1, 1]+''}`] = [214, 122, 6, 255]
emojis['6️⃣'][`${[38, 77, 1, 1]+''}`] = [255, 255, 255, 255]
emojis['🍼'][`${[48, 28, 1, 1]+''}`] = [0, 0, 0, 0]
emojis['🏴󠁧󠁢󠁥󠁮󠁧󠁿'][`${[94, 23, 1, 1]+''}`] = [0, 0, 0, 0]
emojis['📊'][`${[26, 46, 1, 1]+''}`] = [253, 243, 245, 255]
emojis['🏴󠁧󠁢󠁥󠁮󠁧󠁿'][`${[47, 23, 1, 1]+''}`] = [0,0,0,0]
emojis['㊗️'][`${[37, 17, 1, 1]+''}`] = [0, 0, 0, 255]
emojis['⛎'][`${[62, 28, 1, 1]+''}`] = [204, 131, 217, 255]
console.log(Object.keys(emojis).length)
console.log(emojis)
let emojiRes = {};
let aaa = Object.keys(emojis);
for (let i = 0; i < aaa.length; i++) {
let args = aaa[i];
var c = document.createElement('canvas');
c.height = 96;
c.width = 96;
let d = c.getContext('2d')
d.font = '94px sans-serif'
d.fillStyle = '#000'
let argss = args.split(',')
let argv = [argss[0], parseInt(argss[1]), parseInt(argss[1])];
console.log(argv)
d.fillText(argss[0], parseInt(argss[1]), parseInt(argss[1]))
emojiRes[args] = {}
c.toDataURL();
let inArgs = Object.keys(emojis[args]);
for (let i = 0; i < inArgs.length; i++) {
let nums = inArgs[i]
let num = nums.split(',').map(e=>parseInt(e))
emojiRes[args][nums] = d.getImageData(num[0], num[1], num[2], num[3]).data+''
}
}
console.log(emojiRes)
\ No newline at end of file
git pull
docker build -t lcc-ws-brush .
docker rm -f lcc-ws-test
docker run -itd --name lcc-ws-test --cpus=2 -m 2G lcc-ws-brush
\ No newline at end of file
docker run -itd --name lcc-ws-test --cpus=4 -m 4G lcc-ws-brush
\ No newline at end of file
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment