1# This file was automatically generated by SWIG (http://www.swig.org).
2# Version 2.0.4
3#
4# Do not make changes to this file unless you know what you are doing--modify
5# the SWIG interface file instead.
6
7
8
9from sys import version_info
10if version_info >= (2,6,0):
11    def swig_import_helper():
12        from os.path import dirname
13        import imp
14        fp = None
15        try:
16            fp, pathname, description = imp.find_module('_libwebp', [dirname(__file__)])
17        except ImportError:
18            import _libwebp
19            return _libwebp
20        if fp is not None:
21            try:
22                _mod = imp.load_module('_libwebp', fp, pathname, description)
23            finally:
24                fp.close()
25            return _mod
26    _libwebp = swig_import_helper()
27    del swig_import_helper
28else:
29    import _libwebp
30del version_info
31try:
32    _swig_property = property
33except NameError:
34    pass # Python < 2.2 doesn't have 'property'.
35def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
36    if (name == "thisown"): return self.this.own(value)
37    if (name == "this"):
38        if type(value).__name__ == 'SwigPyObject':
39            self.__dict__[name] = value
40            return
41    method = class_type.__swig_setmethods__.get(name,None)
42    if method: return method(self,value)
43    if (not static):
44        self.__dict__[name] = value
45    else:
46        raise AttributeError("You cannot add attributes to %s" % self)
47
48def _swig_setattr(self,class_type,name,value):
49    return _swig_setattr_nondynamic(self,class_type,name,value,0)
50
51def _swig_getattr(self,class_type,name):
52    if (name == "thisown"): return self.this.own()
53    method = class_type.__swig_getmethods__.get(name,None)
54    if method: return method(self)
55    raise AttributeError(name)
56
57def _swig_repr(self):
58    try: strthis = "proxy of " + self.this.__repr__()
59    except: strthis = ""
60    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
61
62try:
63    _object = object
64    _newclass = 1
65except AttributeError:
66    class _object : pass
67    _newclass = 0
68
69
70
71def WebPGetDecoderVersion():
72  """WebPGetDecoderVersion() -> int"""
73  return _libwebp.WebPGetDecoderVersion()
74
75def WebPGetInfo(*args):
76  """WebPGetInfo(uint8_t data) -> (width, height)"""
77  return _libwebp.WebPGetInfo(*args)
78
79def WebPDecodeRGB(*args):
80  """WebPDecodeRGB(uint8_t data) -> (rgb, width, height)"""
81  return _libwebp.WebPDecodeRGB(*args)
82
83def WebPDecodeRGBA(*args):
84  """WebPDecodeRGBA(uint8_t data) -> (rgb, width, height)"""
85  return _libwebp.WebPDecodeRGBA(*args)
86
87def WebPDecodeARGB(*args):
88  """WebPDecodeARGB(uint8_t data) -> (rgb, width, height)"""
89  return _libwebp.WebPDecodeARGB(*args)
90
91def WebPDecodeBGR(*args):
92  """WebPDecodeBGR(uint8_t data) -> (rgb, width, height)"""
93  return _libwebp.WebPDecodeBGR(*args)
94
95def WebPDecodeBGRA(*args):
96  """WebPDecodeBGRA(uint8_t data) -> (rgb, width, height)"""
97  return _libwebp.WebPDecodeBGRA(*args)
98
99def WebPGetEncoderVersion():
100  """WebPGetEncoderVersion() -> int"""
101  return _libwebp.WebPGetEncoderVersion()
102
103def wrap_WebPEncodeRGB(*args):
104  """private, do not call directly."""
105  return _libwebp.wrap_WebPEncodeRGB(*args)
106
107def wrap_WebPEncodeBGR(*args):
108  """private, do not call directly."""
109  return _libwebp.wrap_WebPEncodeBGR(*args)
110
111def wrap_WebPEncodeRGBA(*args):
112  """private, do not call directly."""
113  return _libwebp.wrap_WebPEncodeRGBA(*args)
114
115def wrap_WebPEncodeBGRA(*args):
116  """private, do not call directly."""
117  return _libwebp.wrap_WebPEncodeBGRA(*args)
118
119def wrap_WebPEncodeLosslessRGB(*args):
120  """private, do not call directly."""
121  return _libwebp.wrap_WebPEncodeLosslessRGB(*args)
122
123def wrap_WebPEncodeLosslessBGR(*args):
124  """private, do not call directly."""
125  return _libwebp.wrap_WebPEncodeLosslessBGR(*args)
126
127def wrap_WebPEncodeLosslessRGBA(*args):
128  """private, do not call directly."""
129  return _libwebp.wrap_WebPEncodeLosslessRGBA(*args)
130
131def wrap_WebPEncodeLosslessBGRA(*args):
132  """private, do not call directly."""
133  return _libwebp.wrap_WebPEncodeLosslessBGRA(*args)
134_UNUSED = 1
135
136def WebPEncodeRGB(rgb, width, height, stride, quality_factor):
137  """WebPEncodeRGB(uint8_t rgb, int width, int height, int stride, float quality_factor) -> lossy_webp"""
138  webp = wrap_WebPEncodeRGB(
139      rgb, _UNUSED, _UNUSED, width, height, stride, quality_factor)
140  if len(webp[0]) == 0:
141    return None
142  return webp[0]
143
144def WebPEncodeRGBA(rgb, width, height, stride, quality_factor):
145  """WebPEncodeRGBA(uint8_t rgb, int width, int height, int stride, float quality_factor) -> lossy_webp"""
146  webp = wrap_WebPEncodeRGBA(
147      rgb, _UNUSED, _UNUSED, width, height, stride, quality_factor)
148  if len(webp[0]) == 0:
149    return None
150  return webp[0]
151
152def WebPEncodeBGR(rgb, width, height, stride, quality_factor):
153  """WebPEncodeBGR(uint8_t rgb, int width, int height, int stride, float quality_factor) -> lossy_webp"""
154  webp = wrap_WebPEncodeBGR(
155      rgb, _UNUSED, _UNUSED, width, height, stride, quality_factor)
156  if len(webp[0]) == 0:
157    return None
158  return webp[0]
159
160def WebPEncodeBGRA(rgb, width, height, stride, quality_factor):
161  """WebPEncodeBGRA(uint8_t rgb, int width, int height, int stride, float quality_factor) -> lossy_webp"""
162  webp = wrap_WebPEncodeBGRA(
163      rgb, _UNUSED, _UNUSED, width, height, stride, quality_factor)
164  if len(webp[0]) == 0:
165    return None
166  return webp[0]
167
168def WebPEncodeLosslessRGB(rgb, width, height, stride):
169  """WebPEncodeLosslessRGB(uint8_t rgb, int width, int height, int stride) -> lossless_webp"""
170  webp = wrap_WebPEncodeLosslessRGB(rgb, _UNUSED, _UNUSED, width, height, stride)
171  if len(webp[0]) == 0:
172    return None
173  return webp[0]
174
175def WebPEncodeLosslessRGBA(rgb, width, height, stride):
176  """WebPEncodeLosslessRGBA(uint8_t rgb, int width, int height, int stride) -> lossless_webp"""
177  webp = wrap_WebPEncodeLosslessRGBA(rgb, _UNUSED, _UNUSED, width, height, stride)
178  if len(webp[0]) == 0:
179    return None
180  return webp[0]
181
182def WebPEncodeLosslessBGR(rgb, width, height, stride):
183  """WebPEncodeLosslessBGR(uint8_t rgb, int width, int height, int stride) -> lossless_webp"""
184  webp = wrap_WebPEncodeLosslessBGR(rgb, _UNUSED, _UNUSED, width, height, stride)
185  if len(webp[0]) == 0:
186    return None
187  return webp[0]
188
189def WebPEncodeLosslessBGRA(rgb, width, height, stride):
190  """WebPEncodeLosslessBGRA(uint8_t rgb, int width, int height, int stride) -> lossless_webp"""
191  webp = wrap_WebPEncodeLosslessBGRA(rgb, _UNUSED, _UNUSED, width, height, stride)
192  if len(webp[0]) == 0:
193    return None
194  return webp[0]
195
196# This file is compatible with both classic and new-style classes.
197
198
199