diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/evas/src/modules/loaders/jpeg/Makefile.am | 36 | ||||
-rw-r--r-- | libraries/evas/src/modules/loaders/jpeg/Makefile.in | 760 | ||||
-rw-r--r-- | libraries/evas/src/modules/loaders/jpeg/evas_image_load_jpeg.c | 1265 |
3 files changed, 2061 insertions, 0 deletions
diff --git a/libraries/evas/src/modules/loaders/jpeg/Makefile.am b/libraries/evas/src/modules/loaders/jpeg/Makefile.am new file mode 100644 index 0000000..2088ba8 --- /dev/null +++ b/libraries/evas/src/modules/loaders/jpeg/Makefile.am | |||
@@ -0,0 +1,36 @@ | |||
1 | |||
2 | MAINTAINERCLEANFILES = Makefile.in | ||
3 | |||
4 | AM_CPPFLAGS = \ | ||
5 | -I. \ | ||
6 | -I$(top_srcdir)/src/lib \ | ||
7 | -I$(top_srcdir)/src/lib/include \ | ||
8 | @FREETYPE_CFLAGS@ \ | ||
9 | @PIXMAN_CFLAGS@ \ | ||
10 | @EINA_CFLAGS@ \ | ||
11 | @evas_image_loader_jpeg_cflags@ \ | ||
12 | @EVIL_CFLAGS@ \ | ||
13 | @WIN32_CPPFLAGS@ | ||
14 | |||
15 | AM_CFLAGS = @WIN32_CFLAGS@ | ||
16 | |||
17 | if BUILD_LOADER_JPEG | ||
18 | if !EVAS_STATIC_BUILD_JPEG | ||
19 | |||
20 | pkgdir = $(libdir)/evas/modules/loaders/jpeg/$(MODULE_ARCH) | ||
21 | pkg_LTLIBRARIES = module.la | ||
22 | |||
23 | module_la_SOURCES = evas_image_load_jpeg.c | ||
24 | |||
25 | module_la_LIBADD = @EINA_LIBS@ @EVIL_LIBS@ @evas_image_loader_jpeg_libs@ $(top_builddir)/src/lib/libevas.la | ||
26 | module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version | ||
27 | module_la_LIBTOOLFLAGS = --tag=disable-static | ||
28 | |||
29 | else | ||
30 | |||
31 | noinst_LTLIBRARIES = libevas_loader_jpeg.la | ||
32 | libevas_loader_jpeg_la_SOURCES = evas_image_load_jpeg.c | ||
33 | libevas_loader_jpeg_la_LIBADD = @evas_image_loader_jpeg_libs@ | ||
34 | |||
35 | endif | ||
36 | endif | ||
diff --git a/libraries/evas/src/modules/loaders/jpeg/Makefile.in b/libraries/evas/src/modules/loaders/jpeg/Makefile.in new file mode 100644 index 0000000..ce4b194 --- /dev/null +++ b/libraries/evas/src/modules/loaders/jpeg/Makefile.in | |||
@@ -0,0 +1,760 @@ | |||
1 | # Makefile.in generated by automake 1.11.1 from Makefile.am. | ||
2 | # @configure_input@ | ||
3 | |||
4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, | ||
5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, | ||
6 | # Inc. | ||
7 | # This Makefile.in is free software; the Free Software Foundation | ||
8 | # gives unlimited permission to copy and/or distribute it, | ||
9 | # with or without modifications, as long as this notice is preserved. | ||
10 | |||
11 | # This program is distributed in the hope that it will be useful, | ||
12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without | ||
13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
14 | # PARTICULAR PURPOSE. | ||
15 | |||
16 | @SET_MAKE@ | ||
17 | |||
18 | VPATH = @srcdir@ | ||
19 | pkgdatadir = $(datadir)/@PACKAGE@ | ||
20 | pkgincludedir = $(includedir)/@PACKAGE@ | ||
21 | pkglibdir = $(libdir)/@PACKAGE@ | ||
22 | pkglibexecdir = $(libexecdir)/@PACKAGE@ | ||
23 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd | ||
24 | install_sh_DATA = $(install_sh) -c -m 644 | ||
25 | install_sh_PROGRAM = $(install_sh) -c | ||
26 | install_sh_SCRIPT = $(install_sh) -c | ||
27 | INSTALL_HEADER = $(INSTALL_DATA) | ||
28 | transform = $(program_transform_name) | ||
29 | NORMAL_INSTALL = : | ||
30 | PRE_INSTALL = : | ||
31 | POST_INSTALL = : | ||
32 | NORMAL_UNINSTALL = : | ||
33 | PRE_UNINSTALL = : | ||
34 | POST_UNINSTALL = : | ||
35 | build_triplet = @build@ | ||
36 | host_triplet = @host@ | ||
37 | subdir = src/modules/loaders/jpeg | ||
38 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in | ||
39 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | ||
40 | am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ | ||
41 | $(top_srcdir)/m4/efl_coverage.m4 \ | ||
42 | $(top_srcdir)/m4/efl_doxygen.m4 \ | ||
43 | $(top_srcdir)/m4/efl_fnmatch.m4 \ | ||
44 | $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ | ||
45 | $(top_srcdir)/m4/evas_check_engine.m4 \ | ||
46 | $(top_srcdir)/m4/evas_check_loader.m4 \ | ||
47 | $(top_srcdir)/m4/evas_converter.m4 \ | ||
48 | $(top_srcdir)/m4/evas_dither.m4 \ | ||
49 | $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \ | ||
50 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ | ||
51 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ | ||
52 | $(top_srcdir)/configure.ac | ||
53 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ | ||
54 | $(ACLOCAL_M4) | ||
55 | mkinstalldirs = $(install_sh) -d | ||
56 | CONFIG_HEADER = $(top_builddir)/config.h | ||
57 | CONFIG_CLEAN_FILES = | ||
58 | CONFIG_CLEAN_VPATH_FILES = | ||
59 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; | ||
60 | am__vpath_adj = case $$p in \ | ||
61 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ | ||
62 | *) f=$$p;; \ | ||
63 | esac; | ||
64 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; | ||
65 | am__install_max = 40 | ||
66 | am__nobase_strip_setup = \ | ||
67 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` | ||
68 | am__nobase_strip = \ | ||
69 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" | ||
70 | am__nobase_list = $(am__nobase_strip_setup); \ | ||
71 | for p in $$list; do echo "$$p $$p"; done | \ | ||
72 | sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ | ||
73 | $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ | ||
74 | if (++n[$$2] == $(am__install_max)) \ | ||
75 | { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ | ||
76 | END { for (dir in files) print dir, files[dir] }' | ||
77 | am__base_list = \ | ||
78 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ | ||
79 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | ||
80 | am__installdirs = "$(DESTDIR)$(pkgdir)" | ||
81 | LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkg_LTLIBRARIES) | ||
82 | libevas_loader_jpeg_la_DEPENDENCIES = | ||
83 | am__libevas_loader_jpeg_la_SOURCES_DIST = evas_image_load_jpeg.c | ||
84 | @BUILD_LOADER_JPEG_TRUE@@EVAS_STATIC_BUILD_JPEG_TRUE@am_libevas_loader_jpeg_la_OBJECTS = evas_image_load_jpeg.lo | ||
85 | libevas_loader_jpeg_la_OBJECTS = $(am_libevas_loader_jpeg_la_OBJECTS) | ||
86 | AM_V_lt = $(am__v_lt_$(V)) | ||
87 | am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) | ||
88 | am__v_lt_0 = --silent | ||
89 | @BUILD_LOADER_JPEG_TRUE@@EVAS_STATIC_BUILD_JPEG_TRUE@am_libevas_loader_jpeg_la_rpath = | ||
90 | @BUILD_LOADER_JPEG_TRUE@@EVAS_STATIC_BUILD_JPEG_FALSE@module_la_DEPENDENCIES = $(top_builddir)/src/lib/libevas.la | ||
91 | am__module_la_SOURCES_DIST = evas_image_load_jpeg.c | ||
92 | @BUILD_LOADER_JPEG_TRUE@@EVAS_STATIC_BUILD_JPEG_FALSE@am_module_la_OBJECTS = module_la-evas_image_load_jpeg.lo | ||
93 | module_la_OBJECTS = $(am_module_la_OBJECTS) | ||
94 | module_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ | ||
95 | $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ | ||
96 | $(AM_CFLAGS) $(CFLAGS) $(module_la_LDFLAGS) $(LDFLAGS) -o $@ | ||
97 | @BUILD_LOADER_JPEG_TRUE@@EVAS_STATIC_BUILD_JPEG_FALSE@am_module_la_rpath = \ | ||
98 | @BUILD_LOADER_JPEG_TRUE@@EVAS_STATIC_BUILD_JPEG_FALSE@ -rpath \ | ||
99 | @BUILD_LOADER_JPEG_TRUE@@EVAS_STATIC_BUILD_JPEG_FALSE@ $(pkgdir) | ||
100 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) | ||
101 | depcomp = $(SHELL) $(top_srcdir)/depcomp | ||
102 | am__depfiles_maybe = depfiles | ||
103 | am__mv = mv -f | ||
104 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ | ||
105 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
106 | LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | ||
107 | $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ | ||
108 | $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ | ||
109 | $(AM_CFLAGS) $(CFLAGS) | ||
110 | AM_V_CC = $(am__v_CC_$(V)) | ||
111 | am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) | ||
112 | am__v_CC_0 = @echo " CC " $@; | ||
113 | AM_V_at = $(am__v_at_$(V)) | ||
114 | am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) | ||
115 | am__v_at_0 = @ | ||
116 | CCLD = $(CC) | ||
117 | LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | ||
118 | $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ | ||
119 | $(AM_LDFLAGS) $(LDFLAGS) -o $@ | ||
120 | AM_V_CCLD = $(am__v_CCLD_$(V)) | ||
121 | am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) | ||
122 | am__v_CCLD_0 = @echo " CCLD " $@; | ||
123 | AM_V_GEN = $(am__v_GEN_$(V)) | ||
124 | am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) | ||
125 | am__v_GEN_0 = @echo " GEN " $@; | ||
126 | SOURCES = $(libevas_loader_jpeg_la_SOURCES) $(module_la_SOURCES) | ||
127 | DIST_SOURCES = $(am__libevas_loader_jpeg_la_SOURCES_DIST) \ | ||
128 | $(am__module_la_SOURCES_DIST) | ||
129 | ETAGS = etags | ||
130 | CTAGS = ctags | ||
131 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||
132 | ACLOCAL = @ACLOCAL@ | ||
133 | ALLOCA = @ALLOCA@ | ||
134 | AMTAR = @AMTAR@ | ||
135 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ | ||
136 | AR = @AR@ | ||
137 | AS = @AS@ | ||
138 | AUTOCONF = @AUTOCONF@ | ||
139 | AUTOHEADER = @AUTOHEADER@ | ||
140 | AUTOMAKE = @AUTOMAKE@ | ||
141 | AWK = @AWK@ | ||
142 | CC = @CC@ | ||
143 | CCDEPMODE = @CCDEPMODE@ | ||
144 | CFLAGS = @CFLAGS@ | ||
145 | CHECK_CFLAGS = @CHECK_CFLAGS@ | ||
146 | CHECK_LIBS = @CHECK_LIBS@ | ||
147 | CPP = @CPP@ | ||
148 | CPPFLAGS = @CPPFLAGS@ | ||
149 | CXX = @CXX@ | ||
150 | CXXCPP = @CXXCPP@ | ||
151 | CXXDEPMODE = @CXXDEPMODE@ | ||
152 | CXXFLAGS = @CXXFLAGS@ | ||
153 | CYGPATH_W = @CYGPATH_W@ | ||
154 | DEFS = @DEFS@ | ||
155 | DEPDIR = @DEPDIR@ | ||
156 | DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@ | ||
157 | DIRECTFB_LIBS = @DIRECTFB_LIBS@ | ||
158 | DLLTOOL = @DLLTOOL@ | ||
159 | DSYMUTIL = @DSYMUTIL@ | ||
160 | DUMPBIN = @DUMPBIN@ | ||
161 | ECHO_C = @ECHO_C@ | ||
162 | ECHO_N = @ECHO_N@ | ||
163 | ECHO_T = @ECHO_T@ | ||
164 | ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@ | ||
165 | ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@ | ||
166 | EDB_CFLAGS = @EDB_CFLAGS@ | ||
167 | EDB_LIBS = @EDB_LIBS@ | ||
168 | EDJE_CFLAGS = @EDJE_CFLAGS@ | ||
169 | EDJE_LIBS = @EDJE_LIBS@ | ||
170 | EET_CFLAGS = @EET_CFLAGS@ | ||
171 | EET_LIBS = @EET_LIBS@ | ||
172 | EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@ | ||
173 | EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@ | ||
174 | EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@ | ||
175 | EGREP = @EGREP@ | ||
176 | EINA_CFLAGS = @EINA_CFLAGS@ | ||
177 | EINA_LIBS = @EINA_LIBS@ | ||
178 | EVAS_CFLAGS = @EVAS_CFLAGS@ | ||
179 | EVAS_LIBS = @EVAS_LIBS@ | ||
180 | EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@ | ||
181 | EVIL_CFLAGS = @EVIL_CFLAGS@ | ||
182 | EVIL_LIBS = @EVIL_LIBS@ | ||
183 | EXEEXT = @EXEEXT@ | ||
184 | FGREP = @FGREP@ | ||
185 | FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ | ||
186 | FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ | ||
187 | FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ | ||
188 | FREETYPE_LIBS = @FREETYPE_LIBS@ | ||
189 | FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ | ||
190 | FRIBIDI_LIBS = @FRIBIDI_LIBS@ | ||
191 | GL_EET_CFLAGS = @GL_EET_CFLAGS@ | ||
192 | GL_EET_LIBS = @GL_EET_LIBS@ | ||
193 | GREP = @GREP@ | ||
194 | HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ | ||
195 | HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ | ||
196 | INSTALL = @INSTALL@ | ||
197 | INSTALL_DATA = @INSTALL_DATA@ | ||
198 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | ||
199 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | ||
200 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ | ||
201 | LD = @LD@ | ||
202 | LDFLAGS = @LDFLAGS@ | ||
203 | LIBOBJS = @LIBOBJS@ | ||
204 | LIBS = @LIBS@ | ||
205 | LIBTOOL = @LIBTOOL@ | ||
206 | LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@ | ||
207 | LINEBREAK_LIBS = @LINEBREAK_LIBS@ | ||
208 | LIPO = @LIPO@ | ||
209 | LN_S = @LN_S@ | ||
210 | LTLIBOBJS = @LTLIBOBJS@ | ||
211 | MAKEINFO = @MAKEINFO@ | ||
212 | MKDIR_P = @MKDIR_P@ | ||
213 | MODULE_ARCH = @MODULE_ARCH@ | ||
214 | NM = @NM@ | ||
215 | NMEDIT = @NMEDIT@ | ||
216 | OBJC = @OBJC@ | ||
217 | OBJCDEPMODE = @OBJCDEPMODE@ | ||
218 | OBJCFLAGS = @OBJCFLAGS@ | ||
219 | OBJDUMP = @OBJDUMP@ | ||
220 | OBJEXT = @OBJEXT@ | ||
221 | OTOOL = @OTOOL@ | ||
222 | OTOOL64 = @OTOOL64@ | ||
223 | PACKAGE = @PACKAGE@ | ||
224 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | ||
225 | PACKAGE_NAME = @PACKAGE_NAME@ | ||
226 | PACKAGE_STRING = @PACKAGE_STRING@ | ||
227 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ | ||
228 | PACKAGE_URL = @PACKAGE_URL@ | ||
229 | PACKAGE_VERSION = @PACKAGE_VERSION@ | ||
230 | PATH_SEPARATOR = @PATH_SEPARATOR@ | ||
231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | ||
232 | PIXMAN_LIBS = @PIXMAN_LIBS@ | ||
233 | PKG_CONFIG = @PKG_CONFIG@ | ||
234 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
235 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
236 | PNG_CFLAGS = @PNG_CFLAGS@ | ||
237 | PNG_LIBS = @PNG_LIBS@ | ||
238 | RANLIB = @RANLIB@ | ||
239 | SDL_CFLAGS = @SDL_CFLAGS@ | ||
240 | SDL_LIBS = @SDL_LIBS@ | ||
241 | SED = @SED@ | ||
242 | SET_MAKE = @SET_MAKE@ | ||
243 | SHELL = @SHELL@ | ||
244 | SHM_OPEN_LINK = @SHM_OPEN_LINK@ | ||
245 | STRIP = @STRIP@ | ||
246 | SVG_CFLAGS = @SVG_CFLAGS@ | ||
247 | SVG_LIBS = @SVG_LIBS@ | ||
248 | VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | ||
249 | VALGRIND_LIBS = @VALGRIND_LIBS@ | ||
250 | VERSION = @VERSION@ | ||
251 | VMAJ = @VMAJ@ | ||
252 | WIN32_CFLAGS = @WIN32_CFLAGS@ | ||
253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | ||
254 | XCB_CFLAGS = @XCB_CFLAGS@ | ||
255 | XCB_GL_CFLAGS = @XCB_GL_CFLAGS@ | ||
256 | XCB_GL_LIBS = @XCB_GL_LIBS@ | ||
257 | XCB_LIBS = @XCB_LIBS@ | ||
258 | XEXT_CFLAGS = @XEXT_CFLAGS@ | ||
259 | XEXT_LIBS = @XEXT_LIBS@ | ||
260 | XMKMF = @XMKMF@ | ||
261 | X_CFLAGS = @X_CFLAGS@ | ||
262 | X_EXTRA_LIBS = @X_EXTRA_LIBS@ | ||
263 | X_LIBS = @X_LIBS@ | ||
264 | X_PRE_LIBS = @X_PRE_LIBS@ | ||
265 | abs_builddir = @abs_builddir@ | ||
266 | abs_srcdir = @abs_srcdir@ | ||
267 | abs_top_builddir = @abs_top_builddir@ | ||
268 | abs_top_srcdir = @abs_top_srcdir@ | ||
269 | ac_ct_CC = @ac_ct_CC@ | ||
270 | ac_ct_CXX = @ac_ct_CXX@ | ||
271 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ | ||
272 | ac_ct_OBJC = @ac_ct_OBJC@ | ||
273 | altivec_cflags = @altivec_cflags@ | ||
274 | am__include = @am__include@ | ||
275 | am__leading_dot = @am__leading_dot@ | ||
276 | am__quote = @am__quote@ | ||
277 | am__tar = @am__tar@ | ||
278 | am__untar = @am__untar@ | ||
279 | bindir = @bindir@ | ||
280 | build = @build@ | ||
281 | build_alias = @build_alias@ | ||
282 | build_cpu = @build_cpu@ | ||
283 | build_os = @build_os@ | ||
284 | build_vendor = @build_vendor@ | ||
285 | builddir = @builddir@ | ||
286 | datadir = @datadir@ | ||
287 | datarootdir = @datarootdir@ | ||
288 | dlopen_libs = @dlopen_libs@ | ||
289 | docdir = @docdir@ | ||
290 | dvidir = @dvidir@ | ||
291 | edje_cc = @edje_cc@ | ||
292 | efl_doxygen = @efl_doxygen@ | ||
293 | efl_have_doxygen = @efl_have_doxygen@ | ||
294 | evas_engine_buffer_cflags = @evas_engine_buffer_cflags@ | ||
295 | evas_engine_buffer_libs = @evas_engine_buffer_libs@ | ||
296 | evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@ | ||
297 | evas_engine_direct3d_libs = @evas_engine_direct3d_libs@ | ||
298 | evas_engine_directfb_cflags = @evas_engine_directfb_cflags@ | ||
299 | evas_engine_directfb_libs = @evas_engine_directfb_libs@ | ||
300 | evas_engine_fb_cflags = @evas_engine_fb_cflags@ | ||
301 | evas_engine_fb_libs = @evas_engine_fb_libs@ | ||
302 | evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@ | ||
303 | evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@ | ||
304 | evas_engine_gl_common_libs = @evas_engine_gl_common_libs@ | ||
305 | evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@ | ||
306 | evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@ | ||
307 | evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@ | ||
308 | evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@ | ||
309 | evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@ | ||
310 | evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@ | ||
311 | evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@ | ||
312 | evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@ | ||
313 | evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@ | ||
314 | evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@ | ||
315 | evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@ | ||
316 | evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@ | ||
317 | evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@ | ||
318 | evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@ | ||
319 | evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@ | ||
320 | evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@ | ||
321 | evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@ | ||
322 | evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@ | ||
323 | evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@ | ||
324 | evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@ | ||
325 | evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@ | ||
326 | evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@ | ||
327 | evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@ | ||
328 | evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@ | ||
329 | evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | ||
330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | ||
331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | ||
332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | ||
333 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | ||
334 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | ||
335 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | ||
336 | evas_image_loader_edb_libs = @evas_image_loader_edb_libs@ | ||
337 | evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@ | ||
338 | evas_image_loader_eet_libs = @evas_image_loader_eet_libs@ | ||
339 | evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@ | ||
340 | evas_image_loader_generic_libs = @evas_image_loader_generic_libs@ | ||
341 | evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@ | ||
342 | evas_image_loader_gif_libs = @evas_image_loader_gif_libs@ | ||
343 | evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@ | ||
344 | evas_image_loader_ico_libs = @evas_image_loader_ico_libs@ | ||
345 | evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@ | ||
346 | evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@ | ||
347 | evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@ | ||
348 | evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@ | ||
349 | evas_image_loader_png_cflags = @evas_image_loader_png_cflags@ | ||
350 | evas_image_loader_png_libs = @evas_image_loader_png_libs@ | ||
351 | evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@ | ||
352 | evas_image_loader_psd_libs = @evas_image_loader_psd_libs@ | ||
353 | evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@ | ||
354 | evas_image_loader_svg_libs = @evas_image_loader_svg_libs@ | ||
355 | evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@ | ||
356 | evas_image_loader_tga_libs = @evas_image_loader_tga_libs@ | ||
357 | evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@ | ||
358 | evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@ | ||
359 | evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@ | ||
360 | evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@ | ||
361 | evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@ | ||
362 | evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@ | ||
363 | exec_prefix = @exec_prefix@ | ||
364 | have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@ | ||
365 | have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@ | ||
366 | have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@ | ||
367 | have_evas_engine_software_x11 = @have_evas_engine_software_x11@ | ||
368 | have_evas_engine_software_xcb = @have_evas_engine_software_xcb@ | ||
369 | have_evas_engine_software_xlib = @have_evas_engine_software_xlib@ | ||
370 | have_lcov = @have_lcov@ | ||
371 | host = @host@ | ||
372 | host_alias = @host_alias@ | ||
373 | host_cpu = @host_cpu@ | ||
374 | host_os = @host_os@ | ||
375 | host_vendor = @host_vendor@ | ||
376 | htmldir = @htmldir@ | ||
377 | includedir = @includedir@ | ||
378 | infodir = @infodir@ | ||
379 | install_sh = @install_sh@ | ||
380 | libdir = @libdir@ | ||
381 | libexecdir = @libexecdir@ | ||
382 | localedir = @localedir@ | ||
383 | localstatedir = @localstatedir@ | ||
384 | lt_ECHO = @lt_ECHO@ | ||
385 | lt_enable_auto_import = @lt_enable_auto_import@ | ||
386 | mandir = @mandir@ | ||
387 | mkdir_p = @mkdir_p@ | ||
388 | oldincludedir = @oldincludedir@ | ||
389 | pdfdir = @pdfdir@ | ||
390 | pkgconfig_requires_private = @pkgconfig_requires_private@ | ||
391 | prefix = @prefix@ | ||
392 | program_transform_name = @program_transform_name@ | ||
393 | psdir = @psdir@ | ||
394 | pthread_cflags = @pthread_cflags@ | ||
395 | pthread_libs = @pthread_libs@ | ||
396 | release_info = @release_info@ | ||
397 | requirement_evas = @requirement_evas@ | ||
398 | sbindir = @sbindir@ | ||
399 | sharedstatedir = @sharedstatedir@ | ||
400 | srcdir = @srcdir@ | ||
401 | sysconfdir = @sysconfdir@ | ||
402 | target_alias = @target_alias@ | ||
403 | top_build_prefix = @top_build_prefix@ | ||
404 | top_builddir = @top_builddir@ | ||
405 | top_srcdir = @top_srcdir@ | ||
406 | version_info = @version_info@ | ||
407 | MAINTAINERCLEANFILES = Makefile.in | ||
408 | AM_CPPFLAGS = \ | ||
409 | -I. \ | ||
410 | -I$(top_srcdir)/src/lib \ | ||
411 | -I$(top_srcdir)/src/lib/include \ | ||
412 | @FREETYPE_CFLAGS@ \ | ||
413 | @PIXMAN_CFLAGS@ \ | ||
414 | @EINA_CFLAGS@ \ | ||
415 | @evas_image_loader_jpeg_cflags@ \ | ||
416 | @EVIL_CFLAGS@ \ | ||
417 | @WIN32_CPPFLAGS@ | ||
418 | |||
419 | AM_CFLAGS = @WIN32_CFLAGS@ | ||
420 | @BUILD_LOADER_JPEG_TRUE@@EVAS_STATIC_BUILD_JPEG_FALSE@pkgdir = $(libdir)/evas/modules/loaders/jpeg/$(MODULE_ARCH) | ||
421 | @BUILD_LOADER_JPEG_TRUE@@EVAS_STATIC_BUILD_JPEG_FALSE@pkg_LTLIBRARIES = module.la | ||
422 | @BUILD_LOADER_JPEG_TRUE@@EVAS_STATIC_BUILD_JPEG_FALSE@module_la_SOURCES = evas_image_load_jpeg.c | ||
423 | @BUILD_LOADER_JPEG_TRUE@@EVAS_STATIC_BUILD_JPEG_FALSE@module_la_LIBADD = @EINA_LIBS@ @EVIL_LIBS@ @evas_image_loader_jpeg_libs@ $(top_builddir)/src/lib/libevas.la | ||
424 | @BUILD_LOADER_JPEG_TRUE@@EVAS_STATIC_BUILD_JPEG_FALSE@module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version | ||
425 | @BUILD_LOADER_JPEG_TRUE@@EVAS_STATIC_BUILD_JPEG_FALSE@module_la_LIBTOOLFLAGS = --tag=disable-static | ||
426 | @BUILD_LOADER_JPEG_TRUE@@EVAS_STATIC_BUILD_JPEG_TRUE@noinst_LTLIBRARIES = libevas_loader_jpeg.la | ||
427 | @BUILD_LOADER_JPEG_TRUE@@EVAS_STATIC_BUILD_JPEG_TRUE@libevas_loader_jpeg_la_SOURCES = evas_image_load_jpeg.c | ||
428 | @BUILD_LOADER_JPEG_TRUE@@EVAS_STATIC_BUILD_JPEG_TRUE@libevas_loader_jpeg_la_LIBADD = @evas_image_loader_jpeg_libs@ | ||
429 | all: all-am | ||
430 | |||
431 | .SUFFIXES: | ||
432 | .SUFFIXES: .c .lo .o .obj | ||
433 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) | ||
434 | @for dep in $?; do \ | ||
435 | case '$(am__configure_deps)' in \ | ||
436 | *$$dep*) \ | ||
437 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ | ||
438 | && { if test -f $@; then exit 0; else break; fi; }; \ | ||
439 | exit 1;; \ | ||
440 | esac; \ | ||
441 | done; \ | ||
442 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/loaders/jpeg/Makefile'; \ | ||
443 | $(am__cd) $(top_srcdir) && \ | ||
444 | $(AUTOMAKE) --gnu src/modules/loaders/jpeg/Makefile | ||
445 | .PRECIOUS: Makefile | ||
446 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | ||
447 | @case '$?' in \ | ||
448 | *config.status*) \ | ||
449 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ | ||
450 | *) \ | ||
451 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ | ||
452 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ | ||
453 | esac; | ||
454 | |||
455 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) | ||
456 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
457 | |||
458 | $(top_srcdir)/configure: $(am__configure_deps) | ||
459 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
460 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) | ||
461 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
462 | $(am__aclocal_m4_deps): | ||
463 | |||
464 | clean-noinstLTLIBRARIES: | ||
465 | -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) | ||
466 | @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ | ||
467 | dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ | ||
468 | test "$$dir" != "$$p" || dir=.; \ | ||
469 | echo "rm -f \"$${dir}/so_locations\""; \ | ||
470 | rm -f "$${dir}/so_locations"; \ | ||
471 | done | ||
472 | install-pkgLTLIBRARIES: $(pkg_LTLIBRARIES) | ||
473 | @$(NORMAL_INSTALL) | ||
474 | test -z "$(pkgdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdir)" | ||
475 | @list='$(pkg_LTLIBRARIES)'; test -n "$(pkgdir)" || list=; \ | ||
476 | list2=; for p in $$list; do \ | ||
477 | if test -f $$p; then \ | ||
478 | list2="$$list2 $$p"; \ | ||
479 | else :; fi; \ | ||
480 | done; \ | ||
481 | test -z "$$list2" || { \ | ||
482 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkgdir)'"; \ | ||
483 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkgdir)"; \ | ||
484 | } | ||
485 | |||
486 | uninstall-pkgLTLIBRARIES: | ||
487 | @$(NORMAL_UNINSTALL) | ||
488 | @list='$(pkg_LTLIBRARIES)'; test -n "$(pkgdir)" || list=; \ | ||
489 | for p in $$list; do \ | ||
490 | $(am__strip_dir) \ | ||
491 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkgdir)/$$f'"; \ | ||
492 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkgdir)/$$f"; \ | ||
493 | done | ||
494 | |||
495 | clean-pkgLTLIBRARIES: | ||
496 | -test -z "$(pkg_LTLIBRARIES)" || rm -f $(pkg_LTLIBRARIES) | ||
497 | @list='$(pkg_LTLIBRARIES)'; for p in $$list; do \ | ||
498 | dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ | ||
499 | test "$$dir" != "$$p" || dir=.; \ | ||
500 | echo "rm -f \"$${dir}/so_locations\""; \ | ||
501 | rm -f "$${dir}/so_locations"; \ | ||
502 | done | ||
503 | libevas_loader_jpeg.la: $(libevas_loader_jpeg_la_OBJECTS) $(libevas_loader_jpeg_la_DEPENDENCIES) | ||
504 | $(AM_V_CCLD)$(LINK) $(am_libevas_loader_jpeg_la_rpath) $(libevas_loader_jpeg_la_OBJECTS) $(libevas_loader_jpeg_la_LIBADD) $(LIBS) | ||
505 | module.la: $(module_la_OBJECTS) $(module_la_DEPENDENCIES) | ||
506 | $(AM_V_CCLD)$(module_la_LINK) $(am_module_la_rpath) $(module_la_OBJECTS) $(module_la_LIBADD) $(LIBS) | ||
507 | |||
508 | mostlyclean-compile: | ||
509 | -rm -f *.$(OBJEXT) | ||
510 | |||
511 | distclean-compile: | ||
512 | -rm -f *.tab.c | ||
513 | |||
514 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_image_load_jpeg.Plo@am__quote@ | ||
515 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_image_load_jpeg.Plo@am__quote@ | ||
516 | |||
517 | .c.o: | ||
518 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
519 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
520 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
521 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
522 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
523 | @am__fastdepCC_FALSE@ $(COMPILE) -c $< | ||
524 | |||
525 | .c.obj: | ||
526 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` | ||
527 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
528 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
529 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
530 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
531 | @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` | ||
532 | |||
533 | .c.lo: | ||
534 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
535 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo | ||
536 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
537 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ | ||
538 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
539 | @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< | ||
540 | |||
541 | module_la-evas_image_load_jpeg.lo: evas_image_load_jpeg.c | ||
542 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT module_la-evas_image_load_jpeg.lo -MD -MP -MF $(DEPDIR)/module_la-evas_image_load_jpeg.Tpo -c -o module_la-evas_image_load_jpeg.lo `test -f 'evas_image_load_jpeg.c' || echo '$(srcdir)/'`evas_image_load_jpeg.c | ||
543 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_image_load_jpeg.Tpo $(DEPDIR)/module_la-evas_image_load_jpeg.Plo | ||
544 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
545 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_image_load_jpeg.c' object='module_la-evas_image_load_jpeg.lo' libtool=yes @AMDEPBACKSLASH@ | ||
546 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
547 | @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o module_la-evas_image_load_jpeg.lo `test -f 'evas_image_load_jpeg.c' || echo '$(srcdir)/'`evas_image_load_jpeg.c | ||
548 | |||
549 | mostlyclean-libtool: | ||
550 | -rm -f *.lo | ||
551 | |||
552 | clean-libtool: | ||
553 | -rm -rf .libs _libs | ||
554 | |||
555 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) | ||
556 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
557 | unique=`for i in $$list; do \ | ||
558 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
559 | done | \ | ||
560 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
561 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
562 | mkid -fID $$unique | ||
563 | tags: TAGS | ||
564 | |||
565 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
566 | $(TAGS_FILES) $(LISP) | ||
567 | set x; \ | ||
568 | here=`pwd`; \ | ||
569 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
570 | unique=`for i in $$list; do \ | ||
571 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
572 | done | \ | ||
573 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
574 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
575 | shift; \ | ||
576 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ | ||
577 | test -n "$$unique" || unique=$$empty_fix; \ | ||
578 | if test $$# -gt 0; then \ | ||
579 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
580 | "$$@" $$unique; \ | ||
581 | else \ | ||
582 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
583 | $$unique; \ | ||
584 | fi; \ | ||
585 | fi | ||
586 | ctags: CTAGS | ||
587 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
588 | $(TAGS_FILES) $(LISP) | ||
589 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
590 | unique=`for i in $$list; do \ | ||
591 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
592 | done | \ | ||
593 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
594 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
595 | test -z "$(CTAGS_ARGS)$$unique" \ | ||
596 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ | ||
597 | $$unique | ||
598 | |||
599 | GTAGS: | ||
600 | here=`$(am__cd) $(top_builddir) && pwd` \ | ||
601 | && $(am__cd) $(top_srcdir) \ | ||
602 | && gtags -i $(GTAGS_ARGS) "$$here" | ||
603 | |||
604 | distclean-tags: | ||
605 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags | ||
606 | |||
607 | distdir: $(DISTFILES) | ||
608 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
609 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
610 | list='$(DISTFILES)'; \ | ||
611 | dist_files=`for file in $$list; do echo $$file; done | \ | ||
612 | sed -e "s|^$$srcdirstrip/||;t" \ | ||
613 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ | ||
614 | case $$dist_files in \ | ||
615 | */*) $(MKDIR_P) `echo "$$dist_files" | \ | ||
616 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ | ||
617 | sort -u` ;; \ | ||
618 | esac; \ | ||
619 | for file in $$dist_files; do \ | ||
620 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ | ||
621 | if test -d $$d/$$file; then \ | ||
622 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ | ||
623 | if test -d "$(distdir)/$$file"; then \ | ||
624 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||
625 | fi; \ | ||
626 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ | ||
627 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ | ||
628 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||
629 | fi; \ | ||
630 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ | ||
631 | else \ | ||
632 | test -f "$(distdir)/$$file" \ | ||
633 | || cp -p $$d/$$file "$(distdir)/$$file" \ | ||
634 | || exit 1; \ | ||
635 | fi; \ | ||
636 | done | ||
637 | check-am: all-am | ||
638 | check: check-am | ||
639 | all-am: Makefile $(LTLIBRARIES) | ||
640 | installdirs: | ||
641 | for dir in "$(DESTDIR)$(pkgdir)"; do \ | ||
642 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ | ||
643 | done | ||
644 | install: install-am | ||
645 | install-exec: install-exec-am | ||
646 | install-data: install-data-am | ||
647 | uninstall: uninstall-am | ||
648 | |||
649 | install-am: all-am | ||
650 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||
651 | |||
652 | installcheck: installcheck-am | ||
653 | install-strip: | ||
654 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||
655 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||
656 | `test -z '$(STRIP)' || \ | ||
657 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install | ||
658 | mostlyclean-generic: | ||
659 | |||
660 | clean-generic: | ||
661 | |||
662 | distclean-generic: | ||
663 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | ||
664 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) | ||
665 | |||
666 | maintainer-clean-generic: | ||
667 | @echo "This command is intended for maintainers to use" | ||
668 | @echo "it deletes files that may require special tools to rebuild." | ||
669 | -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) | ||
670 | clean: clean-am | ||
671 | |||
672 | clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ | ||
673 | clean-pkgLTLIBRARIES mostlyclean-am | ||
674 | |||
675 | distclean: distclean-am | ||
676 | -rm -rf ./$(DEPDIR) | ||
677 | -rm -f Makefile | ||
678 | distclean-am: clean-am distclean-compile distclean-generic \ | ||
679 | distclean-tags | ||
680 | |||
681 | dvi: dvi-am | ||
682 | |||
683 | dvi-am: | ||
684 | |||
685 | html: html-am | ||
686 | |||
687 | html-am: | ||
688 | |||
689 | info: info-am | ||
690 | |||
691 | info-am: | ||
692 | |||
693 | install-data-am: install-pkgLTLIBRARIES | ||
694 | |||
695 | install-dvi: install-dvi-am | ||
696 | |||
697 | install-dvi-am: | ||
698 | |||
699 | install-exec-am: | ||
700 | |||
701 | install-html: install-html-am | ||
702 | |||
703 | install-html-am: | ||
704 | |||
705 | install-info: install-info-am | ||
706 | |||
707 | install-info-am: | ||
708 | |||
709 | install-man: | ||
710 | |||
711 | install-pdf: install-pdf-am | ||
712 | |||
713 | install-pdf-am: | ||
714 | |||
715 | install-ps: install-ps-am | ||
716 | |||
717 | install-ps-am: | ||
718 | |||
719 | installcheck-am: | ||
720 | |||
721 | maintainer-clean: maintainer-clean-am | ||
722 | -rm -rf ./$(DEPDIR) | ||
723 | -rm -f Makefile | ||
724 | maintainer-clean-am: distclean-am maintainer-clean-generic | ||
725 | |||
726 | mostlyclean: mostlyclean-am | ||
727 | |||
728 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ | ||
729 | mostlyclean-libtool | ||
730 | |||
731 | pdf: pdf-am | ||
732 | |||
733 | pdf-am: | ||
734 | |||
735 | ps: ps-am | ||
736 | |||
737 | ps-am: | ||
738 | |||
739 | uninstall-am: uninstall-pkgLTLIBRARIES | ||
740 | |||
741 | .MAKE: install-am install-strip | ||
742 | |||
743 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ | ||
744 | clean-libtool clean-noinstLTLIBRARIES clean-pkgLTLIBRARIES \ | ||
745 | ctags distclean distclean-compile distclean-generic \ | ||
746 | distclean-libtool distclean-tags distdir dvi dvi-am html \ | ||
747 | html-am info info-am install install-am install-data \ | ||
748 | install-data-am install-dvi install-dvi-am install-exec \ | ||
749 | install-exec-am install-html install-html-am install-info \ | ||
750 | install-info-am install-man install-pdf install-pdf-am \ | ||
751 | install-pkgLTLIBRARIES install-ps install-ps-am install-strip \ | ||
752 | installcheck installcheck-am installdirs maintainer-clean \ | ||
753 | maintainer-clean-generic mostlyclean mostlyclean-compile \ | ||
754 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ | ||
755 | tags uninstall uninstall-am uninstall-pkgLTLIBRARIES | ||
756 | |||
757 | |||
758 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
759 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
760 | .NOEXPORT: | ||
diff --git a/libraries/evas/src/modules/loaders/jpeg/evas_image_load_jpeg.c b/libraries/evas/src/modules/loaders/jpeg/evas_image_load_jpeg.c new file mode 100644 index 0000000..0dbabab --- /dev/null +++ b/libraries/evas/src/modules/loaders/jpeg/evas_image_load_jpeg.c | |||
@@ -0,0 +1,1265 @@ | |||
1 | #ifdef HAVE_CONFIG_H | ||
2 | # include <config.h> | ||
3 | #endif | ||
4 | |||
5 | #include <stdio.h> | ||
6 | |||
7 | #ifdef HAVE_EVIL | ||
8 | # include <Evil.h> | ||
9 | #endif | ||
10 | |||
11 | #include <setjmp.h> | ||
12 | #include <jpeglib.h> | ||
13 | |||
14 | #include "evas_common.h" | ||
15 | #include "evas_private.h" | ||
16 | |||
17 | |||
18 | typedef struct _JPEG_error_mgr *emptr; | ||
19 | struct _JPEG_error_mgr | ||
20 | { | ||
21 | struct jpeg_error_mgr pub; | ||
22 | jmp_buf setjmp_buffer; | ||
23 | }; | ||
24 | |||
25 | static void _JPEGFatalErrorHandler(j_common_ptr cinfo); | ||
26 | static void _JPEGErrorHandler(j_common_ptr cinfo); | ||
27 | static void _JPEGErrorHandler2(j_common_ptr cinfo, int msg_level); | ||
28 | |||
29 | static Eina_Bool evas_image_load_file_head_jpeg_internal(Image_Entry *ie, | ||
30 | void *map, | ||
31 | size_t len, | ||
32 | int *error) EINA_ARG_NONNULL(1, 2, 4); | ||
33 | static Eina_Bool evas_image_load_file_data_jpeg_internal(Image_Entry *ie, | ||
34 | void *map, | ||
35 | size_t len, | ||
36 | int *error) EINA_ARG_NONNULL(1, 2, 4); | ||
37 | #if 0 /* not used at the moment */ | ||
38 | static int evas_image_load_file_data_jpeg_alpha_internal(Image_Entry *ie, FILE *f) EINA_ARG_NONNULL(1, 2); | ||
39 | #endif | ||
40 | |||
41 | static Eina_Bool evas_image_load_file_head_jpeg(Image_Entry *ie, const char *file, const char *key, int *error) EINA_ARG_NONNULL(1, 2, 4); | ||
42 | static Eina_Bool evas_image_load_file_data_jpeg(Image_Entry *ie, const char *file, const char *key, int *error) EINA_ARG_NONNULL(1, 2, 4); | ||
43 | |||
44 | static Evas_Image_Load_Func evas_image_load_jpeg_func = | ||
45 | { | ||
46 | EINA_TRUE, | ||
47 | evas_image_load_file_head_jpeg, | ||
48 | evas_image_load_file_data_jpeg, | ||
49 | NULL | ||
50 | }; | ||
51 | |||
52 | |||
53 | static void | ||
54 | _JPEGFatalErrorHandler(j_common_ptr cinfo) | ||
55 | { | ||
56 | emptr errmgr; | ||
57 | |||
58 | errmgr = (emptr) cinfo->err; | ||
59 | /* cinfo->err->output_message(cinfo);*/ | ||
60 | longjmp(errmgr->setjmp_buffer, 1); | ||
61 | return; | ||
62 | } | ||
63 | |||
64 | static void | ||
65 | _JPEGErrorHandler(j_common_ptr cinfo __UNUSED__) | ||
66 | { | ||
67 | /* emptr errmgr; */ | ||
68 | |||
69 | /* errmgr = (emptr) cinfo->err; */ | ||
70 | /* cinfo->err->output_message(cinfo);*/ | ||
71 | /* longjmp(errmgr->setjmp_buffer, 1);*/ | ||
72 | return; | ||
73 | } | ||
74 | |||
75 | static void | ||
76 | _JPEGErrorHandler2(j_common_ptr cinfo __UNUSED__, int msg_level __UNUSED__) | ||
77 | { | ||
78 | /* emptr errmgr; */ | ||
79 | |||
80 | /* errmgr = (emptr) cinfo->err; */ | ||
81 | /* cinfo->err->output_message(cinfo);*/ | ||
82 | /* longjmp(errmgr->setjmp_buffer, 1);*/ | ||
83 | return; | ||
84 | } | ||
85 | |||
86 | struct jpeg_membuf_src | ||
87 | { | ||
88 | struct jpeg_source_mgr pub; | ||
89 | |||
90 | const unsigned char *buf; | ||
91 | size_t len; | ||
92 | struct jpeg_membuf_src *self; | ||
93 | }; | ||
94 | |||
95 | static void | ||
96 | _evas_jpeg_membuf_src_init(j_decompress_ptr cinfo __UNUSED__) | ||
97 | { | ||
98 | } | ||
99 | |||
100 | static boolean | ||
101 | _evas_jpeg_membuf_src_fill(j_decompress_ptr cinfo) | ||
102 | { | ||
103 | static const JOCTET jpeg_eoi[2] = { 0xFF, JPEG_EOI }; | ||
104 | struct jpeg_membuf_src *src = (struct jpeg_membuf_src *)cinfo->src; | ||
105 | |||
106 | src->pub.bytes_in_buffer = sizeof(jpeg_eoi); | ||
107 | src->pub.next_input_byte = jpeg_eoi; | ||
108 | |||
109 | return TRUE; | ||
110 | } | ||
111 | |||
112 | static void | ||
113 | _evas_jpeg_membuf_src_skip(j_decompress_ptr cinfo, | ||
114 | long num_bytes) | ||
115 | { | ||
116 | struct jpeg_membuf_src *src = (struct jpeg_membuf_src *)cinfo->src; | ||
117 | |||
118 | if ((((long)src->pub.bytes_in_buffer - (long)src->len) > num_bytes) || | ||
119 | ((long)src->pub.bytes_in_buffer < num_bytes)) | ||
120 | { | ||
121 | (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)); | ||
122 | return; | ||
123 | } | ||
124 | src->pub.bytes_in_buffer -= num_bytes; | ||
125 | src->pub.next_input_byte += num_bytes; | ||
126 | } | ||
127 | |||
128 | static void | ||
129 | _evas_jpeg_membuf_src_term(j_decompress_ptr cinfo) | ||
130 | { | ||
131 | struct jpeg_membuf_src *src = (struct jpeg_membuf_src *)cinfo->src; | ||
132 | if (!src) return; | ||
133 | free(src); | ||
134 | cinfo->src = NULL; | ||
135 | } | ||
136 | |||
137 | static int | ||
138 | _evas_jpeg_membuf_src(j_decompress_ptr cinfo, | ||
139 | void *map, size_t length) | ||
140 | { | ||
141 | struct jpeg_membuf_src *src; | ||
142 | |||
143 | src = calloc(1, sizeof(*src)); | ||
144 | if (!src) | ||
145 | return -1; | ||
146 | |||
147 | src->self = src; | ||
148 | |||
149 | cinfo->src = &src->pub; | ||
150 | src->buf = map; | ||
151 | src->len = length; | ||
152 | src->pub.init_source = _evas_jpeg_membuf_src_init; | ||
153 | src->pub.fill_input_buffer = _evas_jpeg_membuf_src_fill; | ||
154 | src->pub.skip_input_data = _evas_jpeg_membuf_src_skip; | ||
155 | src->pub.resync_to_restart = jpeg_resync_to_restart; | ||
156 | src->pub.term_source = _evas_jpeg_membuf_src_term; | ||
157 | src->pub.bytes_in_buffer = src->len; | ||
158 | src->pub.next_input_byte = src->buf; | ||
159 | |||
160 | return 0; | ||
161 | } | ||
162 | |||
163 | /*! Magic number for EXIF header & App1*/ | ||
164 | static const unsigned char ExifHeader[] = {0x45, 0x78, 0x69, 0x66, 0x00, 0x00}; | ||
165 | static const unsigned char App1[] = {0xff, 0xe1}; | ||
166 | typedef enum { | ||
167 | EXIF_BYTE_ALIGN_II, | ||
168 | EXIF_BYTE_ALIGN_MM | ||
169 | } ExifByteAlign; | ||
170 | |||
171 | static int | ||
172 | _get_orientation(void *map, size_t length) | ||
173 | { | ||
174 | char *buf; | ||
175 | char orientation[2]; | ||
176 | ExifByteAlign byte_align; | ||
177 | unsigned int num_directory = 0; | ||
178 | unsigned int i, j; | ||
179 | int direction; | ||
180 | |||
181 | /* open file and get 22 byte frome file */ | ||
182 | if (!map) return 0; | ||
183 | /* 1. read 22byte */ | ||
184 | if (length < 22) return 0; | ||
185 | buf = (char *)map; | ||
186 | |||
187 | /* 2. check 2,3 bypte with APP1(0xFFE1) */ | ||
188 | if (memcmp(buf + 2, App1, sizeof (App1))) return 0; | ||
189 | |||
190 | /* 3. check 6~11bype with Exif Header (0x45786966 0000) */ | ||
191 | if (memcmp(buf + 6, ExifHeader, sizeof (ExifHeader))) return 0; | ||
192 | |||
193 | /* 4. get 12&13 byte get info of "II(0x4949)" or "MM(0x4d4d)" */ | ||
194 | /* 5. get [20]&[21] get directory entry # */ | ||
195 | if (!strncmp(buf + 12, "MM", 2)) | ||
196 | { | ||
197 | byte_align = EXIF_BYTE_ALIGN_MM; | ||
198 | num_directory = ((*(buf + 20) << 8) + *(buf + 21)); | ||
199 | orientation[0] = 0x01; | ||
200 | orientation[1] = 0x12; | ||
201 | } | ||
202 | else if (!strncmp(buf + 12, "II", 2)) | ||
203 | { | ||
204 | byte_align = EXIF_BYTE_ALIGN_II; | ||
205 | num_directory = ((*(buf + 21) << 8) + *(buf + 20)); | ||
206 | orientation[0] = 0x12; | ||
207 | orientation[1] = 0x01; | ||
208 | } | ||
209 | else return 0; | ||
210 | |||
211 | buf = map + 22; | ||
212 | |||
213 | if (length < (12 * num_directory + 22)) return 0; | ||
214 | |||
215 | j = 0; | ||
216 | |||
217 | for (i = 0; i < num_directory; i++ ) | ||
218 | { | ||
219 | if (!strncmp(buf + j, orientation, 2)) | ||
220 | { | ||
221 | /*get orientation tag */ | ||
222 | if (byte_align == EXIF_BYTE_ALIGN_MM) | ||
223 | direction = *(buf+ j + 11); | ||
224 | else direction = *(buf+ j + 8); | ||
225 | switch (direction) | ||
226 | { | ||
227 | case 3: | ||
228 | case 4: | ||
229 | return 180; | ||
230 | case 6: | ||
231 | case 7: | ||
232 | return 90; | ||
233 | case 5: | ||
234 | case 8: | ||
235 | return 270; | ||
236 | default: | ||
237 | return 0; | ||
238 | } | ||
239 | } | ||
240 | else | ||
241 | j = j + 12; | ||
242 | } | ||
243 | return 0; | ||
244 | } | ||
245 | |||
246 | static Eina_Bool | ||
247 | evas_image_load_file_head_jpeg_internal(Image_Entry *ie, | ||
248 | void *map, size_t length, | ||
249 | int *error) | ||
250 | { | ||
251 | unsigned int w, h, scalew, scaleh; | ||
252 | struct jpeg_decompress_struct cinfo; | ||
253 | struct _JPEG_error_mgr jerr; | ||
254 | |||
255 | /* for rotation decoding */ | ||
256 | int degree = 0; | ||
257 | Eina_Bool change_wh = EINA_FALSE; | ||
258 | unsigned int load_opts_w = 0, load_opts_h = 0; | ||
259 | |||
260 | cinfo.err = jpeg_std_error(&(jerr.pub)); | ||
261 | jerr.pub.error_exit = _JPEGFatalErrorHandler; | ||
262 | jerr.pub.emit_message = _JPEGErrorHandler2; | ||
263 | jerr.pub.output_message = _JPEGErrorHandler; | ||
264 | if (setjmp(jerr.setjmp_buffer)) | ||
265 | { | ||
266 | jpeg_destroy_decompress(&cinfo); | ||
267 | _evas_jpeg_membuf_src_term(&cinfo); | ||
268 | if (cinfo.saw_JFIF_marker) | ||
269 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; | ||
270 | else | ||
271 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; | ||
272 | return EINA_FALSE; | ||
273 | } | ||
274 | jpeg_create_decompress(&cinfo); | ||
275 | |||
276 | if (_evas_jpeg_membuf_src(&cinfo, map, length)) | ||
277 | { | ||
278 | jpeg_destroy_decompress(&cinfo); | ||
279 | _evas_jpeg_membuf_src_term(&cinfo); | ||
280 | *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; | ||
281 | return EINA_FALSE; | ||
282 | } | ||
283 | |||
284 | jpeg_read_header(&cinfo, TRUE); | ||
285 | cinfo.do_fancy_upsampling = FALSE; | ||
286 | cinfo.do_block_smoothing = FALSE; | ||
287 | cinfo.dct_method = JDCT_ISLOW; // JDCT_FLOAT JDCT_IFAST(quality loss) | ||
288 | cinfo.dither_mode = JDITHER_ORDERED; | ||
289 | jpeg_start_decompress(&cinfo); | ||
290 | |||
291 | /* rotation decoding */ | ||
292 | if (ie->load_opts.orientation) | ||
293 | { | ||
294 | degree = _get_orientation(map, length); | ||
295 | if (degree != 0) | ||
296 | { | ||
297 | ie->load_opts.degree = degree; | ||
298 | ie->flags.rotated = EINA_TRUE; | ||
299 | |||
300 | if (degree == 90 || degree == 270) | ||
301 | change_wh = EINA_TRUE; | ||
302 | } | ||
303 | |||
304 | } | ||
305 | |||
306 | /* head decoding */ | ||
307 | w = cinfo.output_width; | ||
308 | h = cinfo.output_height; | ||
309 | if ((w < 1) || (h < 1) || (w > IMG_MAX_SIZE) || (h > IMG_MAX_SIZE) || | ||
310 | (IMG_TOO_BIG(w, h))) | ||
311 | { | ||
312 | jpeg_destroy_decompress(&cinfo); | ||
313 | _evas_jpeg_membuf_src_term(&cinfo); | ||
314 | if (IMG_TOO_BIG(w, h)) | ||
315 | *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; | ||
316 | else | ||
317 | *error = EVAS_LOAD_ERROR_GENERIC; | ||
318 | return EINA_FALSE; | ||
319 | } | ||
320 | if (ie->load_opts.scale_down_by > 1) | ||
321 | { | ||
322 | w /= ie->load_opts.scale_down_by; | ||
323 | h /= ie->load_opts.scale_down_by; | ||
324 | } | ||
325 | else if (ie->load_opts.dpi > 0.0) | ||
326 | { | ||
327 | w = (w * ie->load_opts.dpi) / 90.0; | ||
328 | h = (h * ie->load_opts.dpi) / 90.0; | ||
329 | } | ||
330 | else if ((ie->load_opts.w > 0) && (ie->load_opts.h > 0)) | ||
331 | { | ||
332 | unsigned int w2 = w, h2 = h; | ||
333 | /* user set load_opts' w,h on the assumption | ||
334 | that image already rotated according to it's orientation info */ | ||
335 | if (change_wh) | ||
336 | { | ||
337 | load_opts_w = ie->load_opts.w; | ||
338 | load_opts_h = ie->load_opts.h; | ||
339 | ie->load_opts.w = load_opts_h; | ||
340 | ie->load_opts.h = load_opts_w; | ||
341 | } | ||
342 | |||
343 | if (ie->load_opts.w > 0) | ||
344 | { | ||
345 | w2 = ie->load_opts.w; | ||
346 | h2 = (ie->load_opts.w * h) / w; | ||
347 | if ((ie->load_opts.h > 0) && (h2 > ie->load_opts.h)) | ||
348 | { | ||
349 | unsigned int w3; | ||
350 | h2 = ie->load_opts.h; | ||
351 | w3 = (ie->load_opts.h * w) / h; | ||
352 | if (w3 > w2) | ||
353 | w2 = w3; | ||
354 | } | ||
355 | } | ||
356 | else if (ie->load_opts.h > 0) | ||
357 | { | ||
358 | h2 = ie->load_opts.h; | ||
359 | w2 = (ie->load_opts.h * w) / h; | ||
360 | } | ||
361 | w = w2; | ||
362 | h = h2; | ||
363 | if (change_wh) | ||
364 | { | ||
365 | ie->load_opts.w = load_opts_w; | ||
366 | ie->load_opts.h = load_opts_h; | ||
367 | } | ||
368 | } | ||
369 | if (w < 1) w = 1; | ||
370 | if (h < 1) h = 1; | ||
371 | |||
372 | if ((w != cinfo.output_width) || (h != cinfo.output_height)) | ||
373 | { | ||
374 | scalew = cinfo.output_width / w; | ||
375 | scaleh = cinfo.output_height / h; | ||
376 | |||
377 | ie->scale = scalew; | ||
378 | if (scaleh < scalew) ie->scale = scaleh; | ||
379 | |||
380 | if (ie->scale > 8) ie->scale = 8; | ||
381 | else if (ie->scale < 1) ie->scale = 1; | ||
382 | |||
383 | if (ie->scale == 3) ie->scale = 2; | ||
384 | else if (ie->scale == 5) ie->scale = 4; | ||
385 | else if (ie->scale == 6) ie->scale = 4; | ||
386 | else if (ie->scale == 7) ie->scale = 4; | ||
387 | } | ||
388 | |||
389 | if (ie->scale > 1) | ||
390 | { | ||
391 | jpeg_destroy_decompress(&cinfo); | ||
392 | _evas_jpeg_membuf_src_term(&cinfo); | ||
393 | jpeg_create_decompress(&cinfo); | ||
394 | |||
395 | if (_evas_jpeg_membuf_src(&cinfo, map, length)) | ||
396 | { | ||
397 | jpeg_destroy_decompress(&cinfo); | ||
398 | _evas_jpeg_membuf_src_term(&cinfo); | ||
399 | *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; | ||
400 | return EINA_FALSE; | ||
401 | } | ||
402 | |||
403 | jpeg_read_header(&cinfo, TRUE); | ||
404 | cinfo.do_fancy_upsampling = FALSE; | ||
405 | cinfo.do_block_smoothing = FALSE; | ||
406 | cinfo.scale_num = 1; | ||
407 | cinfo.scale_denom = ie->scale; | ||
408 | jpeg_calc_output_dimensions(&(cinfo)); | ||
409 | jpeg_start_decompress(&cinfo); | ||
410 | } | ||
411 | |||
412 | ie->w = cinfo.output_width; | ||
413 | ie->h = cinfo.output_height; | ||
414 | |||
415 | // be nice and clip region to image. if its totally outside, fail load | ||
416 | if ((ie->load_opts.region.w > 0) && (ie->load_opts.region.h > 0)) | ||
417 | { | ||
418 | unsigned int load_region_x = 0, load_region_y = 0; | ||
419 | unsigned int load_region_w = 0, load_region_h = 0; | ||
420 | if (ie->flags.rotated) | ||
421 | { | ||
422 | load_region_x = ie->load_opts.region.x; | ||
423 | load_region_y = ie->load_opts.region.y; | ||
424 | load_region_w = ie->load_opts.region.w; | ||
425 | load_region_h = ie->load_opts.region.h; | ||
426 | |||
427 | switch (degree) | ||
428 | { | ||
429 | case 90: | ||
430 | ie->load_opts.region.x = load_region_y; | ||
431 | ie->load_opts.region.y = h - (load_region_x + load_region_w); | ||
432 | ie->load_opts.region.w = load_region_h; | ||
433 | ie->load_opts.region.h = load_region_w; | ||
434 | break; | ||
435 | case 180: | ||
436 | ie->load_opts.region.x = w - (load_region_x+ load_region_w); | ||
437 | ie->load_opts.region.y = h - (load_region_y + load_region_h); | ||
438 | |||
439 | break; | ||
440 | case 270: | ||
441 | ie->load_opts.region.x = w - (load_region_y + load_region_h); | ||
442 | ie->load_opts.region.y = load_region_x; | ||
443 | ie->load_opts.region.w = load_region_h; | ||
444 | ie->load_opts.region.h = load_region_w; | ||
445 | break; | ||
446 | default: | ||
447 | break; | ||
448 | } | ||
449 | |||
450 | } | ||
451 | RECTS_CLIP_TO_RECT(ie->load_opts.region.x, ie->load_opts.region.y, | ||
452 | ie->load_opts.region.w, ie->load_opts.region.h, | ||
453 | 0, 0, ie->w, ie->h); | ||
454 | if ((ie->load_opts.region.w <= 0) || (ie->load_opts.region.h <= 0)) | ||
455 | { | ||
456 | jpeg_destroy_decompress(&cinfo); | ||
457 | _evas_jpeg_membuf_src_term(&cinfo); | ||
458 | *error = EVAS_LOAD_ERROR_GENERIC; | ||
459 | return EINA_FALSE; | ||
460 | } | ||
461 | ie->w = ie->load_opts.region.w; | ||
462 | ie->h = ie->load_opts.region.h; | ||
463 | if (ie->flags.rotated) | ||
464 | { | ||
465 | ie->load_opts.region.x = load_region_x; | ||
466 | ie->load_opts.region.y = load_region_y; | ||
467 | ie->load_opts.region.w = load_region_w; | ||
468 | ie->load_opts.region.h = load_region_h; | ||
469 | } | ||
470 | } | ||
471 | /* end head decoding */ | ||
472 | |||
473 | if (change_wh) | ||
474 | { | ||
475 | unsigned int tmp; | ||
476 | tmp = ie->w; | ||
477 | ie->w = ie->h; | ||
478 | ie->h = tmp; | ||
479 | } | ||
480 | jpeg_destroy_decompress(&cinfo); | ||
481 | _evas_jpeg_membuf_src_term(&cinfo); | ||
482 | *error = EVAS_LOAD_ERROR_NONE; | ||
483 | return EINA_TRUE; | ||
484 | } | ||
485 | |||
486 | /* | ||
487 | static double | ||
488 | get_time(void) | ||
489 | { | ||
490 | struct timeval timev; | ||
491 | |||
492 | gettimeofday(&timev, NULL); | ||
493 | return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000); | ||
494 | } | ||
495 | */ | ||
496 | |||
497 | static Eina_Bool | ||
498 | evas_image_load_file_data_jpeg_internal(Image_Entry *ie, | ||
499 | void *map, size_t size, | ||
500 | int *error) | ||
501 | { | ||
502 | unsigned int w, h; | ||
503 | struct jpeg_decompress_struct cinfo; | ||
504 | struct _JPEG_error_mgr jerr; | ||
505 | DATA8 *ptr, *line[16], *data; | ||
506 | DATA32 *ptr2, *ptr_rotate = NULL; | ||
507 | unsigned int x, y, l, i, scans; | ||
508 | int region = 0; | ||
509 | /* rotation setting */ | ||
510 | unsigned int tmp; | ||
511 | unsigned int load_region_x = 0, load_region_y = 0; | ||
512 | unsigned int load_region_w = 0, load_region_h = 0; | ||
513 | int degree = 0; | ||
514 | Eina_Bool change_wh = EINA_FALSE; | ||
515 | Eina_Bool line_done = EINA_FALSE; | ||
516 | |||
517 | if (ie->flags.rotated) | ||
518 | { | ||
519 | degree = ie->load_opts.degree; | ||
520 | if (degree == 90 || degree == 270) | ||
521 | change_wh = EINA_TRUE; | ||
522 | } | ||
523 | |||
524 | cinfo.err = jpeg_std_error(&(jerr.pub)); | ||
525 | jerr.pub.error_exit = _JPEGFatalErrorHandler; | ||
526 | jerr.pub.emit_message = _JPEGErrorHandler2; | ||
527 | jerr.pub.output_message = _JPEGErrorHandler; | ||
528 | if (setjmp(jerr.setjmp_buffer)) | ||
529 | { | ||
530 | jpeg_destroy_decompress(&cinfo); | ||
531 | _evas_jpeg_membuf_src_term(&cinfo); | ||
532 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; | ||
533 | return EINA_FALSE; | ||
534 | } | ||
535 | jpeg_create_decompress(&cinfo); | ||
536 | |||
537 | if (_evas_jpeg_membuf_src(&cinfo, map, size)) | ||
538 | { | ||
539 | jpeg_destroy_decompress(&cinfo); | ||
540 | _evas_jpeg_membuf_src_term(&cinfo); | ||
541 | *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; | ||
542 | return 0; | ||
543 | } | ||
544 | |||
545 | jpeg_read_header(&cinfo, TRUE); | ||
546 | cinfo.do_fancy_upsampling = FALSE; | ||
547 | cinfo.do_block_smoothing = FALSE; | ||
548 | cinfo.dct_method = JDCT_ISLOW; // JDCT_FLOAT JDCT_IFAST(quality loss) | ||
549 | cinfo.dither_mode = JDITHER_ORDERED; | ||
550 | |||
551 | if (ie->scale > 1) | ||
552 | { | ||
553 | cinfo.scale_num = 1; | ||
554 | cinfo.scale_denom = ie->scale; | ||
555 | } | ||
556 | |||
557 | /* Colorspace conversion options */ | ||
558 | /* libjpeg can do the following conversions: */ | ||
559 | /* GRAYSCLAE => RGB YCbCr => RGB and YCCK => CMYK */ | ||
560 | switch (cinfo.jpeg_color_space) | ||
561 | { | ||
562 | case JCS_UNKNOWN: | ||
563 | break; | ||
564 | case JCS_GRAYSCALE: | ||
565 | case JCS_RGB: | ||
566 | case JCS_YCbCr: | ||
567 | cinfo.out_color_space = JCS_RGB; | ||
568 | break; | ||
569 | case JCS_CMYK: | ||
570 | case JCS_YCCK: | ||
571 | cinfo.out_color_space = JCS_CMYK; | ||
572 | break; | ||
573 | } | ||
574 | |||
575 | /* head decoding */ | ||
576 | jpeg_calc_output_dimensions(&(cinfo)); | ||
577 | jpeg_start_decompress(&cinfo); | ||
578 | |||
579 | w = cinfo.output_width; | ||
580 | h = cinfo.output_height; | ||
581 | |||
582 | if (change_wh) | ||
583 | { | ||
584 | tmp = ie->w; | ||
585 | ie->w = ie->h; | ||
586 | ie->h = tmp; | ||
587 | } | ||
588 | |||
589 | if ((ie->load_opts.region.w > 0) && (ie->load_opts.region.h > 0)) | ||
590 | { | ||
591 | region = 1; | ||
592 | |||
593 | if (ie->flags.rotated) | ||
594 | { | ||
595 | load_region_x = ie->load_opts.region.x; | ||
596 | load_region_y = ie->load_opts.region.y; | ||
597 | load_region_w = ie->load_opts.region.w; | ||
598 | load_region_h = ie->load_opts.region.h; | ||
599 | |||
600 | switch (degree) | ||
601 | { | ||
602 | case 90: | ||
603 | ie->load_opts.region.x = load_region_y; | ||
604 | ie->load_opts.region.y = h - (load_region_x + load_region_w); | ||
605 | ie->load_opts.region.w = load_region_h; | ||
606 | ie->load_opts.region.h = load_region_w; | ||
607 | break; | ||
608 | case 180: | ||
609 | ie->load_opts.region.x = w - (load_region_x+ load_region_w); | ||
610 | ie->load_opts.region.y = h - (load_region_y + load_region_h); | ||
611 | |||
612 | break; | ||
613 | case 270: | ||
614 | ie->load_opts.region.x = w - (load_region_y + load_region_h); | ||
615 | ie->load_opts.region.y = load_region_x; | ||
616 | ie->load_opts.region.w = load_region_h; | ||
617 | ie->load_opts.region.h = load_region_w; | ||
618 | break; | ||
619 | default: | ||
620 | break; | ||
621 | } | ||
622 | |||
623 | } | ||
624 | #ifdef BUILD_LOADER_JPEG_REGION | ||
625 | cinfo.region_x = ie->load_opts.region.x; | ||
626 | cinfo.region_y = ie->load_opts.region.y; | ||
627 | cinfo.region_w = ie->load_opts.region.w; | ||
628 | cinfo.region_h = ie->load_opts.region.h; | ||
629 | #endif | ||
630 | } | ||
631 | if ((!region) && ((w != ie->w) || (h != ie->h))) | ||
632 | { | ||
633 | // race condition, the file could have change from when we call header | ||
634 | // this test will not solve the problem with region code. | ||
635 | jpeg_destroy_decompress(&cinfo); | ||
636 | _evas_jpeg_membuf_src_term(&cinfo); | ||
637 | *error = EVAS_LOAD_ERROR_GENERIC; | ||
638 | return EINA_FALSE; | ||
639 | } | ||
640 | if ((region) && | ||
641 | ((ie->w != ie->load_opts.region.w) || (ie->h != ie->load_opts.region.h))) | ||
642 | { | ||
643 | ie->w = ie->load_opts.region.w; | ||
644 | ie->h = ie->load_opts.region.h; | ||
645 | } | ||
646 | |||
647 | if (!(((cinfo.out_color_space == JCS_RGB) && | ||
648 | ((cinfo.output_components == 3) || (cinfo.output_components == 1))) || | ||
649 | ((cinfo.out_color_space == JCS_CMYK) && (cinfo.output_components == 4)))) | ||
650 | { | ||
651 | jpeg_destroy_decompress(&cinfo); | ||
652 | _evas_jpeg_membuf_src_term(&cinfo); | ||
653 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; | ||
654 | return EINA_FALSE; | ||
655 | } | ||
656 | |||
657 | /* end head decoding */ | ||
658 | /* data decoding */ | ||
659 | if (cinfo.rec_outbuf_height > 16) | ||
660 | { | ||
661 | jpeg_destroy_decompress(&cinfo); | ||
662 | _evas_jpeg_membuf_src_term(&cinfo); | ||
663 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; | ||
664 | return EINA_FALSE; | ||
665 | } | ||
666 | data = alloca(w * 16 * cinfo.output_components); | ||
667 | evas_cache_image_surface_alloc(ie, ie->w, ie->h); | ||
668 | if (ie->flags.loaded) | ||
669 | { | ||
670 | jpeg_destroy_decompress(&cinfo); | ||
671 | _evas_jpeg_membuf_src_term(&cinfo); | ||
672 | *error = EVAS_LOAD_ERROR_NONE; | ||
673 | if (region && ie->flags.rotated) | ||
674 | { | ||
675 | ie->load_opts.region.x = load_region_x; | ||
676 | ie->load_opts.region.y = load_region_y; | ||
677 | ie->load_opts.region.w = load_region_w; | ||
678 | ie->load_opts.region.h = load_region_h; | ||
679 | } | ||
680 | return EINA_TRUE; | ||
681 | } | ||
682 | if ((ie->flags.rotated) && change_wh) | ||
683 | { | ||
684 | ptr2 = malloc(ie->w * ie->h * sizeof(DATA32)); | ||
685 | ptr_rotate = ptr2; | ||
686 | } | ||
687 | else | ||
688 | ptr2 = evas_cache_image_pixels(ie); | ||
689 | |||
690 | if (!ptr2) | ||
691 | { | ||
692 | *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; | ||
693 | return EINA_FALSE; | ||
694 | } | ||
695 | |||
696 | /* We handle first CMYK (4 components) */ | ||
697 | if (cinfo.output_components == 4) | ||
698 | { | ||
699 | // FIXME: handle region | ||
700 | for (i = 0; (int)i < cinfo.rec_outbuf_height; i++) | ||
701 | line[i] = data + (i * w * 4); | ||
702 | for (l = 0; l < h; l += cinfo.rec_outbuf_height) | ||
703 | { | ||
704 | jpeg_read_scanlines(&cinfo, line, cinfo.rec_outbuf_height); | ||
705 | scans = cinfo.rec_outbuf_height; | ||
706 | if ((h - l) < scans) scans = h - l; | ||
707 | ptr = data; | ||
708 | if (!region) | ||
709 | { | ||
710 | for (y = 0; y < scans; y++) | ||
711 | { | ||
712 | if (cinfo.saw_Adobe_marker) | ||
713 | { | ||
714 | for (x = 0; x < w; x++) | ||
715 | { | ||
716 | /* According to libjpeg doc, Photoshop inverse the values of C, M, Y and K, */ | ||
717 | /* that is C is replaces by 255 - C, etc...*/ | ||
718 | /* See the comment below for the computation of RGB values from CMYK ones. */ | ||
719 | *ptr2 = | ||
720 | (0xff000000) | | ||
721 | ((ptr[0] * ptr[3] / 255) << 16) | | ||
722 | ((ptr[1] * ptr[3] / 255) << 8) | | ||
723 | ((ptr[2] * ptr[3] / 255)); | ||
724 | ptr += 4; | ||
725 | ptr2++; | ||
726 | } | ||
727 | } | ||
728 | else | ||
729 | { | ||
730 | for (x = 0; x < w; x++) | ||
731 | { | ||
732 | /* Conversion from CMYK to RGB is done in 2 steps: */ | ||
733 | /* CMYK => CMY => RGB (see http://www.easyrgb.com/index.php?X=MATH) */ | ||
734 | /* after computation, if C, M, Y and K are between 0 and 1, we have: */ | ||
735 | /* R = (1 - C) * (1 - K) * 255 */ | ||
736 | /* G = (1 - M) * (1 - K) * 255 */ | ||
737 | /* B = (1 - Y) * (1 - K) * 255 */ | ||
738 | /* libjpeg stores CMYK values between 0 and 255, */ | ||
739 | /* so we replace C by C * 255 / 255, etc... and we obtain: */ | ||
740 | /* R = (255 - C) * (255 - K) / 255 */ | ||
741 | /* G = (255 - M) * (255 - K) / 255 */ | ||
742 | /* B = (255 - Y) * (255 - K) / 255 */ | ||
743 | /* with C, M, Y and K between 0 and 255. */ | ||
744 | *ptr2 = | ||
745 | (0xff000000) | | ||
746 | (((255 - ptr[0]) * (255 - ptr[3]) / 255) << 16) | | ||
747 | (((255 - ptr[1]) * (255 - ptr[3]) / 255) << 8) | | ||
748 | (((255 - ptr[2]) * (255 - ptr[3]) / 255)); | ||
749 | ptr += 4; | ||
750 | ptr2++; | ||
751 | } | ||
752 | } | ||
753 | } | ||
754 | } | ||
755 | else | ||
756 | { | ||
757 | // if line # > region last line, break | ||
758 | if (l >= (ie->load_opts.region.y + ie->load_opts.region.h)) | ||
759 | { | ||
760 | line_done = EINA_TRUE; | ||
761 | /* if rotation flag is set , we have to rotate image */ | ||
762 | goto done; | ||
763 | /*jpeg_destroy_decompress(&cinfo); | ||
764 | _evas_jpeg_membuf_src_term(&cinfo); | ||
765 | *error = EVAS_LOAD_ERROR_NONE; | ||
766 | return EINA_FALSE;*/ | ||
767 | } | ||
768 | // els if scan block intersects region start or later | ||
769 | else if ((l + scans) > | ||
770 | (ie->load_opts.region.y)) | ||
771 | { | ||
772 | for (y = 0; y < scans; y++) | ||
773 | { | ||
774 | if (((y + l) >= ie->load_opts.region.y) && | ||
775 | ((y + l) < (ie->load_opts.region.y + ie->load_opts.region.h))) | ||
776 | { | ||
777 | ptr += ie->load_opts.region.x; | ||
778 | if (cinfo.saw_Adobe_marker) | ||
779 | { | ||
780 | for (x = 0; x < ie->load_opts.region.w; x++) | ||
781 | { | ||
782 | /* According to libjpeg doc, Photoshop inverse the values of C, M, Y and K, */ | ||
783 | /* that is C is replaces by 255 - C, etc...*/ | ||
784 | /* See the comment below for the computation of RGB values from CMYK ones. */ | ||
785 | *ptr2 = | ||
786 | (0xff000000) | | ||
787 | ((ptr[0] * ptr[3] / 255) << 16) | | ||
788 | ((ptr[1] * ptr[3] / 255) << 8) | | ||
789 | ((ptr[2] * ptr[3] / 255)); | ||
790 | ptr += 4; | ||
791 | ptr2++; | ||
792 | } | ||
793 | } | ||
794 | else | ||
795 | { | ||
796 | for (x = 0; x < ie->load_opts.region.w; x++) | ||
797 | { | ||
798 | /* Conversion from CMYK to RGB is done in 2 steps: */ | ||
799 | /* CMYK => CMY => RGB (see http://www.easyrgb.com/index.php?X=MATH) */ | ||
800 | /* after computation, if C, M, Y and K are between 0 and 1, we have: */ | ||
801 | /* R = (1 - C) * (1 - K) * 255 */ | ||
802 | /* G = (1 - M) * (1 - K) * 255 */ | ||
803 | /* B = (1 - Y) * (1 - K) * 255 */ | ||
804 | /* libjpeg stores CMYK values between 0 and 255, */ | ||
805 | /* so we replace C by C * 255 / 255, etc... and we obtain: */ | ||
806 | /* R = (255 - C) * (255 - K) / 255 */ | ||
807 | /* G = (255 - M) * (255 - K) / 255 */ | ||
808 | /* B = (255 - Y) * (255 - K) / 255 */ | ||
809 | /* with C, M, Y and K between 0 and 255. */ | ||
810 | *ptr2 = | ||
811 | (0xff000000) | | ||
812 | (((255 - ptr[0]) * (255 - ptr[3]) / 255) << 16) | | ||
813 | (((255 - ptr[1]) * (255 - ptr[3]) / 255) << 8) | | ||
814 | (((255 - ptr[2]) * (255 - ptr[3]) / 255)); | ||
815 | ptr += 4; | ||
816 | ptr2++; | ||
817 | } | ||
818 | } | ||
819 | ptr += (4 * (w - (ie->load_opts.region.x + ie->load_opts.region.w))); | ||
820 | } | ||
821 | else | ||
822 | ptr += (4 * w); | ||
823 | } | ||
824 | } | ||
825 | } | ||
826 | } | ||
827 | } | ||
828 | /* We handle then RGB with 3 components */ | ||
829 | else if (cinfo.output_components == 3) | ||
830 | { | ||
831 | /* | ||
832 | double t; | ||
833 | if (region) | ||
834 | { | ||
835 | // debug for now | ||
836 | printf("R| %p %5ix%5i %s: %5i %5i %5ix%5i - ", | ||
837 | ie, | ||
838 | ie->w, ie->h, | ||
839 | ie->file, | ||
840 | ie->load_opts.region.x, | ||
841 | ie->load_opts.region.y, | ||
842 | ie->load_opts.region.w, | ||
843 | ie->load_opts.region.h); | ||
844 | } | ||
845 | t = get_time(); | ||
846 | */ | ||
847 | for (i = 0; (int)i < cinfo.rec_outbuf_height; i++) | ||
848 | line[i] = data + (i * w * 3); | ||
849 | for (l = 0; l < h; l += cinfo.rec_outbuf_height) | ||
850 | { | ||
851 | jpeg_read_scanlines(&cinfo, line, cinfo.rec_outbuf_height); | ||
852 | scans = cinfo.rec_outbuf_height; | ||
853 | if ((h - l) < scans) scans = h - l; | ||
854 | ptr = data; | ||
855 | if (!region) | ||
856 | { | ||
857 | for (y = 0; y < scans; y++) | ||
858 | { | ||
859 | for (x = 0; x < w; x++) | ||
860 | { | ||
861 | *ptr2 = ARGB_JOIN(0xff, ptr[0], ptr[1], ptr[2]); | ||
862 | ptr += 3; | ||
863 | ptr2++; | ||
864 | } | ||
865 | } | ||
866 | } | ||
867 | else | ||
868 | { | ||
869 | // if line # > region last line, break | ||
870 | // but not return immediately for rotation job | ||
871 | if (l >= (ie->load_opts.region.y + ie->load_opts.region.h)) | ||
872 | { | ||
873 | line_done = EINA_TRUE; | ||
874 | /* if rotation flag is set , we have to rotate image */ | ||
875 | goto done; | ||
876 | } | ||
877 | // else if scan block intersects region start or later | ||
878 | else if ((l + scans) > | ||
879 | (ie->load_opts.region.y)) | ||
880 | { | ||
881 | for (y = 0; y < scans; y++) | ||
882 | { | ||
883 | if (((y + l) >= ie->load_opts.region.y) && | ||
884 | ((y + l) < (ie->load_opts.region.y + ie->load_opts.region.h))) | ||
885 | { | ||
886 | ptr += (3 * ie->load_opts.region.x); | ||
887 | for (x = 0; x < ie->load_opts.region.w; x++) | ||
888 | { | ||
889 | *ptr2 = ARGB_JOIN(0xff, ptr[0], ptr[1], ptr[2]); | ||
890 | ptr += 3; | ||
891 | ptr2++; | ||
892 | } | ||
893 | ptr += (3 * (w - (ie->load_opts.region.x + ie->load_opts.region.w))); | ||
894 | } | ||
895 | else | ||
896 | ptr += (3 * w); | ||
897 | } | ||
898 | } | ||
899 | } | ||
900 | } | ||
901 | /* | ||
902 | t = get_time() - t; | ||
903 | printf("%3.3f\n", t); | ||
904 | */ | ||
905 | } | ||
906 | /* We finally handle RGB with 1 component */ | ||
907 | else if (cinfo.output_components == 1) | ||
908 | { | ||
909 | for (i = 0; (int)i < cinfo.rec_outbuf_height; i++) | ||
910 | line[i] = data + (i * w); | ||
911 | for (l = 0; l < h; l += cinfo.rec_outbuf_height) | ||
912 | { | ||
913 | jpeg_read_scanlines(&cinfo, line, cinfo.rec_outbuf_height); | ||
914 | scans = cinfo.rec_outbuf_height; | ||
915 | if ((h - l) < scans) scans = h - l; | ||
916 | ptr = data; | ||
917 | if (!region) | ||
918 | { | ||
919 | for (y = 0; y < scans; y++) | ||
920 | { | ||
921 | for (x = 0; x < w; x++) | ||
922 | { | ||
923 | *ptr2 = ARGB_JOIN(0xff, ptr[0], ptr[0], ptr[0]); | ||
924 | ptr++; | ||
925 | ptr2++; | ||
926 | } | ||
927 | } | ||
928 | } | ||
929 | else | ||
930 | { | ||
931 | // if line # > region last line, break | ||
932 | if (l >= (ie->load_opts.region.y + ie->load_opts.region.h)) | ||
933 | { | ||
934 | line_done = EINA_TRUE; | ||
935 | /* if rotation flag is set , we have to rotate image */ | ||
936 | goto done; | ||
937 | /*jpeg_destroy_decompress(&cinfo); | ||
938 | _evas_jpeg_membuf_src_term(&cinfo); | ||
939 | *error = EVAS_LOAD_ERROR_NONE; | ||
940 | return EINA_TRUE;*/ | ||
941 | } | ||
942 | // els if scan block intersects region start or later | ||
943 | else if ((l + scans) > | ||
944 | (ie->load_opts.region.y)) | ||
945 | { | ||
946 | for (y = 0; y < scans; y++) | ||
947 | { | ||
948 | if (((y + l) >= ie->load_opts.region.y) && | ||
949 | ((y + l) < (ie->load_opts.region.y + ie->load_opts.region.h))) | ||
950 | { | ||
951 | ptr += ie->load_opts.region.x; | ||
952 | for (x = 0; x < ie->load_opts.region.w; x++) | ||
953 | { | ||
954 | *ptr2 = ARGB_JOIN(0xff, ptr[0], ptr[0], ptr[0]); | ||
955 | ptr++; | ||
956 | ptr2++; | ||
957 | } | ||
958 | ptr += w - (ie->load_opts.region.x + ie->load_opts.region.w); | ||
959 | } | ||
960 | else | ||
961 | ptr += w; | ||
962 | } | ||
963 | } | ||
964 | } | ||
965 | } | ||
966 | } | ||
967 | /* if rotation operation need, rotate it */ | ||
968 | done: | ||
969 | |||
970 | if (ie->flags.rotated) | ||
971 | { | ||
972 | DATA32 *data1, *data2, *to, *from; | ||
973 | int x, y, w, h, hw; | ||
974 | |||
975 | if (change_wh) | ||
976 | { | ||
977 | tmp = ie->w; | ||
978 | ie->w = ie->h; | ||
979 | ie->h = tmp; | ||
980 | } | ||
981 | |||
982 | w = ie->w; | ||
983 | h = ie->h; | ||
984 | hw =w * h; | ||
985 | |||
986 | data1 = evas_cache_image_pixels(ie); | ||
987 | |||
988 | if (degree == 180) | ||
989 | { | ||
990 | DATA32 tmp; | ||
991 | |||
992 | data2 = data1 + (h * w) -1; | ||
993 | for (x = (w * h) / 2; --x >= 0;) | ||
994 | { | ||
995 | tmp = *data1; | ||
996 | *data1 = *data2; | ||
997 | *data2 = tmp; | ||
998 | data1++; | ||
999 | data2--; | ||
1000 | } | ||
1001 | } | ||
1002 | else | ||
1003 | { | ||
1004 | data2 = NULL; | ||
1005 | to = NULL; | ||
1006 | if (ptr_rotate) data2 = ptr_rotate; | ||
1007 | |||
1008 | if (degree == 90) | ||
1009 | { | ||
1010 | to = data1 + w - 1; | ||
1011 | hw = -hw - 1; | ||
1012 | } | ||
1013 | else if (degree == 270) | ||
1014 | { | ||
1015 | to = data1 + hw - w; | ||
1016 | w = -w; | ||
1017 | hw = hw + 1; | ||
1018 | } | ||
1019 | |||
1020 | if (to) | ||
1021 | { | ||
1022 | from = data2; | ||
1023 | for (x = ie->w; --x >= 0;) | ||
1024 | { | ||
1025 | for (y =ie->h; --y >= 0;) | ||
1026 | { | ||
1027 | *to = *from; | ||
1028 | from++; | ||
1029 | to += w; | ||
1030 | } | ||
1031 | to += hw; | ||
1032 | } | ||
1033 | } | ||
1034 | if (ptr_rotate) | ||
1035 | { | ||
1036 | free(ptr_rotate); | ||
1037 | ptr_rotate = NULL; | ||
1038 | } | ||
1039 | } | ||
1040 | if (region) | ||
1041 | { | ||
1042 | ie->load_opts.region.x = load_region_x; | ||
1043 | ie->load_opts.region.y = load_region_y; | ||
1044 | ie->load_opts.region.w = load_region_w; | ||
1045 | ie->load_opts.region.h = load_region_h; | ||
1046 | } | ||
1047 | } | ||
1048 | if (line_done) | ||
1049 | { | ||
1050 | jpeg_destroy_decompress(&cinfo); | ||
1051 | _evas_jpeg_membuf_src_term(&cinfo); | ||
1052 | *error = EVAS_LOAD_ERROR_NONE; | ||
1053 | return EINA_FALSE; | ||
1054 | } | ||
1055 | /* end data decoding */ | ||
1056 | jpeg_finish_decompress(&cinfo); | ||
1057 | jpeg_destroy_decompress(&cinfo); | ||
1058 | _evas_jpeg_membuf_src_term(&cinfo); | ||
1059 | *error = EVAS_LOAD_ERROR_NONE; | ||
1060 | return EINA_TRUE; | ||
1061 | } | ||
1062 | |||
1063 | #if 0 /* not used at the moment */ | ||
1064 | static Eina_Bool | ||
1065 | evas_image_load_file_data_jpeg_alpha_internal(Image_Entry *ie, FILE *f, int *error) | ||
1066 | { | ||
1067 | int w, h; | ||
1068 | struct jpeg_decompress_struct cinfo; | ||
1069 | struct _JPEG_error_mgr jerr; | ||
1070 | DATA8 *ptr, *line[16], *data; | ||
1071 | DATA32 *ptr2; | ||
1072 | int x, y, l, i, scans, prevy; | ||
1073 | |||
1074 | if (!f) | ||
1075 | { | ||
1076 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; | ||
1077 | return EINA_FALSE; | ||
1078 | } | ||
1079 | cinfo.err = jpeg_std_error(&(jerr.pub)); | ||
1080 | jerr.pub.error_exit = _JPEGFatalErrorHandler; | ||
1081 | jerr.pub.emit_message = _JPEGErrorHandler2; | ||
1082 | jerr.pub.output_message = _JPEGErrorHandler; | ||
1083 | if (setjmp(jerr.setjmp_buffer)) | ||
1084 | { | ||
1085 | jpeg_destroy_decompress(&cinfo); | ||
1086 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; | ||
1087 | return EINA_FALSE; | ||
1088 | } | ||
1089 | jpeg_create_decompress(&cinfo); | ||
1090 | jpeg_stdio_src(&cinfo, f); | ||
1091 | jpeg_read_header(&cinfo, TRUE); | ||
1092 | cinfo.do_fancy_upsampling = FALSE; | ||
1093 | cinfo.do_block_smoothing = FALSE; | ||
1094 | jpeg_start_decompress(&cinfo); | ||
1095 | |||
1096 | /* head decoding */ | ||
1097 | ie->w = w = cinfo.output_width; | ||
1098 | ie->h = h = cinfo.output_height; | ||
1099 | /* end head decoding */ | ||
1100 | /* data decoding */ | ||
1101 | if (cinfo.rec_outbuf_height > 16) | ||
1102 | { | ||
1103 | jpeg_destroy_decompress(&cinfo); | ||
1104 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; | ||
1105 | return EINA_FALSE;; | ||
1106 | } | ||
1107 | data = alloca(w * 16 * 3); | ||
1108 | if (!ie->flags.loaded) | ||
1109 | { | ||
1110 | jpeg_destroy_decompress(&cinfo); | ||
1111 | *error = EVAS_LOAD_ERROR_NONE; | ||
1112 | return EINA_TRUE; | ||
1113 | } | ||
1114 | ptr2 = evas_cache_image_pixels(ie); | ||
1115 | prevy = 0; | ||
1116 | if (cinfo.output_components == 3) | ||
1117 | { | ||
1118 | for (i = 0; i < cinfo.rec_outbuf_height; i++) | ||
1119 | line[i] = data + (i * w * 3); | ||
1120 | for (l = 0; l < h; l += cinfo.rec_outbuf_height) | ||
1121 | { | ||
1122 | jpeg_read_scanlines(&cinfo, line, cinfo.rec_outbuf_height); | ||
1123 | scans = cinfo.rec_outbuf_height; | ||
1124 | if ((h - l) < scans) scans = h - l; | ||
1125 | ptr = data; | ||
1126 | for (y = 0; y < scans; y++) | ||
1127 | { | ||
1128 | for (x = 0; x < w; x++) | ||
1129 | { | ||
1130 | *ptr2 = | ||
1131 | ((*ptr2) & 0x00ffffff) | | ||
1132 | (((ptr[0] + ptr[1] + ptr[2]) / 3) << 24); | ||
1133 | ptr += 3; | ||
1134 | ptr2++; | ||
1135 | } | ||
1136 | } | ||
1137 | } | ||
1138 | } | ||
1139 | else if (cinfo.output_components == 1) | ||
1140 | { | ||
1141 | for (i = 0; i < cinfo.rec_outbuf_height; i++) | ||
1142 | line[i] = data + (i * w); | ||
1143 | for (l = 0; l < h; l += cinfo.rec_outbuf_height) | ||
1144 | { | ||
1145 | jpeg_read_scanlines(&cinfo, line, cinfo.rec_outbuf_height); | ||
1146 | scans = cinfo.rec_outbuf_height; | ||
1147 | if ((h - l) < scans) scans = h - l; | ||
1148 | ptr = data; | ||
1149 | for (y = 0; y < scans; y++) | ||
1150 | { | ||
1151 | for (x = 0; x < w; x++) | ||
1152 | { | ||
1153 | *ptr2 = | ||
1154 | ((*ptr2) & 0x00ffffff) | | ||
1155 | ((ptr[0]) << 24); | ||
1156 | ptr++; | ||
1157 | ptr2++; | ||
1158 | } | ||
1159 | } | ||
1160 | } | ||
1161 | } | ||
1162 | /* end data decoding */ | ||
1163 | jpeg_finish_decompress(&cinfo); | ||
1164 | jpeg_destroy_decompress(&cinfo); | ||
1165 | *error = EVAS_LOAD_ERROR_NONE; | ||
1166 | return EINA_TRUE; | ||
1167 | } | ||
1168 | #endif | ||
1169 | |||
1170 | static Eina_Bool | ||
1171 | evas_image_load_file_head_jpeg(Image_Entry *ie, | ||
1172 | const char *file, const char *key __UNUSED__, | ||
1173 | int *error) | ||
1174 | { | ||
1175 | Eina_File *f; | ||
1176 | void *map; | ||
1177 | Eina_Bool val = EINA_FALSE; | ||
1178 | |||
1179 | f = eina_file_open(file, EINA_FALSE); | ||
1180 | if (!f) | ||
1181 | { | ||
1182 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; | ||
1183 | return EINA_FALSE; | ||
1184 | } | ||
1185 | map = eina_file_map_all(f, EINA_FILE_WILLNEED); | ||
1186 | if (!map) | ||
1187 | { | ||
1188 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; | ||
1189 | goto on_error; | ||
1190 | } | ||
1191 | |||
1192 | val = evas_image_load_file_head_jpeg_internal(ie, | ||
1193 | map, eina_file_size_get(f), | ||
1194 | error); | ||
1195 | |||
1196 | eina_file_map_free(f, map); | ||
1197 | |||
1198 | on_error: | ||
1199 | eina_file_close(f); | ||
1200 | return val; | ||
1201 | } | ||
1202 | |||
1203 | static Eina_Bool | ||
1204 | evas_image_load_file_data_jpeg(Image_Entry *ie, | ||
1205 | const char *file, const char *key __UNUSED__, | ||
1206 | int *error) | ||
1207 | { | ||
1208 | Eina_File *f; | ||
1209 | void *map; | ||
1210 | Eina_Bool val = EINA_FALSE; | ||
1211 | |||
1212 | f = eina_file_open(file, EINA_FALSE); | ||
1213 | if (!f) | ||
1214 | { | ||
1215 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; | ||
1216 | return EINA_FALSE; | ||
1217 | } | ||
1218 | map = eina_file_map_all(f, EINA_FILE_WILLNEED); | ||
1219 | if (!map) | ||
1220 | { | ||
1221 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; | ||
1222 | goto on_error; | ||
1223 | } | ||
1224 | |||
1225 | val = evas_image_load_file_data_jpeg_internal(ie, | ||
1226 | map, eina_file_size_get(f), | ||
1227 | error); | ||
1228 | |||
1229 | eina_file_map_free(f, map); | ||
1230 | |||
1231 | on_error: | ||
1232 | eina_file_close(f); | ||
1233 | return val; | ||
1234 | } | ||
1235 | |||
1236 | static int | ||
1237 | module_open(Evas_Module *em) | ||
1238 | { | ||
1239 | if (!em) return 0; | ||
1240 | em->functions = (void *)(&evas_image_load_jpeg_func); | ||
1241 | return 1; | ||
1242 | } | ||
1243 | |||
1244 | static void | ||
1245 | module_close(Evas_Module *em __UNUSED__) | ||
1246 | { | ||
1247 | } | ||
1248 | |||
1249 | static Evas_Module_Api evas_modapi = | ||
1250 | { | ||
1251 | EVAS_MODULE_API_VERSION, | ||
1252 | "jpeg", | ||
1253 | "none", | ||
1254 | { | ||
1255 | module_open, | ||
1256 | module_close | ||
1257 | } | ||
1258 | }; | ||
1259 | |||
1260 | EVAS_MODULE_DEFINE(EVAS_MODULE_TYPE_IMAGE_LOADER, image_loader, jpeg); | ||
1261 | |||
1262 | #ifndef EVAS_STATIC_BUILD_JPEG | ||
1263 | EVAS_EINA_MODULE_DEFINE(image_loader, jpeg); | ||
1264 | #endif | ||
1265 | |||