From c379b55a93fa519880991c839f7f79bdbb9e7532 Mon Sep 17 00:00:00 2001 From: James Zern Date: Tue, 19 Jul 2016 16:02:55 -0700 Subject: [PATCH] move examples/{example_util,image_dec} to imageio/ Change-Id: I2508c786a095a2a75bebf766210c64e2af88f9b6 --- Android.mk | 4 ++- CMakeLists.txt | 42 ++++++++++++++-------------- Makefile.am | 4 ++- Makefile.vc | 17 +++++------ build.gradle | 8 +++--- configure.ac | 4 +-- examples/Android.mk | 38 +------------------------ examples/Makefile.am | 32 +++++++-------------- examples/anim_util.c | 2 +- examples/cwebp.c | 4 +-- examples/dwebp.c | 2 +- examples/gif2webp.c | 2 +- examples/vwebp.c | 2 +- examples/webpmux.c | 2 +- imageio/Android.mk | 36 ++++++++++++++++++++++++ imageio/Makefile.am | 21 ++++++++++++++ {examples => imageio}/example_util.c | 2 +- {examples => imageio}/example_util.h | 6 ++-- {examples => imageio}/image_dec.c | 0 {examples => imageio}/image_dec.h | 6 ++-- {examples => imageio}/jpegdec.c | 0 {examples => imageio}/jpegdec.h | 6 ++-- {examples => imageio}/metadata.c | 0 {examples => imageio}/metadata.h | 6 ++-- {examples => imageio}/pngdec.c | 0 {examples => imageio}/pngdec.h | 6 ++-- {examples => imageio}/tiffdec.c | 0 {examples => imageio}/tiffdec.h | 6 ++-- {examples => imageio}/webpdec.c | 0 {examples => imageio}/webpdec.h | 6 ++-- {examples => imageio}/wicdec.c | 0 {examples => imageio}/wicdec.h | 6 ++-- makefile.unix | 31 ++++++++++---------- 33 files changed, 158 insertions(+), 143 deletions(-) create mode 100644 imageio/Android.mk create mode 100644 imageio/Makefile.am rename {examples => imageio}/example_util.c (99%) rename {examples => imageio}/example_util.h (97%) rename {examples => imageio}/image_dec.c (100%) rename {examples => imageio}/image_dec.h (94%) rename {examples => imageio}/jpegdec.c (100%) rename {examples => imageio}/jpegdec.h (91%) rename {examples => imageio}/metadata.c (100%) rename {examples => imageio}/metadata.h (91%) rename {examples => imageio}/pngdec.c (100%) rename {examples => imageio}/pngdec.h (91%) rename {examples => imageio}/tiffdec.c (100%) rename {examples => imageio}/tiffdec.h (91%) rename {examples => imageio}/webpdec.c (100%) rename {examples => imageio}/webpdec.h (91%) rename {examples => imageio}/wicdec.c (100%) rename {examples => imageio}/wicdec.h (91%) diff --git a/Android.mk b/Android.mk index 0237abc0..d91fe8e5 100644 --- a/Android.mk +++ b/Android.mk @@ -252,7 +252,9 @@ endif ################################################################################ -include $(LOCAL_PATH)/examples/Android.mk +WEBP_SRC_PATH := $(LOCAL_PATH) +include $(WEBP_SRC_PATH)/imageio/Android.mk +include $(WEBP_SRC_PATH)/examples/Android.mk ifeq ($(USE_CPUFEATURES),yes) $(call import-module,android/cpufeatures) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d5fa774..0acc46aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,32 +77,32 @@ endforeach() if(WEBP_BUILD_CWEBP OR WEBP_BUILD_DWEBP) # Example utility library. set(exampleutil_SRCS - ${CMAKE_CURRENT_SOURCE_DIR}/examples/example_util.c - ${CMAKE_CURRENT_SOURCE_DIR}/examples/example_util.h - ${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}/imageio/example_util.h) add_library(exampleutil ${exampleutil_SRCS}) target_link_libraries(exampleutil webp ${WEBP_DEP_LIBRARIES}) endif() if(WEBP_BUILD_CWEBP) # Image-decoding utility library. - set(exampledec_SRCS - ${CMAKE_CURRENT_SOURCE_DIR}/examples/image_dec.c - ${CMAKE_CURRENT_SOURCE_DIR}/examples/image_dec.h - ${CMAKE_CURRENT_SOURCE_DIR}/examples/jpegdec.c - ${CMAKE_CURRENT_SOURCE_DIR}/examples/jpegdec.h - ${CMAKE_CURRENT_SOURCE_DIR}/examples/metadata.c - ${CMAKE_CURRENT_SOURCE_DIR}/examples/metadata.h - ${CMAKE_CURRENT_SOURCE_DIR}/examples/pngdec.c - ${CMAKE_CURRENT_SOURCE_DIR}/examples/pngdec.h - ${CMAKE_CURRENT_SOURCE_DIR}/examples/tiffdec.c - ${CMAKE_CURRENT_SOURCE_DIR}/examples/tiffdec.h - ${CMAKE_CURRENT_SOURCE_DIR}/examples/webpdec.c - ${CMAKE_CURRENT_SOURCE_DIR}/examples/webpdec.h - ${CMAKE_CURRENT_SOURCE_DIR}/examples/wicdec.c - ${CMAKE_CURRENT_SOURCE_DIR}/examples/wicdec.h) - add_library(exampledec ${exampledec_SRCS}) - target_link_libraries(exampledec webp ${WEBP_DEP_LIBRARIES} + set(imagedec_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/imageio/image_dec.c + ${CMAKE_CURRENT_SOURCE_DIR}/imageio/image_dec.h + ${CMAKE_CURRENT_SOURCE_DIR}/imageio/jpegdec.c + ${CMAKE_CURRENT_SOURCE_DIR}/imageio/jpegdec.h + ${CMAKE_CURRENT_SOURCE_DIR}/imageio/metadata.c + ${CMAKE_CURRENT_SOURCE_DIR}/imageio/metadata.h + ${CMAKE_CURRENT_SOURCE_DIR}/imageio/pngdec.c + ${CMAKE_CURRENT_SOURCE_DIR}/imageio/pngdec.h + ${CMAKE_CURRENT_SOURCE_DIR}/imageio/tiffdec.c + ${CMAKE_CURRENT_SOURCE_DIR}/imageio/tiffdec.h + ${CMAKE_CURRENT_SOURCE_DIR}/imageio/webpdec.c + ${CMAKE_CURRENT_SOURCE_DIR}/imageio/webpdec.h + ${CMAKE_CURRENT_SOURCE_DIR}/imageio/wicdec.c + ${CMAKE_CURRENT_SOURCE_DIR}/imageio/wicdec.h) + add_library(imagedec ${imagedec_SRCS}) + target_link_libraries(imagedec webp ${WEBP_DEP_LIBRARIES} ${WEBP_DEP_IMG_LIBRARIES}) endif() @@ -124,7 +124,7 @@ if(WEBP_BUILD_CWEBP) add_executable(cwebp ${CMAKE_CURRENT_SOURCE_DIR}/examples/cwebp.c ${CMAKE_CURRENT_SOURCE_DIR}/examples/stopwatch.h) - target_link_libraries(cwebp exampledec webp exampleutil + target_link_libraries(cwebp imagedec webp exampleutil ${WEBP_DEP_LIBRARIES} ${WEBP_DEP_IMG_LIBRARIES} ) endif() diff --git a/Makefile.am b/Makefile.am index 7dc4c639..3f73b134 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,9 @@ ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = src examples man +SUBDIRS = src imageio man EXTRA_DIST = COPYING autogen.sh if WANT_EXTRAS SUBDIRS += extras endif + +SUBDIRS += examples diff --git a/Makefile.vc b/Makefile.vc index ab4200a6..dc8b8fab 100644 --- a/Makefile.vc +++ b/Makefile.vc @@ -82,6 +82,7 @@ OUTPUT_DIRS = $(DIRBIN) $(DIRINC) $(DIRLIB) \ $(DIROBJ)\dsp \ $(DIROBJ)\enc \ $(DIROBJ)\examples \ + $(DIROBJ)\imageio \ $(DIROBJ)\mux \ $(DIROBJ)\utils \ @@ -250,19 +251,19 @@ EX_ANIM_UTIL_OBJS = \ $(DIROBJ)\examples\anim_util.obj \ EX_FORMAT_DEC_OBJS = \ - $(DIROBJ)\examples\image_dec.obj \ - $(DIROBJ)\examples\jpegdec.obj \ - $(DIROBJ)\examples\metadata.obj \ - $(DIROBJ)\examples\pngdec.obj \ - $(DIROBJ)\examples\tiffdec.obj \ - $(DIROBJ)\examples\webpdec.obj \ - $(DIROBJ)\examples\wicdec.obj \ + $(DIROBJ)\imageio\image_dec.obj \ + $(DIROBJ)\imageio\jpegdec.obj \ + $(DIROBJ)\imageio\metadata.obj \ + $(DIROBJ)\imageio\pngdec.obj \ + $(DIROBJ)\imageio\tiffdec.obj \ + $(DIROBJ)\imageio\webpdec.obj \ + $(DIROBJ)\imageio\wicdec.obj \ EX_GIF_DEC_OBJS = \ $(DIROBJ)\examples\gifdec.obj \ EX_UTIL_OBJS = \ - $(DIROBJ)\examples\example_util.obj \ + $(DIROBJ)\imageio\example_util.obj \ ENC_OBJS = \ $(DIROBJ)\enc\alpha.obj \ diff --git a/build.gradle b/build.gradle index e81561aa..53222545 100644 --- a/build.gradle +++ b/build.gradle @@ -248,14 +248,14 @@ model { sources { c { source { - srcDir "./examples" + srcDir "./imageio" include "example_util.c" } } } } - example_dec(NativeLibrarySpec) { + imagedec(NativeLibrarySpec) { binaries { all { lib library: "webp", linkage: "static" @@ -264,7 +264,7 @@ model { sources { c { source { - srcDir "./examples" + srcDir "./imageio" include "image_dec.c" include "jpegdec.c" include "metadata.c" @@ -279,7 +279,7 @@ model { binaries { all { lib library: "example_util", linkage: "static" - lib library: "example_dec", linkage: "static" + lib library: "imagedec", linkage: "static" lib library: "webp", linkage: "static" } } diff --git a/configure.ac b/configure.ac index ccf70f1b..df31acc1 100644 --- a/configure.ac +++ b/configure.ac @@ -672,8 +672,8 @@ dnl ========================= AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([src/webp/config.h]) AC_CONFIG_FILES([Makefile src/Makefile man/Makefile \ - examples/Makefile extras/Makefile src/dec/Makefile \ - src/enc/Makefile src/dsp/Makefile \ + examples/Makefile extras/Makefile imageio/Makefile \ + src/dec/Makefile src/enc/Makefile src/dsp/Makefile \ src/demux/Makefile src/mux/Makefile \ src/utils/Makefile \ src/libwebp.pc src/libwebpdecoder.pc \ diff --git a/examples/Android.mk b/examples/Android.mk index 81490f61..47dd60d9 100644 --- a/examples/Android.mk +++ b/examples/Android.mk @@ -1,41 +1,5 @@ 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) - - -################################################################################ -# libexample_dec - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - image_dec.c \ - jpegdec.c \ - metadata.c \ - pngdec.c \ - tiffdec.c \ - webpdec.c \ - -LOCAL_CFLAGS := $(WEBP_CFLAGS) -LOCAL_C_INCLUDES := $(LOCAL_PATH)/../src - -LOCAL_MODULE := example_dec - -include $(BUILD_STATIC_LIBRARY) - ################################################################################ # cwebp @@ -48,7 +12,7 @@ LOCAL_SRC_FILES := \ LOCAL_CFLAGS := $(WEBP_CFLAGS) LOCAL_C_INCLUDES := $(LOCAL_PATH)/../src -LOCAL_STATIC_LIBRARIES := example_util example_dec webp +LOCAL_STATIC_LIBRARIES := example_util imagedec webp LOCAL_MODULE := cwebp diff --git a/examples/Makefile.am b/examples/Makefile.am index 17a3688a..6afa04ba 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -12,20 +12,6 @@ if BUILD_GIF2WEBP bin_PROGRAMS += gif2webp endif -noinst_LTLIBRARIES = libexampleutil.la libexampledec.la - -libexampleutil_la_SOURCES = example_util.c example_util.h stopwatch.h - -libexampledec_la_SOURCES = image_dec.c image_dec.h -libexampledec_la_SOURCES += jpegdec.c jpegdec.h -libexampledec_la_SOURCES += metadata.c metadata.h -libexampledec_la_SOURCES += pngdec.c pngdec.h -libexampledec_la_SOURCES += tiffdec.c tiffdec.h -libexampledec_la_SOURCES += webpdec.c webpdec.h -libexampledec_la_SOURCES += wicdec.c wicdec.h -libexampledec_la_CPPFLAGS = $(JPEG_INCLUDES) $(PNG_INCLUDES) $(TIFF_INCLUDES) -libexampledec_la_CPPFLAGS += $(AM_CPPFLAGS) $(USE_EXPERIMENTAL_CODE) - if BUILD_ANIMDIFF noinst_PROGRAMS = anim_diff endif @@ -33,31 +19,33 @@ endif anim_diff_SOURCES = anim_diff.c anim_util.c anim_util.h anim_diff_CPPFLAGS = $(AM_CPPFLAGS) $(USE_EXPERIMENTAL_CODE) $(GIF_INCLUDES) anim_diff_LDADD = ../src/demux/libwebpdemux.la -anim_diff_LDADD += libexampleutil.la +anim_diff_LDADD += ../imageio/libexample_util.la anim_diff_LDADD += $(GIF_LIBS) -lm dwebp_SOURCES = dwebp.c stopwatch.h dwebp_CPPFLAGS = $(AM_CPPFLAGS) $(USE_EXPERIMENTAL_CODE) dwebp_CPPFLAGS += $(JPEG_INCLUDES) $(PNG_INCLUDES) -dwebp_LDADD = libexampleutil.la $(PNG_LIBS) $(JPEG_LIBS) +dwebp_LDADD = ../imageio/libexample_util.la $(PNG_LIBS) $(JPEG_LIBS) cwebp_SOURCES = cwebp.c stopwatch.h cwebp_CPPFLAGS = $(AM_CPPFLAGS) $(USE_EXPERIMENTAL_CODE) -cwebp_LDADD = libexampleutil.la libexampledec.la ../src/libwebp.la -cwebp_LDADD += $(JPEG_LIBS) $(PNG_LIBS) $(TIFF_LIBS) +cwebp_LDADD = ../imageio/libexample_util.la ../imageio/libimagedec.la +cwebp_LDADD += ../src/libwebp.la $(JPEG_LIBS) $(PNG_LIBS) $(TIFF_LIBS) gif2webp_SOURCES = gif2webp.c gifdec.c gifdec.h gif2webp_CPPFLAGS = $(AM_CPPFLAGS) $(USE_EXPERIMENTAL_CODE) $(GIF_INCLUDES) -gif2webp_LDADD = libexampleutil.la ../src/mux/libwebpmux.la ../src/libwebp.la -gif2webp_LDADD += $(GIF_LIBS) +gif2webp_LDADD = ../imageio/libexample_util.la ../src/mux/libwebpmux.la +gif2webp_LDADD += ../src/libwebp.la $(GIF_LIBS) webpmux_SOURCES = webpmux.c webpmux_CPPFLAGS = $(AM_CPPFLAGS) $(USE_EXPERIMENTAL_CODE) -webpmux_LDADD = libexampleutil.la ../src/mux/libwebpmux.la ../src/libwebp.la +webpmux_LDADD = ../imageio/libexample_util.la ../src/mux/libwebpmux.la +webpmux_LDADD += ../src/libwebp.la vwebp_SOURCES = vwebp.c vwebp_CPPFLAGS = $(AM_CPPFLAGS) $(USE_EXPERIMENTAL_CODE) $(GL_INCLUDES) -vwebp_LDADD = libexampleutil.la ../src/demux/libwebpdemux.la $(GL_LIBS) +vwebp_LDADD = ../imageio/libexample_util.la ../src/demux/libwebpdemux.la +vwebp_LDADD += $(GL_LIBS) if BUILD_LIBWEBPDECODER anim_diff_LDADD += ../src/libwebpdecoder.la diff --git a/examples/anim_util.c b/examples/anim_util.c index 417fec2f..4f8b5cd7 100644 --- a/examples/anim_util.c +++ b/examples/anim_util.c @@ -22,7 +22,7 @@ #include "webp/format_constants.h" #include "webp/decode.h" #include "webp/demux.h" -#include "./example_util.h" +#include "../imageio/example_util.h" #if defined(_MSC_VER) && _MSC_VER < 1900 #define snprintf _snprintf diff --git a/examples/cwebp.c b/examples/cwebp.c index df45aa9b..486c3e3e 100644 --- a/examples/cwebp.c +++ b/examples/cwebp.c @@ -20,8 +20,8 @@ #include "webp/config.h" #endif -#include "./example_util.h" -#include "./image_dec.h" +#include "../imageio/example_util.h" +#include "../imageio/image_dec.h" #include "./stopwatch.h" #include "webp/encode.h" diff --git a/examples/dwebp.c b/examples/dwebp.c index 384987ba..536f940f 100644 --- a/examples/dwebp.c +++ b/examples/dwebp.c @@ -40,7 +40,7 @@ #endif #include "webp/decode.h" -#include "./example_util.h" +#include "../imageio/example_util.h" #include "./stopwatch.h" static int verbose = 0; diff --git a/examples/gif2webp.c b/examples/gif2webp.c index b6a9964b..510ec9eb 100644 --- a/examples/gif2webp.c +++ b/examples/gif2webp.c @@ -26,7 +26,7 @@ #include #include "webp/encode.h" #include "webp/mux.h" -#include "./example_util.h" +#include "../imageio/example_util.h" #include "./gifdec.h" //------------------------------------------------------------------------------ diff --git a/examples/vwebp.c b/examples/vwebp.c index 4b3fcf62..6d3c266d 100644 --- a/examples/vwebp.c +++ b/examples/vwebp.c @@ -36,7 +36,7 @@ #include "webp/decode.h" #include "webp/demux.h" -#include "./example_util.h" +#include "../imageio/example_util.h" #if defined(_MSC_VER) && _MSC_VER < 1900 #define snprintf _snprintf diff --git a/examples/webpmux.c b/examples/webpmux.c index 8d60c8ef..4a83a86e 100644 --- a/examples/webpmux.c +++ b/examples/webpmux.c @@ -55,7 +55,7 @@ #include #include "webp/decode.h" #include "webp/mux.h" -#include "./example_util.h" +#include "../imageio/example_util.h" //------------------------------------------------------------------------------ // Config object to parse command-line arguments. diff --git a/imageio/Android.mk b/imageio/Android.mk new file mode 100644 index 00000000..997c12ac --- /dev/null +++ b/imageio/Android.mk @@ -0,0 +1,36 @@ +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) + +################################################################################ +# libimagedec + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + image_dec.c \ + jpegdec.c \ + metadata.c \ + pngdec.c \ + tiffdec.c \ + webpdec.c \ + +LOCAL_CFLAGS := $(WEBP_CFLAGS) +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../src + +LOCAL_MODULE := imagedec + +include $(BUILD_STATIC_LIBRARY) diff --git a/imageio/Makefile.am b/imageio/Makefile.am new file mode 100644 index 00000000..c9fdc1ee --- /dev/null +++ b/imageio/Makefile.am @@ -0,0 +1,21 @@ +AM_CPPFLAGS += -I$(top_builddir)/src -I$(top_srcdir)/src +noinst_LTLIBRARIES = libexample_util.la libimagedec.la + +noinst_HEADERS = +noinst_HEADERS += ../src/webp/decode.h +noinst_HEADERS += ../src/webp/types.h +noinst_HEADERS += ../examples/stopwatch.h + +libexample_util_la_SOURCES = example_util.c example_util.h + +libimagedec_la_SOURCES = image_dec.c image_dec.h +libimagedec_la_SOURCES += jpegdec.c jpegdec.h +libimagedec_la_SOURCES += metadata.c metadata.h +libimagedec_la_SOURCES += pngdec.c pngdec.h +libimagedec_la_SOURCES += tiffdec.c tiffdec.h +libimagedec_la_SOURCES += webpdec.c webpdec.h +libimagedec_la_SOURCES += wicdec.c wicdec.h +libimagedec_la_CPPFLAGS = $(JPEG_INCLUDES) $(PNG_INCLUDES) $(TIFF_INCLUDES) +libimagedec_la_CPPFLAGS += $(AM_CPPFLAGS) $(USE_EXPERIMENTAL_CODE) + +libexample_util_la_LIBADD = ../src/libwebp.la diff --git a/examples/example_util.c b/imageio/example_util.c similarity index 99% rename from examples/example_util.c rename to imageio/example_util.c index 6c8af273..cec924b5 100644 --- a/examples/example_util.c +++ b/imageio/example_util.c @@ -21,7 +21,7 @@ #include #include "webp/decode.h" -#include "./stopwatch.h" +#include "../examples/stopwatch.h" //------------------------------------------------------------------------------ // String parsing diff --git a/examples/example_util.h b/imageio/example_util.h similarity index 97% rename from examples/example_util.h rename to imageio/example_util.h index 9af9bb32..37e9ed31 100644 --- a/examples/example_util.h +++ b/imageio/example_util.h @@ -10,8 +10,8 @@ // Utility functions used by the example programs. // -#ifndef WEBP_EXAMPLES_EXAMPLE_UTIL_H_ -#define WEBP_EXAMPLES_EXAMPLE_UTIL_H_ +#ifndef WEBP_IMAGEIO_EXAMPLE_UTIL_H_ +#define WEBP_IMAGEIO_EXAMPLE_UTIL_H_ #include #include "webp/decode.h" @@ -92,4 +92,4 @@ VP8StatusCode ExUtilDecodeWebPIncremental( } // extern "C" #endif -#endif // WEBP_EXAMPLES_EXAMPLE_UTIL_H_ +#endif // WEBP_IMAGEIO_EXAMPLE_UTIL_H_ diff --git a/examples/image_dec.c b/imageio/image_dec.c similarity index 100% rename from examples/image_dec.c rename to imageio/image_dec.c diff --git a/examples/image_dec.h b/imageio/image_dec.h similarity index 94% rename from examples/image_dec.h rename to imageio/image_dec.h index de25e14f..54dcda3f 100644 --- a/examples/image_dec.h +++ b/imageio/image_dec.h @@ -11,8 +11,8 @@ // // Author: Skal (pascal.massimino@gmail.com) -#ifndef WEBP_EXAMPLES_IMAGE_DEC_H_ -#define WEBP_EXAMPLES_IMAGE_DEC_H_ +#ifndef WEBP_IMAGEIO_IMAGE_DEC_H_ +#define WEBP_IMAGEIO_IMAGE_DEC_H_ #include "webp/types.h" @@ -58,4 +58,4 @@ WebPImageReader WebPGuessImageReader(const uint8_t* const data, } // extern "C" #endif -#endif // WEBP_EXAMPLES_IMAGE_DEC_H_ +#endif // WEBP_IMAGEIO_IMAGE_DEC_H_ diff --git a/examples/jpegdec.c b/imageio/jpegdec.c similarity index 100% rename from examples/jpegdec.c rename to imageio/jpegdec.c diff --git a/examples/jpegdec.h b/imageio/jpegdec.h similarity index 91% rename from examples/jpegdec.h rename to imageio/jpegdec.h index 9be463b1..d64d58e7 100644 --- a/examples/jpegdec.h +++ b/imageio/jpegdec.h @@ -9,8 +9,8 @@ // // JPEG decode. -#ifndef WEBP_EXAMPLES_JPEGDEC_H_ -#define WEBP_EXAMPLES_JPEGDEC_H_ +#ifndef WEBP_IMAGEIO_JPEGDEC_H_ +#define WEBP_IMAGEIO_JPEGDEC_H_ #include #include "webp/types.h" @@ -35,4 +35,4 @@ int ReadJPEG(const uint8_t* const data, size_t data_size, } // extern "C" #endif -#endif // WEBP_EXAMPLES_JPEGDEC_H_ +#endif // WEBP_IMAGEIO_JPEGDEC_H_ diff --git a/examples/metadata.c b/imageio/metadata.c similarity index 100% rename from examples/metadata.c rename to imageio/metadata.c diff --git a/examples/metadata.h b/imageio/metadata.h similarity index 91% rename from examples/metadata.h rename to imageio/metadata.h index 7f272c6b..1d5be91a 100644 --- a/examples/metadata.h +++ b/imageio/metadata.h @@ -10,8 +10,8 @@ // Metadata types and functions. // -#ifndef WEBP_EXAMPLES_METADATA_H_ -#define WEBP_EXAMPLES_METADATA_H_ +#ifndef WEBP_IMAGEIO_METADATA_H_ +#define WEBP_IMAGEIO_METADATA_H_ #include "webp/types.h" @@ -44,4 +44,4 @@ int MetadataCopy(const char* metadata, size_t metadata_len, } // extern "C" #endif -#endif // WEBP_EXAMPLES_METADATA_H_ +#endif // WEBP_IMAGEIO_METADATA_H_ diff --git a/examples/pngdec.c b/imageio/pngdec.c similarity index 100% rename from examples/pngdec.c rename to imageio/pngdec.c diff --git a/examples/pngdec.h b/imageio/pngdec.h similarity index 91% rename from examples/pngdec.h rename to imageio/pngdec.h index 062da932..e0a6122d 100644 --- a/examples/pngdec.h +++ b/imageio/pngdec.h @@ -9,8 +9,8 @@ // // PNG decode. -#ifndef WEBP_EXAMPLES_PNGDEC_H_ -#define WEBP_EXAMPLES_PNGDEC_H_ +#ifndef WEBP_IMAGEIO_PNGDEC_H_ +#define WEBP_IMAGEIO_PNGDEC_H_ #include "webp/types.h" @@ -34,4 +34,4 @@ int ReadPNG(const uint8_t* const data, size_t data_size, } // extern "C" #endif -#endif // WEBP_EXAMPLES_PNGDEC_H_ +#endif // WEBP_IMAGEIO_PNGDEC_H_ diff --git a/examples/tiffdec.c b/imageio/tiffdec.c similarity index 100% rename from examples/tiffdec.c rename to imageio/tiffdec.c diff --git a/examples/tiffdec.h b/imageio/tiffdec.h similarity index 91% rename from examples/tiffdec.h rename to imageio/tiffdec.h index 0dab8b83..0c8beccd 100644 --- a/examples/tiffdec.h +++ b/imageio/tiffdec.h @@ -9,8 +9,8 @@ // // TIFF decode. -#ifndef WEBP_EXAMPLES_TIFFDEC_H_ -#define WEBP_EXAMPLES_TIFFDEC_H_ +#ifndef WEBP_IMAGEIO_TIFFDEC_H_ +#define WEBP_IMAGEIO_TIFFDEC_H_ #include "webp/types.h" @@ -34,4 +34,4 @@ int ReadTIFF(const uint8_t* const data, size_t data_size, } // extern "C" #endif -#endif // WEBP_EXAMPLES_TIFFDEC_H_ +#endif // WEBP_IMAGEIO_TIFFDEC_H_ diff --git a/examples/webpdec.c b/imageio/webpdec.c similarity index 100% rename from examples/webpdec.c rename to imageio/webpdec.c diff --git a/examples/webpdec.h b/imageio/webpdec.h similarity index 91% rename from examples/webpdec.h rename to imageio/webpdec.h index 28eb628a..6fbfda79 100644 --- a/examples/webpdec.h +++ b/imageio/webpdec.h @@ -9,8 +9,8 @@ // // WebP decode. -#ifndef WEBP_EXAMPLES_WEBPDEC_H_ -#define WEBP_EXAMPLES_WEBPDEC_H_ +#ifndef WEBP_IMAGEIO_WEBPDEC_H_ +#define WEBP_IMAGEIO_WEBPDEC_H_ #include "webp/types.h" @@ -34,4 +34,4 @@ int ReadWebP(const uint8_t* const data, size_t data_size, } // extern "C" #endif -#endif // WEBP_EXAMPLES_WEBPDEC_H_ +#endif // WEBP_IMAGEIO_WEBPDEC_H_ diff --git a/examples/wicdec.c b/imageio/wicdec.c similarity index 100% rename from examples/wicdec.c rename to imageio/wicdec.c diff --git a/examples/wicdec.h b/imageio/wicdec.h similarity index 91% rename from examples/wicdec.h rename to imageio/wicdec.h index e17ea7f5..d9eeca82 100644 --- a/examples/wicdec.h +++ b/imageio/wicdec.h @@ -9,8 +9,8 @@ // // Windows Imaging Component (WIC) decode. -#ifndef WEBP_EXAMPLES_WICDEC_H_ -#define WEBP_EXAMPLES_WICDEC_H_ +#ifndef WEBP_IMAGEIO_WICDEC_H_ +#define WEBP_IMAGEIO_WICDEC_H_ #ifdef __cplusplus extern "C" { @@ -31,4 +31,4 @@ int ReadPictureWithWIC(const char* const filename, } // extern "C" #endif -#endif // WEBP_EXAMPLES_WICDEC_H_ +#endif // WEBP_IMAGEIO_WICDEC_H_ diff --git a/makefile.unix b/makefile.unix index cb804056..7eedab18 100644 --- a/makefile.unix +++ b/makefile.unix @@ -215,15 +215,15 @@ ENC_OBJS = \ src/enc/webpenc.o \ EX_FORMAT_DEC_OBJS = \ - examples/image_dec.o \ - examples/jpegdec.o \ - examples/metadata.o \ - examples/pngdec.o \ - examples/tiffdec.o \ - examples/webpdec.o \ + imageio/image_dec.o \ + imageio/jpegdec.o \ + imageio/metadata.o \ + imageio/pngdec.o \ + imageio/tiffdec.o \ + imageio/webpdec.o \ EX_UTIL_OBJS = \ - examples/example_util.o \ + imageio/example_util.o \ GIFDEC_OBJS = \ examples/gifdec.o \ @@ -306,7 +306,7 @@ HDRS = \ src/webp/format_constants.h \ $(HDRS_INSTALLED) \ -OUT_LIBS = examples/libexample_util.a src/libwebpdecoder.a src/libwebp.a +OUT_LIBS = imageio/libexample_util.a src/libwebpdecoder.a src/libwebp.a EXTRA_LIB = extras/libwebpextras.a OUT_EXAMPLES = examples/cwebp examples/dwebp EXTRA_EXAMPLES = examples/gif2webp examples/vwebp examples/webpmux \ @@ -338,9 +338,9 @@ src/utils/bit_writer.o: src/utils/endian_inl.h examples/libanim_util.a: $(ANIM_UTIL_OBJS) examples/libexample_dec.a: $(EX_FORMAT_DEC_OBJS) -examples/libexample_util.a: $(EX_UTIL_OBJS) examples/libgifdec.a: $(GIFDEC_OBJS) extras/libwebpextras.a: $(LIBWEBPEXTRA_OBJS) +imageio/libexample_util.a: $(EX_UTIL_OBJS) src/libwebpdecoder.a: $(LIBWEBPDECODER_OBJS) src/libwebp.a: $(LIBWEBP_OBJS) src/mux/libwebpmux.a: $(LIBWEBPMUX_OBJS) @@ -357,24 +357,24 @@ examples/vwebp: examples/vwebp.o examples/webpmux: examples/webpmux.o examples/anim_diff: examples/libanim_util.a examples/libgifdec.a -examples/anim_diff: src/demux/libwebpdemux.a examples/libexample_util.a +examples/anim_diff: src/demux/libwebpdemux.a imageio/libexample_util.a examples/anim_diff: src/libwebp.a examples/anim_diff: EXTRA_LIBS += $(GIF_LIBS) examples/anim_diff: EXTRA_FLAGS += -DWEBP_HAVE_GIF -examples/cwebp: examples/libexample_util.a examples/libexample_dec.a +examples/cwebp: imageio/libexample_util.a examples/libexample_dec.a examples/cwebp: src/libwebp.a examples/cwebp: EXTRA_LIBS += $(CWEBP_LIBS) -examples/dwebp: examples/libexample_util.a src/libwebpdecoder.a +examples/dwebp: imageio/libexample_util.a src/libwebpdecoder.a examples/dwebp: EXTRA_LIBS += $(DWEBP_LIBS) -examples/gif2webp: examples/libexample_util.a examples/libgifdec.a +examples/gif2webp: imageio/libexample_util.a examples/libgifdec.a examples/gif2webp: src/mux/libwebpmux.a src/libwebp.a examples/gif2webp: EXTRA_LIBS += $(GIF_LIBS) examples/gif2webp: EXTRA_FLAGS += -DWEBP_HAVE_GIF -examples/vwebp: examples/libexample_util.a src/demux/libwebpdemux.a +examples/vwebp: imageio/libexample_util.a src/demux/libwebpdemux.a examples/vwebp: src/libwebp.a examples/vwebp: EXTRA_LIBS += $(GL_LIBS) examples/vwebp: EXTRA_FLAGS += -DWEBP_HAVE_GL -examples/webpmux: examples/libexample_util.a src/mux/libwebpmux.a +examples/webpmux: imageio/libexample_util.a src/mux/libwebpmux.a examples/webpmux: src/libwebpdecoder.a $(OUT_EXAMPLES) $(EXTRA_EXAMPLES): @@ -403,6 +403,7 @@ clean: $(RM) $(OUTPUT) *~ \ examples/*.o examples/*~ \ extras/*.o extras/*~ \ + imageio/*.o imageio/*~ \ src/dec/*.o src/dec/*~ \ src/demux/*.o src/demux/*~ \ src/dsp/*.o src/dsp/*~ \