Commit Graph

19 Commits

Author SHA1 Message Date
skal
94a8377b3e extract the command-line parsing helpers to example_util
+ make img2webp tool use the text-file parsing option too.

Change-Id: I1976e651bbe8b4701abceba89e054b4fb3c35696
2018-02-08 08:11:31 +00:00
Pascal Massimino
3f182d36f4 add a "-duration duration,start,end" option to webpmux
this will force a constant duration for an interval of frames
in an animation.
Notes:
 a) '-duration [...]' can be repeated as many times as needed.
 b) intervals are taken into account in option order. If they overlap, values will be overwritten.
 c) 'start' and 'end' can be omitted, but not the duration value.
 d) 'end' can be equal to '0', in which case it means 'last frame'
 e) single-image files are untouched (ie. not turned into an animation file).

Some example usage:
    webpmux -duration 150 in.webp -o out.webp
    webpmux -duration 33,10,0 in.webp -o out.webp
    webpmux -duration 200,2 -duration 150,0,50 in.webp -o out.webp

Change-Id: I9b595dafa77f9221bacd080be7858b1457f54636
2016-11-09 15:44:09 +01:00
James Zern
ebee57f4d1 move imageio/example_util.[hc] (back to) examples/
decoding and file i/o have been split to imageio, all that remains is
some string routines used for parameter parsing in the examples

Change-Id: I77386cd8aa39124b9e14c95fdbaa17ea4ab5bb24
2016-07-21 20:41:03 -07:00
James Zern
c379b55a93 move examples/{example_util,image_dec} to imageio/
Change-Id: I2508c786a095a2a75bebf766210c64e2af88f9b6
2016-07-19 19:06:29 -07:00
Pascal Massimino
ab8d669887 ReadWebP: avoid conversion to ARGB if final format is YUVA
Adds ExUtilCopyPlane() in example_utils.[ch], borrowed from
src/util/utils.h

(removes a TODO)

Change-Id: Iadfc19da3914c9439608f296e86225d279263566
2016-05-26 05:49:16 +00:00
Pascal Massimino
f358eeb891 add code for testing random incremental decoding in dwebp
(protected with WEBP_EXPERIMENTAL_FEATURES flag)

Change-Id: I6cc2488810ce2ccd5d45882bd12f34a3d0c8eab8
2014-10-16 17:01:32 +02:00
James Zern
96d43a873a examples: warn on invalid numeric parameters
add ExUtilGet[U]Int / ExUtilGetFloat which print an error message on
parse failure.
fixes issue #219.

Change-Id: Ie537f5aebd138925bf1a48289b6b5e261b3af2ca
2014-09-11 11:18:28 -07:00
James Zern
a6140194ff ExUtilReadFromStdin: (windows) open stdin in bin mode
fixes input/decode from stdin in the examples

Change-Id: Ie8052da758a9ef64477501b709408236d258da82
2014-08-29 19:25:46 -07:00
James Zern
5927e15bc7 example_util: add ExUtilSetBinaryMode
use it in dwebp when dealing with 'stdout'

Change-Id: I8b8a0b0de9e73731e913ac3c83b5e2b33c693175
2014-08-29 19:07:17 -07:00
skal
0b747b1b39 use explicit size of kErrorMessages[] arrays
Change-Id: If02864e3a07ae37814bf379bf347862cd2871bf4
2014-07-21 13:21:56 -07:00
James Zern
1b2fe14de5 example_util: add ExUtilDecodeWebPIncremental
simplifies ExUtilDecodeWebP() call

Change-Id: I33b42ec1c398b9fc0a895ad9deb89ab01a33b3da
2014-04-27 01:58:25 -07:00
Pascal Massimino
f0b65c9a1e make ExUtilLoadWebP() accept NULL bitstream param.
Change-Id: Ifce379873ca39e46d011a1cb829beab89de5f15d
2014-04-26 01:11:44 -07:00
James Zern
4a0e73904d dwebp: move webp decoding to example_util
this will allow reuse by cwebp

Change-Id: I667252fdacfc5436112d21b040ca299273ec1515
2014-04-22 20:31:41 -07:00
skal
2bcad89b4c allow some more stdin/stout I/O
* allow reading from stdin for dwebp / vwebp
 * allow writing to stdout for gif2webp

by introducing a new function ExUtilReadFromStdin()

Example use: cat in.webp | dwebp -o - -- - > out.png

Note that the '-- -' option must appear *last*
(as per general fashion for '--' option parsing)

Change-Id: I8df0f3a246cc325925d6b6f668ba060f7dd81d68
2014-03-12 19:32:16 +01:00
James Zern
5227d99146 drop: ifdef __cplusplus checks from C files
the prototypes are already marked in the headers

Change-Id: I172fe742200c939ca32a70a2299809b8baf9b094
2013-12-13 11:42:13 -08:00
James Zern
d640614d54 update copyright text
rather than symlink the webm/vpx terms, use the same header as libvpx to
reference in-tree files

based on the discussion in:
https://codereview.chromium.org/12771026/

Change-Id: Ia3067ecddefaa7ee01550136e00f7b3f086d4af4
2013-06-06 23:09:14 -07:00
James Zern
14d42af207 examples: don't use C99 %zu
this would require a PRIuS or similar macro for proper platform
compatibility (Visual Studio for instance would be variants of %lu)

Change-Id: I1af530c7c358c91b845acde1d8c12ef46c2ef746
2013-03-20 16:59:35 -07:00
Urvang Joshi
e9a15a37cf ExUtilWriteFile() to write memory segment to file
Change-Id: I4a93358e55ba5527667e017e178009251f64560e
2012-11-08 11:20:01 -08:00
James Zern
061263a787 add example_util.[hc]
moves ReadFile to a common location

Change-Id: Ia81230671f16d7d4d218b9954a5be55577a85413
2012-05-15 13:42:57 -07:00