This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {parse as parseSVG} from "./nanosvg.js" | |
let svg = fs.readFileSync(svg_url).toString(); | |
let res = parseSVG(svg,"mm",72); | |
let canvas = document.getElementById("canvas"); | |
let ctx = canvas.getContext("2d"); | |
for (let shape = shapes; shape != null; shape = shape.next) { | |
if(shape.fill.type==1) | |
{ | |
let color = shape.fill.color; | |
let r = Number(color&0xff); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
#include "esp_jpeg_enc.h" | |
int esp_jpeg_enc_demo1() | |
{ | |
/// configure encoder | |
jpeg_enc_info_t info = DEFAULT_JPEG_ENC_CONFIG(); | |
info.quality = 80; | |
info.src_type = JPEG_RAW_TYPE_RGB888; | |
/// allocate input buffer to fill original image stream. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install liblz4-tool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"build": { | |
"arduino":{ | |
"ldscript": "esp32s3_out.ld", | |
"partitions": "default_8MB.csv", | |
"memory_type": "qio_opi" | |
}, | |
"core": "esp32", | |
"extra_flags": [ | |
"-DARDUINO_ESP32S3_DEV", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var Jimp = require('jimp'); | |
var Bitmap = require('./types/Bitmap'); | |
var Curve = require('./types/Curve'); | |
var Point = require('./types/Point'); | |
var Path = require('./types/Path'); | |
var Quad = require('./types/Quad'); | |
var Sum = require('./types/Sum'); | |
var Opti = require('./types/Opti'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <node.h> | |
using v8::FunctionCallbackInfo; | |
using v8::Isolate; | |
using v8::Local; | |
using v8::Object; | |
using v8::String; | |
using v8::Value; | |
void Method(const FunctionCallbackInfo<Value> &args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
#include <HWCDC.h> | |
#include "math.h" | |
#include "SPI.h" | |
HWCDC USBSerial; | |
SPIClass spi = SPIClass(FSPI); | |
#include "SdFat.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "math.h" | |
#include "FS.h" | |
#include "SD_MMC.h" | |
void testFileIO(fs::FS &fs, const char *path, uint32_t buffSize, uint32_t numMB) | |
{ | |
uint8_t *buff = (uint8_t *)ps_malloc(buffSize); | |
File file = fs.open(path, FILE_WRITE); | |
if (file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo host > /sys/devices/platform/soc/1c13000.usb/musb-hdrc.1.auto/mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let buf = []; | |
let binhex = u8g2.getBufferPtr(); | |
while (y < height) { | |
let ym = 1 << (y % 8); // Bitmask | |
let bp = width * (y >> 3); // Start pointer of the row | |
let x = 0; | |
while (x < width) { | |
let d = 0; | |
if (binhex[bp+7] & ym) d |= 0x80; | |
if (binhex[bp+6] & ym) d |= 0x40; |
NewerOlder