Add support for PGM format.

The code has been split into different source files.

This breaks for now rotation for tiled images and PPM format. The focus
is now on the PGM format.
This commit is contained in:
Fabien Freling 2014-07-20 16:34:45 +02:00
parent 53974a4116
commit 7e152c29fc
7 changed files with 612 additions and 469 deletions

View file

@ -1,14 +1,24 @@
CXX = clang++
CXXFLAGS = -std=c++11 -W -Wall -O3 -ffast-math -g -Werror
DEFINES = -DSIMD
LFLAGS = -flto
DEFINES = #-DSIMD
BUILD_DIR = /tmp
IMG = img/lena.ppm
SRC = rotation.cpp \
image.cpp \
pnm.cpp
HEADERS = image.h \
pnm.h
OBJS = $(patsubst %.cpp,%.o,$(SRC))
IMG = img/lena_3000.pgm
all: rotation.cpp
$(CXX) $(CXXFLAGS) $(DEFINES) $< -o $(BUILD_DIR)/rotation
all: $(OBJS)
$(CXX) $(CXXFLAGS) $(DEFINES) $(LFLAGS) $(OBJS) -o $(BUILD_DIR)/rotation
%.o: %.cpp $(HEADERS)
$(CXX) $(CXXFLAGS) $(DEFINES) $< -c -o $@
clean:
@rm -f *~ *.o .*.swp *.ppm cachegrind.out.*
@rm -f *~ *.o .*.swp *.ppm *.pgm *.pnm cachegrind.out.*
run: all
$(BUILD_DIR)/rotation $(IMG)
@ -17,4 +27,4 @@ debug: all
lldb $(BUILD_DIR)/rotation $(IMG)
cachegrind: all
valgrind --tool=cachegrind $(BUILD_DIR)/rotation $(IMG)
valgrind --tool=cachegrind --dsymutil=yes $(BUILD_DIR)/rotation $(IMG)