move imageio/example_util.[hc] (back to) examples/

decoding and file i/o have been split to imageio, all that remains is
some string routines used for parameter parsing in the examples

Change-Id: I77386cd8aa39124b9e14c95fdbaa17ea4ab5bb24
This commit is contained in:
James Zern 2016-07-21 16:10:05 -07:00
parent 99542bbf3e
commit ebee57f4d1
15 changed files with 48 additions and 47 deletions

View File

@ -78,8 +78,8 @@ if(WEBP_BUILD_CWEBP OR WEBP_BUILD_DWEBP)
# Example utility library. # Example utility library.
set(exampleutil_SRCS set(exampleutil_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/examples/stopwatch.h ${CMAKE_CURRENT_SOURCE_DIR}/examples/stopwatch.h
${CMAKE_CURRENT_SOURCE_DIR}/imageio/example_util.c ${CMAKE_CURRENT_SOURCE_DIR}/examples/example_util.c
${CMAKE_CURRENT_SOURCE_DIR}/imageio/example_util.h) ${CMAKE_CURRENT_SOURCE_DIR}/examples/example_util.h)
add_library(exampleutil ${exampleutil_SRCS}) add_library(exampleutil ${exampleutil_SRCS})
target_link_libraries(exampleutil webp ${WEBP_DEP_LIBRARIES}) target_link_libraries(exampleutil webp ${WEBP_DEP_LIBRARIES})

View File

@ -263,7 +263,7 @@ EX_GIF_DEC_OBJS = \
$(DIROBJ)\examples\gifdec.obj \ $(DIROBJ)\examples\gifdec.obj \
EX_UTIL_OBJS = \ EX_UTIL_OBJS = \
$(DIROBJ)\imageio\example_util.obj \ $(DIROBJ)\examples\example_util.obj \
ENC_OBJS = \ ENC_OBJS = \
$(DIROBJ)\enc\alpha.obj \ $(DIROBJ)\enc\alpha.obj \

View File

@ -248,7 +248,7 @@ model {
sources { sources {
c { c {
source { source {
srcDir "./imageio" srcDir "./examples"
include "example_util.c" include "example_util.c"
} }
} }

View File

@ -1,5 +1,20 @@
LOCAL_PATH := $(call my-dir) LOCAL_PATH := $(call my-dir)
################################################################################
# libexample_util
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
example_util.c \
LOCAL_CFLAGS := $(WEBP_CFLAGS)
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../src
LOCAL_MODULE := example_util
include $(BUILD_STATIC_LIBRARY)
################################################################################ ################################################################################
# cwebp # cwebp

View File

@ -16,38 +16,43 @@ if BUILD_ANIMDIFF
noinst_PROGRAMS = anim_diff noinst_PROGRAMS = anim_diff
endif endif
noinst_LTLIBRARIES = libexample_util.la
libexample_util_la_SOURCES = example_util.c example_util.h
libexample_util_la_LIBADD = ../src/libwebp.la
anim_diff_SOURCES = anim_diff.c anim_util.c anim_util.h anim_diff_SOURCES = anim_diff.c anim_util.c anim_util.h
anim_diff_CPPFLAGS = $(AM_CPPFLAGS) $(USE_EXPERIMENTAL_CODE) $(GIF_INCLUDES) anim_diff_CPPFLAGS = $(AM_CPPFLAGS) $(USE_EXPERIMENTAL_CODE) $(GIF_INCLUDES)
anim_diff_LDADD = ../src/demux/libwebpdemux.la anim_diff_LDADD = ../src/demux/libwebpdemux.la
anim_diff_LDADD += ../imageio/libexample_util.la ../imageio/libimageio_util.la anim_diff_LDADD += libexample_util.la ../imageio/libimageio_util.la
anim_diff_LDADD += $(GIF_LIBS) -lm anim_diff_LDADD += $(GIF_LIBS) -lm
dwebp_SOURCES = dwebp.c stopwatch.h dwebp_SOURCES = dwebp.c stopwatch.h
dwebp_CPPFLAGS = $(AM_CPPFLAGS) $(USE_EXPERIMENTAL_CODE) dwebp_CPPFLAGS = $(AM_CPPFLAGS) $(USE_EXPERIMENTAL_CODE)
dwebp_CPPFLAGS += $(JPEG_INCLUDES) $(PNG_INCLUDES) dwebp_CPPFLAGS += $(JPEG_INCLUDES) $(PNG_INCLUDES)
dwebp_LDADD = ../imageio/libexample_util.la ../imageio/libimageio_util.la dwebp_LDADD = libexample_util.la ../imageio/libimageio_util.la
dwebp_LDADD += ../imageio/libimagedec.la ../src/libwebp.la dwebp_LDADD += ../imageio/libimagedec.la ../src/libwebp.la
dwebp_LDADD +=$(PNG_LIBS) $(JPEG_LIBS) dwebp_LDADD +=$(PNG_LIBS) $(JPEG_LIBS)
cwebp_SOURCES = cwebp.c stopwatch.h cwebp_SOURCES = cwebp.c stopwatch.h
cwebp_CPPFLAGS = $(AM_CPPFLAGS) $(USE_EXPERIMENTAL_CODE) cwebp_CPPFLAGS = $(AM_CPPFLAGS) $(USE_EXPERIMENTAL_CODE)
cwebp_LDADD = ../imageio/libexample_util.la ../imageio/libimageio_util.la cwebp_LDADD = libexample_util.la ../imageio/libimageio_util.la
cwebp_LDADD += ../imageio/libimagedec.la ../src/libwebp.la cwebp_LDADD += ../imageio/libimagedec.la ../src/libwebp.la
cwebp_LDADD += $(JPEG_LIBS) $(PNG_LIBS) $(TIFF_LIBS) cwebp_LDADD += $(JPEG_LIBS) $(PNG_LIBS) $(TIFF_LIBS)
gif2webp_SOURCES = gif2webp.c gifdec.c gifdec.h gif2webp_SOURCES = gif2webp.c gifdec.c gifdec.h
gif2webp_CPPFLAGS = $(AM_CPPFLAGS) $(USE_EXPERIMENTAL_CODE) $(GIF_INCLUDES) gif2webp_CPPFLAGS = $(AM_CPPFLAGS) $(USE_EXPERIMENTAL_CODE) $(GIF_INCLUDES)
gif2webp_LDADD = ../imageio/libexample_util.la ../imageio/libimageio_util.la gif2webp_LDADD = libexample_util.la ../imageio/libimageio_util.la
gif2webp_LDADD += ../src/mux/libwebpmux.la ../src/libwebp.la $(GIF_LIBS) gif2webp_LDADD += ../src/mux/libwebpmux.la ../src/libwebp.la $(GIF_LIBS)
webpmux_SOURCES = webpmux.c webpmux_SOURCES = webpmux.c
webpmux_CPPFLAGS = $(AM_CPPFLAGS) $(USE_EXPERIMENTAL_CODE) webpmux_CPPFLAGS = $(AM_CPPFLAGS) $(USE_EXPERIMENTAL_CODE)
webpmux_LDADD = ../imageio/libexample_util.la ../imageio/libimageio_util.la webpmux_LDADD = libexample_util.la ../imageio/libimageio_util.la
webpmux_LDADD += ../src/mux/libwebpmux.la ../src/libwebp.la webpmux_LDADD += ../src/mux/libwebpmux.la ../src/libwebp.la
vwebp_SOURCES = vwebp.c vwebp_SOURCES = vwebp.c
vwebp_CPPFLAGS = $(AM_CPPFLAGS) $(USE_EXPERIMENTAL_CODE) $(GL_INCLUDES) vwebp_CPPFLAGS = $(AM_CPPFLAGS) $(USE_EXPERIMENTAL_CODE) $(GL_INCLUDES)
vwebp_LDADD = ../imageio/libexample_util.la ../imageio/libimageio_util.la vwebp_LDADD = libexample_util.la ../imageio/libimageio_util.la
vwebp_LDADD += ../src/demux/libwebpdemux.la $(GL_LIBS) vwebp_LDADD += ../src/demux/libwebpdemux.la $(GL_LIBS)
if BUILD_LIBWEBPDECODER if BUILD_LIBWEBPDECODER

View File

@ -20,7 +20,7 @@
#include "webp/config.h" #include "webp/config.h"
#endif #endif
#include "../imageio/example_util.h" #include "../examples/example_util.h"
#include "../imageio/image_dec.h" #include "../imageio/image_dec.h"
#include "../imageio/imageio_util.h" #include "../imageio/imageio_util.h"
#include "./stopwatch.h" #include "./stopwatch.h"

View File

@ -40,7 +40,7 @@
#endif #endif
#include "webp/decode.h" #include "webp/decode.h"
#include "../imageio/example_util.h" #include "../examples/example_util.h"
#include "../imageio/imageio_util.h" #include "../imageio/imageio_util.h"
#include "../imageio/webpdec.h" #include "../imageio/webpdec.h"
#include "./stopwatch.h" #include "./stopwatch.h"

View File

@ -10,8 +10,8 @@
// Utility functions used by the example programs. // Utility functions used by the example programs.
// //
#ifndef WEBP_IMAGEIO_EXAMPLE_UTIL_H_ #ifndef WEBP_EXAMPLES_EXAMPLE_UTIL_H_
#define WEBP_IMAGEIO_EXAMPLE_UTIL_H_ #define WEBP_EXAMPLES_EXAMPLE_UTIL_H_
#include "webp/types.h" #include "webp/types.h"
@ -33,4 +33,4 @@ float ExUtilGetFloat(const char* const v, int* const error);
} // extern "C" } // extern "C"
#endif #endif
#endif // WEBP_IMAGEIO_EXAMPLE_UTIL_H_ #endif // WEBP_EXAMPLES_EXAMPLE_UTIL_H_

View File

@ -26,7 +26,7 @@
#include <gif_lib.h> #include <gif_lib.h>
#include "webp/encode.h" #include "webp/encode.h"
#include "webp/mux.h" #include "webp/mux.h"
#include "../imageio/example_util.h" #include "../examples/example_util.h"
#include "../imageio/imageio_util.h" #include "../imageio/imageio_util.h"
#include "./gifdec.h" #include "./gifdec.h"

View File

@ -36,7 +36,7 @@
#include "webp/decode.h" #include "webp/decode.h"
#include "webp/demux.h" #include "webp/demux.h"
#include "../imageio/example_util.h" #include "../examples/example_util.h"
#include "../imageio/imageio_util.h" #include "../imageio/imageio_util.h"
#if defined(_MSC_VER) && _MSC_VER < 1900 #if defined(_MSC_VER) && _MSC_VER < 1900

View File

@ -55,7 +55,7 @@
#include <string.h> #include <string.h>
#include "webp/decode.h" #include "webp/decode.h"
#include "webp/mux.h" #include "webp/mux.h"
#include "../imageio/example_util.h" #include "../examples/example_util.h"
#include "../imageio/imageio_util.h" #include "../imageio/imageio_util.h"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------

View File

@ -1,20 +1,5 @@
LOCAL_PATH := $(call my-dir) LOCAL_PATH := $(call my-dir)
################################################################################
# libexample_util
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
example_util.c \
LOCAL_CFLAGS := $(WEBP_CFLAGS)
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../src
LOCAL_MODULE := example_util
include $(BUILD_STATIC_LIBRARY)
################################################################################ ################################################################################
# libimageio_util # libimageio_util

View File

@ -1,13 +1,11 @@
AM_CPPFLAGS += -I$(top_builddir)/src -I$(top_srcdir)/src AM_CPPFLAGS += -I$(top_builddir)/src -I$(top_srcdir)/src
noinst_LTLIBRARIES = libexample_util.la libimageio_util.la libimagedec.la noinst_LTLIBRARIES = libimageio_util.la libimagedec.la
noinst_HEADERS = noinst_HEADERS =
noinst_HEADERS += ../src/webp/decode.h noinst_HEADERS += ../src/webp/decode.h
noinst_HEADERS += ../src/webp/types.h noinst_HEADERS += ../src/webp/types.h
noinst_HEADERS += ../examples/stopwatch.h noinst_HEADERS += ../examples/stopwatch.h
libexample_util_la_SOURCES = example_util.c example_util.h
libimageio_util_la_SOURCES = imageio_util.c imageio_util.h libimageio_util_la_SOURCES = imageio_util.c imageio_util.h
libimagedec_la_SOURCES = image_dec.c image_dec.h libimagedec_la_SOURCES = image_dec.c image_dec.h
@ -19,5 +17,3 @@ libimagedec_la_SOURCES += webpdec.c webpdec.h
libimagedec_la_SOURCES += wicdec.c wicdec.h libimagedec_la_SOURCES += wicdec.c wicdec.h
libimagedec_la_CPPFLAGS = $(JPEG_INCLUDES) $(PNG_INCLUDES) $(TIFF_INCLUDES) libimagedec_la_CPPFLAGS = $(JPEG_INCLUDES) $(PNG_INCLUDES) $(TIFF_INCLUDES)
libimagedec_la_CPPFLAGS += $(AM_CPPFLAGS) $(USE_EXPERIMENTAL_CODE) libimagedec_la_CPPFLAGS += $(AM_CPPFLAGS) $(USE_EXPERIMENTAL_CODE)
libexample_util_la_LIBADD = ../src/libwebp.la

View File

@ -223,7 +223,7 @@ EX_FORMAT_DEC_OBJS = \
imageio/webpdec.o \ imageio/webpdec.o \
EX_UTIL_OBJS = \ EX_UTIL_OBJS = \
imageio/example_util.o \ examples/example_util.o \
GIFDEC_OBJS = \ GIFDEC_OBJS = \
examples/gifdec.o \ examples/gifdec.o \
@ -310,7 +310,7 @@ HDRS = \
src/webp/format_constants.h \ src/webp/format_constants.h \
$(HDRS_INSTALLED) \ $(HDRS_INSTALLED) \
OUT_LIBS = imageio/libexample_util.a imageio/libimageio_util.a OUT_LIBS = examples/libexample_util.a imageio/libimageio_util.a
OUT_LIBS += imageio/libimagedec.a src/libwebpdecoder.a OUT_LIBS += imageio/libimagedec.a src/libwebpdecoder.a
OUT_LIBS += src/libwebp.a OUT_LIBS += src/libwebp.a
EXTRA_LIB = extras/libwebpextras.a EXTRA_LIB = extras/libwebpextras.a
@ -344,9 +344,9 @@ src/utils/bit_writer.o: src/utils/endian_inl.h
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
examples/libanim_util.a: $(ANIM_UTIL_OBJS) examples/libanim_util.a: $(ANIM_UTIL_OBJS)
examples/libexample_util.a: $(EX_UTIL_OBJS)
examples/libgifdec.a: $(GIFDEC_OBJS) examples/libgifdec.a: $(GIFDEC_OBJS)
extras/libwebpextras.a: $(LIBWEBPEXTRA_OBJS) extras/libwebpextras.a: $(LIBWEBPEXTRA_OBJS)
imageio/libexample_util.a: $(EX_UTIL_OBJS)
imageio/libimagedec.a: $(EX_FORMAT_DEC_OBJS) imageio/libimagedec.a: $(EX_FORMAT_DEC_OBJS)
imageio/libimageio_util.a: $(IMAGE_UTIL_OBJS) imageio/libimageio_util.a: $(IMAGE_UTIL_OBJS)
src/libwebpdecoder.a: $(LIBWEBPDECODER_OBJS) src/libwebpdecoder.a: $(LIBWEBPDECODER_OBJS)
@ -365,25 +365,25 @@ examples/vwebp: examples/vwebp.o
examples/webpmux: examples/webpmux.o examples/webpmux: examples/webpmux.o
examples/anim_diff: examples/libanim_util.a examples/libgifdec.a examples/anim_diff: examples/libanim_util.a examples/libgifdec.a
examples/anim_diff: src/demux/libwebpdemux.a imageio/libexample_util.a examples/anim_diff: src/demux/libwebpdemux.a examples/libexample_util.a
examples/anim_diff: imageio/libimageio_util.a src/libwebp.a examples/anim_diff: imageio/libimageio_util.a src/libwebp.a
examples/anim_diff: EXTRA_LIBS += $(GIF_LIBS) examples/anim_diff: EXTRA_LIBS += $(GIF_LIBS)
examples/anim_diff: EXTRA_FLAGS += -DWEBP_HAVE_GIF examples/anim_diff: EXTRA_FLAGS += -DWEBP_HAVE_GIF
examples/cwebp: imageio/libexample_util.a imageio/libimageio_util.a examples/cwebp: examples/libexample_util.a imageio/libimageio_util.a
examples/cwebp: imageio/libimagedec.a src/libwebp.a examples/cwebp: imageio/libimagedec.a src/libwebp.a
examples/cwebp: EXTRA_LIBS += $(CWEBP_LIBS) examples/cwebp: EXTRA_LIBS += $(CWEBP_LIBS)
examples/dwebp: imageio/libexample_util.a imageio/libimageio_util.a examples/dwebp: examples/libexample_util.a imageio/libimageio_util.a
examples/dwebp: imageio/libimagedec.a src/libwebp.a examples/dwebp: imageio/libimagedec.a src/libwebp.a
examples/dwebp: EXTRA_LIBS += $(DWEBP_LIBS) examples/dwebp: EXTRA_LIBS += $(DWEBP_LIBS)
examples/gif2webp: imageio/libexample_util.a imageio/libimageio_util.a examples/gif2webp: examples/libexample_util.a imageio/libimageio_util.a
examples/gif2webp: examples/libgifdec.a src/mux/libwebpmux.a src/libwebp.a examples/gif2webp: examples/libgifdec.a src/mux/libwebpmux.a src/libwebp.a
examples/gif2webp: EXTRA_LIBS += $(GIF_LIBS) examples/gif2webp: EXTRA_LIBS += $(GIF_LIBS)
examples/gif2webp: EXTRA_FLAGS += -DWEBP_HAVE_GIF examples/gif2webp: EXTRA_FLAGS += -DWEBP_HAVE_GIF
examples/vwebp: imageio/libexample_util.a src/demux/libwebpdemux.a examples/vwebp: examples/libexample_util.a src/demux/libwebpdemux.a
examples/vwebp: imageio/libimageio_util.a src/libwebp.a examples/vwebp: imageio/libimageio_util.a src/libwebp.a
examples/vwebp: EXTRA_LIBS += $(GL_LIBS) examples/vwebp: EXTRA_LIBS += $(GL_LIBS)
examples/vwebp: EXTRA_FLAGS += -DWEBP_HAVE_GL examples/vwebp: EXTRA_FLAGS += -DWEBP_HAVE_GL
examples/webpmux: imageio/libexample_util.a imageio/libimageio_util.a examples/webpmux: examples/libexample_util.a imageio/libimageio_util.a
examples/webpmux: src/mux/libwebpmux.a src/libwebpdecoder.a examples/webpmux: src/mux/libwebpmux.a src/libwebpdecoder.a
extras/get_disto: extras/get_disto.o extras/get_disto: extras/get_disto.o