mirror of
https://github.com/javl/image2cpp.git
synced 2026-09-12 09:33:07 +00:00
Merge branch 'master' into gh-pages
This commit is contained in:
+7
-2
@@ -542,14 +542,19 @@
|
|||||||
input = input.replace(/const unsigned char myBitmap \[\] PROGMEM = \{/g, "");
|
input = input.replace(/const unsigned char myBitmap \[\] PROGMEM = \{/g, "");
|
||||||
input = input.replace(/\};/g, "");
|
input = input.replace(/\};/g, "");
|
||||||
|
|
||||||
// Remove newlines
|
// Convert newlines to comma (helps to remove comments later)
|
||||||
input = input.replace(/\r\n|\r|\n/g, "");
|
input = input.replace(/\r\n|\r|\n/g, ",");
|
||||||
|
// Convert multiple commas in a row into a single one
|
||||||
|
input = input.replace(/,{2,}/g, ",");
|
||||||
// Remove whitespace
|
// Remove whitespace
|
||||||
input = input.replace(/\s/g, "");
|
input = input.replace(/\s/g, "");
|
||||||
|
//Remove comments
|
||||||
|
input = input.replace(/\/\/(.+?),/g, "");
|
||||||
// Remove "0x"
|
// Remove "0x"
|
||||||
input = input.replace(/0x/g, "");
|
input = input.replace(/0x/g, "");
|
||||||
// Split into list
|
// Split into list
|
||||||
var list = input.split(",");
|
var list = input.split(",");
|
||||||
|
console.log(list);
|
||||||
|
|
||||||
if(drawMode == 'horizontal'){
|
if(drawMode == 'horizontal'){
|
||||||
listToImageHorizontal(list, canvas);
|
listToImageHorizontal(list, canvas);
|
||||||
|
|||||||
Reference in New Issue
Block a user