From 9abb220f359c49eb546db8c214f882c5b50febd1 Mon Sep 17 00:00:00 2001 From: Vincent Date: Mon, 8 Jan 2024 18:52:20 -0400 Subject: [PATCH] cleanup --- Makefile | 6 +++--- README.md | 21 ++++++++++++--------- main.c => gcode-preview.c | 0 3 files changed, 15 insertions(+), 12 deletions(-) rename main.c => gcode-preview.c (100%) diff --git a/Makefile b/Makefile index ef6733d..a8911d9 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -SRC = main.c Turbo-Base64/turbob64d.c +SRC = gcode-preview.c Turbo-Base64/turbob64d.c OBJ = ${SRC:.c=.o} all: options gcode-preview @@ -14,10 +14,10 @@ options: ${CC} -c ${CFLAGS} $< gcode-preview: ${OBJ} - ${CC} -o $@ main.o turbob64d.o ${LDFLAGS} + ${CC} -o $@ gcode-preview.o turbob64d.o ${LDFLAGS} clean: - rm -f gcode-preview main.o turbob64d.o + rm -f gcode-preview gcode-preview.o turbob64d.o install: all mkdir -p ${DESTDIR}${PREFIX}/bin diff --git a/README.md b/README.md index 9f9ccbf..82e9c3c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ gcode-preview ============= -Extract images as png/jpg from .gcode files with C or Bash +Extract thumbnail images as png/jpg from .gcode files with C or Bash Building and installing the C version @@ -10,30 +10,33 @@ Building and installing the C version 1. clone this repository locally on your machine 2. run `make clean && sudo make install` from within the repository folder +Example usage +------------- + +`gcode-preview -i benchy.gcode -o thumb.png` + +`gcode-preview-bash benchy.gcode thumb.png` + Performance ----------- Quick benchmark of `gcode-preview` vs `gcode-preview-bash` extracting a 800x600 png image from a gcode file: -`gcode-preview-bash`: ``` +$ time gcode-preview-bash benchy.gcode thumb.png + real 0m0.014s user 0m0.016s sys 0m0.004s ``` -`gcode-preview`: ``` +$ time gcode-preview benchy.gcode thumb.png + real 0m0.002s user 0m0.001s sys 0m0.000s ``` -Example usage -------------- - -`gcode-preview -i benchy.gcode -o thumb.png` - -`gcode-preview-bash benchy.gcode thumb.png` Ranger / lf integration ----------------------- diff --git a/main.c b/gcode-preview.c similarity index 100% rename from main.c rename to gcode-preview.c