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