mirror of
https://frontier.innolan.net/github/AmigaExamples.git
synced 2025-11-24 00:15:53 +00:00
Fixed some tests, renamed override-palette option in imagecon
This commit is contained in:
@ -14,7 +14,7 @@ $(SHARED_PALETTE): $(IMAGEFILE) $(TC_IMAGEFILE)
|
||||
$(IMAGECON) --input $(IMAGEFILE),$(TC_IMAGEFILE) --output $(SHARED_PALETTE_BASE) --colors 32 --quantize --output-palette
|
||||
|
||||
$(IMAGEDATA): $(IMAGECON) $(IMAGEFILE) $(SHARED_PALETTE)
|
||||
$(IMAGECON) --input $(IMAGEFILE) --output out/image --output-bitplanes --output-copperlist --override-palette $(SHARED_PALETTE)
|
||||
$(IMAGECON) --input $(IMAGEFILE) --output out/image --output-bitplanes --output-copperlist --use-palette $(SHARED_PALETTE)
|
||||
|
||||
$(TC_IMAGEDATA): $(IMAGECON) $(TC_IMAGEFILE) $(SHARED_PALETTE)
|
||||
$(IMAGECON) --input $(TC_IMAGEFILE) --output out/tc --output-bitplanes --output-mask --output-copperlist --override-palette $(SHARED_PALETTE)
|
||||
$(IMAGECON) --input $(TC_IMAGEFILE) --output out/tc --output-bitplanes --output-mask --output-copperlist --use-palette $(SHARED_PALETTE)
|
||||
|
||||
Binary file not shown.
10
Makefile
10
Makefile
@ -1,4 +1,12 @@
|
||||
SUBDIRS=tools/makeadf tools/imagecon 000.trackdisk 001.simple_image 002.sprite_display 003.music 004.copper_bars 005.copper_vert
|
||||
SUBDIRS=tools/makeadf \
|
||||
tools/imagecon\
|
||||
000.trackdisk\
|
||||
001.simple_image\
|
||||
002.sprite_display\
|
||||
003.music\
|
||||
004.copper_bars\
|
||||
005.copper_vert\
|
||||
006.simple_blit
|
||||
|
||||
.PHONY: subdirs $(SUBDIRS)
|
||||
|
||||
|
||||
@ -2,10 +2,18 @@ IMAGECON=./out/imagecon
|
||||
OBJS=out/imagecon.o out/png.o
|
||||
HOST_WARNINGS=-pedantic-errors -Wfatal-errors -Wall -Werror -Wextra -Wno-unused-parameter -Wshadow -limagequant
|
||||
HOST_CFLAGS=$(HOST_WARNINGS)
|
||||
LIBS=-lpng -limagequant
|
||||
|
||||
# test stuff
|
||||
OUTPUT_BASE=out/mission-beach
|
||||
REFERENCE_BASE=reference/mission-beach
|
||||
TEST_IMAGE=../../assets/mission-beach.png
|
||||
LIBS=-lpng -limagequant
|
||||
TEST_IMAGE2=../../assets/tc.png
|
||||
SHARED_BASE=out/shared
|
||||
REFERENCE_SHARED_BASE=reference/shared
|
||||
REFERENCE_SHARED_PALETTE=$(REFERENCE_SHARED_BASE).pal
|
||||
SHARED_PALETTE=$(SHARED_BASE).pal
|
||||
USED_PALETTE=$(SHARED_BASE).bin $(SHARED_BASE)-copper-list.s
|
||||
|
||||
$(IMAGECON): out bin $(OBJS)
|
||||
gcc $(OBJS) -o $(IMAGECON) $(LIBS)
|
||||
@ -23,14 +31,31 @@ out:
|
||||
bin:
|
||||
mkdir bin
|
||||
|
||||
out/mission-beach.bin: $(IMAGECON)
|
||||
-rm -f $(OUTPUT_BASE).bin $(OUTPUT_BASE)-copper-list.s
|
||||
$(IMAGECON) --input $(TEST_IMAGE) --output $(OUTPUT_BASE) --output-copperlist --output-bitplanes --colors 32 --quantize
|
||||
$(USED_PALETTE): $(SHARED_PALETTE)
|
||||
$(IMAGECON) --input $(TEST_IMAGE),$(TEST_IMAGE2) --output $(SHARED_BASE) --colors 32 --quantize --output-bitplanes --output-copperlist
|
||||
|
||||
test: $(IMAGECON) $(OUTPUT_BASE).bin
|
||||
$(SHARED_PALETTE): $(IMAGECON)
|
||||
-rm -f $(SHARED_PALETTE)
|
||||
$(IMAGECON) --input $(TEST_IMAGE),$(TEST_IMAGE2) --output $(SHARED_BASE) --colors 32 --quantize --output-palette
|
||||
|
||||
$(OUTPUT_BASE).bin: $(IMAGECON)
|
||||
-rm -f $(OUTPUT_BASE).bin $(OUTPUT_BASE)-copper-list.s $(OUTPUT_BASE)-mask.bin
|
||||
$(IMAGECON) --input $(TEST_IMAGE) --output $(OUTPUT_BASE) --output-mask --output-copperlist --output-bitplanes --colors 32 --quantize
|
||||
|
||||
test: $(IMAGECON) $(OUTPUT_BASE).bin $(SHARED_PALETTE) $(USED_PALETTE)
|
||||
diff $(OUTPUT_BASE).bin $(REFERENCE_BASE).bin
|
||||
diff $(OUTPUT_BASE)-copper-list.s $(REFERENCE_BASE)-copper-list.s
|
||||
@echo "Success!"
|
||||
diff $(OUTPUT_BASE)-mask.bin $(REFERENCE_BASE)-mask.bin
|
||||
diff $(SHARED_PALETTE) $(REFERENCE_SHARED_PALETTE)
|
||||
diff $(SHARED_BASE).bin $(REFERENCE_SHARED_BASE).bin
|
||||
diff $(SHARED_BASE)-copper-list.s $(REFERENCE_SHARED_BASE)-copper-list.s
|
||||
|
||||
@echo "______ ___ _____ _____ ___________ "
|
||||
@echo "| ___ \/ _ \ / ___/ ___| ___| _ \ "
|
||||
@echo "| |_/ / /_\ \\\\\ \`--.\ \`--.| |__ | | | | "
|
||||
@echo "| __/| _ | \`--. \\\`--. \ __|| | | | "
|
||||
@echo "| | | | | |/\__/ /\__/ / |___| |/ / "
|
||||
@echo "\_| \_| |_/\____/\____/\____/|___/ "
|
||||
|
||||
clean:
|
||||
rm -rf out bin *~
|
||||
@ -15,7 +15,7 @@ usage
|
||||
--output-bitplanes
|
||||
--output-mask
|
||||
--output-copperlist
|
||||
--override-palette <palette file>
|
||||
--use-palette <palette file>
|
||||
--verbose
|
||||
```
|
||||
|
||||
@ -30,7 +30,7 @@ options
|
||||
-------
|
||||
**--input** i<nput1.png,input2.png...>
|
||||
|
||||
Specify the file(s) to be processed. Multiple files are coma separated. If bitplane output is directed, the bitplane data is appended vertically filling any empty portions with color index zero.
|
||||
Specify the file(s) to be processed. Multiple files are coma separated. If bitplane output is directed, the bitplane data is stacked vertically. For images that need right padding, each line is right padded with the pixel in coloumn zero of that line.
|
||||
|
||||
**--output** <output prefix>
|
||||
|
||||
@ -60,9 +60,9 @@ Output the binary bitplane data for use as a blitter source mask
|
||||
|
||||
Generate a palette file of the final palette used. Output will be the output file with the ".pal" extension.
|
||||
|
||||
**--override-palette** <palette file>
|
||||
**--use-palette** <palette file>
|
||||
|
||||
Specify a palette file to use that will override the image or quantized palette. Also overrides the --colors option.
|
||||
Specify a palette file to use that will override the image or quantized palette. Overrides the --colors and --quantize options.
|
||||
|
||||
**--verbose**
|
||||
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
#include <pngquant/libimagequant.h>
|
||||
#include "imagecon.h"
|
||||
|
||||
|
||||
imagecon_config_t config = {
|
||||
.maxColors = MAX_PALETTE,
|
||||
.outputPalette = 0,
|
||||
@ -38,7 +39,7 @@ usage()
|
||||
" --output-copperlist\n"\
|
||||
" --output-mask\n"\
|
||||
" --output-palette\n"\
|
||||
" --override-palette <palette file>\n"\
|
||||
" --use-palette <palette file>\n"\
|
||||
" --verbose\n", config.argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
@ -434,9 +435,12 @@ combineImages(imagecon_image_t** images, int numImages, imagecon_image_t* ic)
|
||||
for (int y = 0; y < ic->height; y++) {
|
||||
ic->rowPointers[y] = (png_byte*) calloc(ic->width*4, 1);
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0, ny = 0; i < numImages; i++) {
|
||||
for (int y = 0; y < images[i]->height; y++, ny++) {
|
||||
for (int r = 0; r < ic->width*4; r+=4) {
|
||||
memcpy(&ic->rowPointers[ny][0]+r, &images[i]->rowPointers[y][0], 4);
|
||||
}
|
||||
memcpy(ic->rowPointers[ny], images[i]->rowPointers[y], images[i]->width*4);
|
||||
}
|
||||
}
|
||||
@ -458,7 +462,7 @@ main(int argc, char **argv)
|
||||
{"output-bitplanes", no_argument, &config.outputBitplanes, 1},
|
||||
{"output-palette", no_argument, &config.outputPalette, 1},
|
||||
{"output-mask", no_argument, &config.outputMask, 1},
|
||||
{"override-palette", required_argument, 0, 'p'},
|
||||
{"use-palette", required_argument, 0, 'p'},
|
||||
{"output", required_argument, 0, 'o'},
|
||||
{"colors", required_argument, 0, 'c'},
|
||||
{"input", required_argument, 0, 'i'},
|
||||
|
||||
1
tools/imagecon/reference/mission-beach-mask.bin
Normal file
1
tools/imagecon/reference/mission-beach-mask.bin
Normal file
File diff suppressed because one or more lines are too long
32
tools/imagecon/reference/shared-copper-list.s
Normal file
32
tools/imagecon/reference/shared-copper-list.s
Normal file
@ -0,0 +1,32 @@
|
||||
dc.w $180,$36b
|
||||
dc.w $182,$feb
|
||||
dc.w $184,$353
|
||||
dc.w $186,$ffd
|
||||
dc.w $188,$332
|
||||
dc.w $18a,$222
|
||||
dc.w $18c,$421
|
||||
dc.w $18e,$0
|
||||
dc.w $190,$211
|
||||
dc.w $192,$37b
|
||||
dc.w $194,$443
|
||||
dc.w $196,$463
|
||||
dc.w $198,$b95
|
||||
dc.w $19a,$48c
|
||||
dc.w $19c,$eda
|
||||
dc.w $19e,$da6
|
||||
dc.w $1a0,$cde
|
||||
dc.w $1a2,$684
|
||||
dc.w $1a4,$9aa
|
||||
dc.w $1a6,$eff
|
||||
dc.w $1a8,$9bd
|
||||
dc.w $1aa,$898
|
||||
dc.w $1ac,$dc8
|
||||
dc.w $1ae,$aa8
|
||||
dc.w $1b0,$bcc
|
||||
dc.w $1b2,$665
|
||||
dc.w $1b4,$6ad
|
||||
dc.w $1b6,$375
|
||||
dc.w $1b8,$a64
|
||||
dc.w $1ba,$8a4
|
||||
dc.w $1bc,$743
|
||||
dc.w $1be,$587
|
||||
BIN
tools/imagecon/reference/shared.bin
Normal file
BIN
tools/imagecon/reference/shared.bin
Normal file
Binary file not shown.
32
tools/imagecon/reference/shared.pal
Normal file
32
tools/imagecon/reference/shared.pal
Normal file
@ -0,0 +1,32 @@
|
||||
36b
|
||||
feb
|
||||
353
|
||||
ffd
|
||||
332
|
||||
222
|
||||
421
|
||||
000
|
||||
211
|
||||
37b
|
||||
443
|
||||
463
|
||||
b95
|
||||
48c
|
||||
eda
|
||||
da6
|
||||
cde
|
||||
684
|
||||
9aa
|
||||
eff
|
||||
9bd
|
||||
898
|
||||
dc8
|
||||
aa8
|
||||
bcc
|
||||
665
|
||||
6ad
|
||||
375
|
||||
a64
|
||||
8a4
|
||||
743
|
||||
587
|
||||
Reference in New Issue
Block a user