Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tditlu committed Sep 21, 2020
0 parents commit 20a49a0
Show file tree
Hide file tree
Showing 18 changed files with 11,865 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bin
obj
test
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (C) 2020 Daniel Gerdgren

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
27 changes: 27 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
TARGET = shadertabler

CC = gcc
CFLAGS = -Wall -Werror -O0 -Wno-unused-function

SRCDIR = src
OBJDIR = obj
BINDIR = bin

SOURCES := $(wildcard $(SRCDIR)/exoquant/*.c) $(wildcard $(SRCDIR)/lodepng/*.c) $(wildcard $(SRCDIR)/cwalk/*.c) $(wildcard $(SRCDIR)/*.c)
INCLUDES := $(wildcard $(SRCDIR)/exoquant/*.h) $(wildcard $(SRCDIR)/lodepng/*.h) $(wildcard $(SRCDIR)/cwalk/*.h) $(wildcard $(SRCDIR)/*.h)
OBJECTS := $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o)

all: $(BINDIR)/$(TARGET)

$(BINDIR)/$(TARGET): $(OBJECTS)
@mkdir -p $(dir $@)
@$(CC) $(CFLAGS) $(OBJECTS) -o $@

$(OBJDIR)/%.o: $(SRCDIR)/%.c $(INCLUDES)
@mkdir -p $(dir $@)
@$(CC) $(CFLAGS) -c $< -o $@

.PHONY: clean

clean:
@rm -rf $(OBJDIR) $(BINDIR)
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# ShadeTabler
Shade Table Generator by Todi / Tulou.

Developed and distributed under the terms of the [MIT license](./LICENSE).

## Building

In a Unix-like environment simply `make` the binary.

## Usage

shadetabler -o <output directory> <additional options> <input files...>

Available options are:

-o, --output Output directory. (Required)
-v, --verbose Verbose output.
-f, --force Overwrite existing files, never prompt.
-c, --colors [2-256] Number of colors saved in the output file. (Default 256)
-s, --shades [2-256] Number of shades in shade table. (Default 64)
-t, --type [light|dark|both] Number of shades in shade table. (Default "light")
-h, --hq High quality quantization quality.
-r, --reserve Reserve colors for black and white.
-l, --light Light shade table filename. (Default "shadetable_light.png")
-d, --dark Dark shade table filename. (Default "shadetable_dark.png")

Examples:

shadetabler -v -r -c 256 -s 64 texture1.png -o ./shadetables
shadetabler texture1.png texture2.png texture3.png -o ./shadetables
shadetabler -f -c 64 -s 32 -r -hq texture1.png -d shadetable.png -o ./shadetables

## Acknowledgments
ShadeTabler uses the following libraries:

* [LodePNG](https://lodev.org/lodepng/) by Lode Vandevenne
* [ExoQuant](/~https://github.com/exoticorn/exoquant/) by Dennis Ranke
23 changes: 23 additions & 0 deletions src/cwalk/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
libcwalk - path library for C/C++

MIT License

Copyright (c) 2020 Leonard Iklé

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 20a49a0

Please sign in to comment.