more py tweaks

fast startup, reorganised python/
This commit is contained in:
John Cupitt 2014-10-14 10:17:33 +01:00
parent bb360ae410
commit 6fb967ac3b
35 changed files with 71 additions and 46409 deletions

1
.gitignore vendored
View File

@ -24,6 +24,7 @@ Vips-8.0.gir
Vips-8.0.typelib
*.pc
*.pyc
*.pyo
.deps
.libs
aclocal.m4

2
TODO
View File

@ -1,6 +1,8 @@
- python:
- can we hook into class method lookup? read the sources again
- should be a separate package? pyvips?
easier to get into CPAN or whatever the python thing is called

View File

@ -645,7 +645,7 @@ def define_class_methods(cls):
gtype = Vips.type_find("VipsOperation", cls.name)
nickname = Vips.nickname_find(gtype)
logging.debug('adding %s as a class method' % nickname)
method = lambda *args, **kwargs: vips_image_class_method( nickname, args, kwargs)
method = lambda *args, **kwargs: vips_image_class_method(nickname, args, kwargs)
setattr(Vips.Image, nickname, classmethod(method))
if len(cls.children) > 0:
@ -654,5 +654,60 @@ def define_class_methods(cls):
if cls.name != 'VipsWrap7':
define_class_methods(child)
define_class_methods(vips_type_operation)
# for speed, only run this occasionally ... we add class methods from the list
# below
# define_class_methods(vips_type_operation)
class_methods = [
"system",
"sum",
"bandjoin",
"bandrank",
"black",
"gaussnoise",
"text",
"xyz",
"gaussmat",
"logmat",
"eye",
"grey",
"zone",
"sines",
"mask_ideal",
"mask_ideal_ring",
"mask_ideal_band",
"mask_butterworth",
"mask_butterworth_ring",
"mask_butterworth_band",
"mask_gaussian",
"mask_gaussian_ring",
"mask_gaussian_band",
"mask_fractal",
"tonelut",
"identity",
"fractsurf",
"radload",
"ppmload",
"csvload",
"matrixload",
"analyzeload",
"rawload",
"vipsload",
"pngload",
"pngload_buffer",
"matload",
"jpegload",
"jpegload_buffer",
"webpload",
"webpload_buffer",
"tiffload",
"tiffload_buffer",
"openslideload",
"magickload",
"fitsload",
"openexrload"]
for nickname in class_methods:
method = lambda *args, **kwargs: vips_image_class_method(nickname, args, kwargs)
setattr(Vips.Image, nickname, classmethod(method))

View File

@ -3,7 +3,7 @@
import sys
import logging
logging.basicConfig(level = logging.DEBUG)
#logging.basicConfig(level = logging.DEBUG)
from gi.repository import Vips

8
python/example/try13.py Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/python
import sys
import logging
logging.basicConfig(level = logging.DEBUG)
from gi.repository import Vips

View File

@ -167,7 +167,7 @@ class TestConversion(unittest.TestCase):
def test_bandjoin(self):
def bandjoin(x, y):
if isinstance(x, Vips.Image) and isinstance(y, Vips.Image):
return x.bandjoin2(y)
return x.bandjoin(y)
else:
return x + y
@ -333,7 +333,7 @@ class TestConversion(unittest.TestCase):
mx = max_value[fmt]
alpha = mx / 2
nalpha = mx - alpha
test = self.colour.bandjoin2(black + alpha).cast(fmt)
test = self.colour.bandjoin(black + alpha).cast(fmt)
pixel = test.getpoint(30, 30)
predict = [int(x) * alpha / mx for x in pixel[:-1]]

View File

@ -1,18 +0,0 @@
#!/usr/bin/python
import sys
from vipsCC import *
im = VImage.VImage (sys.argv[1])
im = im.extract_area (100, 100, im.Xsize () - 200, im.Ysize () - 200)
im = im.affinei_all ("bilinear", 0.9, 0, 0, 0.9, 0, 0)
mask = VMask.VIMask (3, 3, 8, 0,
[-1, -1, -1,
-1, 16, -1,
-1, -1, -1])
im = im.conv (mask)
im.write (sys.argv[2])

View File

@ -1,19 +0,0 @@
#!/usr/bin/python
import sys
from gi.repository import Vips
from vips8 import vips
im = Vips.Image.new_from_file(sys.argv[1])
im = im.crop(100, 100, im.width - 200, im.height - 200)
im = im.affine([0.9, 0, 0, 0.9])
mask = Vips.Image.new_from_array([[-1, -1, -1],
[-1, 16, -1],
[-1, -1, -1]], scale = 8)
im = im.conv(mask)
im.write_to_file(sys.argv[2])

View File

@ -1,58 +0,0 @@
# Let make substitute the value of PYTHON_INCLUDES rather than auto*
# this makes it easier to support multiple python installs
INCLUDES = \
-I${top_srcdir}/libvips/include \
-I${top_srcdir}/libvipsCC/include \
@VIPS_CFLAGS@ \
@VIPS_INCLUDES@ \
$(PYTHON_INCLUDES)
# we install to a directory inside the python area, since we are a module
vipsccdir = $(pyexecdir)/vipsCC
vipscc_PYTHON = VImage.py VDisplay.py VError.py VMask.py __init__.py
# I tried making a suffix rule for this (and defining SUFFIXES) but I couldn't
# get it to work, how annoying
# FIXME at some point
#
# need an expanded VImage.h ... SWIG's preprocessor b0rks on includes inside
# class definitions
vimagemodule.cpp: VImage.i
cpp -DSWIG -E $(top_srcdir)/libvipsCC/include/vips/VImage.h > VImage.h
swig -python -c++ -interface $(@:.cxx=) -I$(top_srcdir)/libvipsCC/include -o $@ $<
vdisplaymodule.cpp: VDisplay.i
swig -python -c++ -interface $(@:.cxx=) -I$(top_srcdir)/libvipsCC/include -o $@ $<
verrormodule.cpp: VError.i
swig -python -c++ -interface $(@:.cxx=) -I$(top_srcdir)/libvipsCC/include -o $@ $<
vmaskmodule.cpp: VMask.i
swig -python -c++ -interface $(@:.cxx=) -I$(top_srcdir)/libvipsCC/include -o $@ $<
vipscc_LTLIBRARIES = vimagemodule.la vdisplaymodule.la verrormodule.la vmaskmodule.la
# maybe there's a clever way to avoid repeating the link stuff 4 times
# vimagemodule uses the C API as well, so it needs libvips too
vimagemodule_la_LDFLAGS = -module -avoid-version
vimagemodule_la_LIBADD = ../../libvipsCC/libvipsCC.la ../../libvips/libvips.la $(VIPS_LIBS)
nodist_vimagemodule_la_SOURCES = vimagemodule.cxx
vdisplaymodule_la_LDFLAGS = -module -avoid-version
vdisplaymodule_la_LIBADD = ../../libvipsCC/libvipsCC.la $(VIPS_LIBS)
nodist_vdisplaymodule_la_SOURCES = vdisplaymodule.cxx
verrormodule_la_LDFLAGS = -module -avoid-version
verrormodule_la_LIBADD = ../../libvipsCC/libvipsCC.la $(VIPS_LIBS)
nodist_verrormodule_la_SOURCES = verrormodule.cxx
vmaskmodule_la_LDFLAGS = -module -avoid-version
vmaskmodule_la_LIBADD = ../../libvipsCC/libvipsCC.la $(VIPS_LIBS)
nodist_vmaskmodule_la_SOURCES = vmaskmodule.cxx
CLEANFILES = VImage.h
EXTRA_DIST = \
VImage.i VDisplay.i VError.i VMask.i __init__.py \
vimagemodule.cxx \
verrormodule.cxx vdisplaymodule.cxx vmaskmodule.cxx \
VImage.py VDisplay.py VError.py VMask.py

View File

@ -1,80 +0,0 @@
#!/usr/bin/python
# vim: set fileencoding=latin-1:
import re
import sys
from distutils.core import setup, Extension
# We pick up configure's stuff here. Sadly distutils needs this broken out
# into separate includes, libs and defines, argh
configure_flags = '@VIPS_CFLAGS@ @VIPS_INCLUDES@ @VIPS_LIBS@ -I@top_srcdir@/libvips/include -I@top_srcdir@/libvipsCC/include'
# Parse compiler flags into these categories, yuk!
configure_macros = []
configure_include_dirs = []
configure_library_dirs = []
configure_libs = []
configure_options = []
for flag in configure_flags.split():
match = re.match ('-D(.*)(=(.*))?', flag)
if match:
key = match.group (1)
if match.group (2):
value = match.group (2)
else:
value = 1
configure_macros += [(key, value)]
continue
match = re.match ('-I(.*)', flag)
if match:
configure_include_dirs += [match.group (1)]
continue
match = re.match ('-L(.*)', flag)
if match:
configure_library_dirs += [match.group (1)]
continue
match = re.match ('-l(.*)', flag)
if match:
configure_libs += [match.group (1)]
continue
match = re.match ('-(.*)', flag)
if match:
configure_options += [flag]
continue
print '%s: unknown configure option!' % flag
sys.exit (1)
def make_extension (name, source):
return Extension (name,
sources = [source],
define_macros = configure_macros,
include_dirs = configure_include_dirs,
libraries = configure_libs,
library_dirs = configure_library_dirs,
extra_compile_args = configure_options,
extra_link_args = configure_options,
runtime_library_dirs= ['@IM_LIBDIR@'])
module1 = make_extension ('vimagemodule', 'vimagemodule.cpp')
module2 = make_extension ('vmaskmodule', 'vmaskmodule.cpp')
module3 = make_extension ('verrormodule', 'verrormodule.cpp')
module4 = make_extension ('vdisplaymodule', 'vdisplaymodule.cpp')
setup (name = 'vipsCC',
version = '7.20.7',
description = 'vips-7.x image processing library',
author = 'José María García Pérez, John Cupitt',
author_email = 'jcupitt@gmail.com',
url = 'http://www.vips.ecs.soton.ac.uk',
packages = ['vipsCC'],
ext_package = 'vipsCC',
ext_modules = [module1, module2, module3, module4])

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,91 +0,0 @@
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.40
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
# This file is compatible with both classic and new-style classes.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('vdisplaymodule', [dirname(__file__)])
except ImportError:
import vdisplaymodule
return vdisplaymodule
if fp is not None:
try:
_mod = imp.load_module('vdisplaymodule', fp, pathname, description)
finally:
fp.close()
return _mod
vdisplaymodule = swig_import_helper()
del swig_import_helper
else:
import vdisplaymodule
del version_info
try:
_swig_property = property
except NameError:
pass # Python < 2.2 doesn't have 'property'.
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static) or hasattr(self,name):
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self,class_type,name,value):
return _swig_setattr_nondynamic(self,class_type,name,value,0)
def _swig_getattr(self,class_type,name):
if (name == "thisown"): return self.this.own()
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError(name)
def _swig_repr(self):
try: strthis = "proxy of " + self.this.__repr__()
except: strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
try:
_object = object
_newclass = 1
except AttributeError:
class _object : pass
_newclass = 0
import VError
class VDisplay(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, VDisplay, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, VDisplay, name)
__repr__ = _swig_repr
BARCO = vdisplaymodule.VDisplay_BARCO
DUMB = vdisplaymodule.VDisplay_DUMB
def __init__(self, *args):
this = vdisplaymodule.new_VDisplay(*args)
try: self.this.append(this)
except: self.this = this
def __assign__(self, *args): return vdisplaymodule.VDisplay___assign__(self, *args)
__swig_destroy__ = vdisplaymodule.delete_VDisplay
__del__ = lambda self : None;
def disp(self): return vdisplaymodule.VDisplay_disp(self)
def luts(self): return vdisplaymodule.VDisplay_luts(self)
VDisplay_swigregister = vdisplaymodule.VDisplay_swigregister
VDisplay_swigregister(VDisplay)

View File

@ -1,98 +0,0 @@
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.40
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
# This file is compatible with both classic and new-style classes.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('verrormodule', [dirname(__file__)])
except ImportError:
import verrormodule
return verrormodule
if fp is not None:
try:
_mod = imp.load_module('verrormodule', fp, pathname, description)
finally:
fp.close()
return _mod
verrormodule = swig_import_helper()
del swig_import_helper
else:
import verrormodule
del version_info
try:
_swig_property = property
except NameError:
pass # Python < 2.2 doesn't have 'property'.
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static) or hasattr(self,name):
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self,class_type,name,value):
return _swig_setattr_nondynamic(self,class_type,name,value,0)
def _swig_getattr(self,class_type,name):
if (name == "thisown"): return self.this.own()
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError(name)
def _swig_repr(self):
try: strthis = "proxy of " + self.this.__repr__()
except: strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
try:
_object = object
_newclass = 1
except AttributeError:
class _object : pass
_newclass = 0
class VError(Exception):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, VError, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, VError, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = verrormodule.new_VError(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = verrormodule.delete_VError
__del__ = lambda self : None;
def perror(self, *args): return verrormodule.VError_perror(self, *args)
def app(self, *args): return verrormodule.VError_app(self, *args)
def what(self): return verrormodule.VError_what(self)
def ostream_print(self, *args): return verrormodule.VError_ostream_print(self, *args)
def __str__(self): return verrormodule.VError___str__(self)
VError_swigregister = verrormodule.VError_swigregister
VError_swigregister(VError)
def __lshift__(*args):
return verrormodule.__lshift__(*args)
__lshift__ = verrormodule.__lshift__
def verror(str = ""):
return verrormodule.verror(str)
verror = verrormodule.verror

View File

@ -1,870 +0,0 @@
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.40
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
# This file is compatible with both classic and new-style classes.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('vimagemodule', [dirname(__file__)])
except ImportError:
import vimagemodule
return vimagemodule
if fp is not None:
try:
_mod = imp.load_module('vimagemodule', fp, pathname, description)
finally:
fp.close()
return _mod
vimagemodule = swig_import_helper()
del swig_import_helper
else:
import vimagemodule
del version_info
try:
_swig_property = property
except NameError:
pass # Python < 2.2 doesn't have 'property'.
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static) or hasattr(self,name):
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self,class_type,name,value):
return _swig_setattr_nondynamic(self,class_type,name,value,0)
def _swig_getattr(self,class_type,name):
if (name == "thisown"): return self.this.own()
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError(name)
def _swig_repr(self):
try: strthis = "proxy of " + self.this.__repr__()
except: strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
try:
_object = object
_newclass = 1
except AttributeError:
class _object : pass
_newclass = 0
class SwigPyIterator(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, SwigPyIterator, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SwigPyIterator, name)
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
__swig_destroy__ = vimagemodule.delete_SwigPyIterator
__del__ = lambda self : None;
def value(self): return vimagemodule.SwigPyIterator_value(self)
def incr(self, n = 1): return vimagemodule.SwigPyIterator_incr(self, n)
def decr(self, n = 1): return vimagemodule.SwigPyIterator_decr(self, n)
def distance(self, *args): return vimagemodule.SwigPyIterator_distance(self, *args)
def equal(self, *args): return vimagemodule.SwigPyIterator_equal(self, *args)
def copy(self): return vimagemodule.SwigPyIterator_copy(self)
def next(self): return vimagemodule.SwigPyIterator_next(self)
def __next__(self): return vimagemodule.SwigPyIterator___next__(self)
def previous(self): return vimagemodule.SwigPyIterator_previous(self)
def advance(self, *args): return vimagemodule.SwigPyIterator_advance(self, *args)
def __eq__(self, *args): return vimagemodule.SwigPyIterator___eq__(self, *args)
def __ne__(self, *args): return vimagemodule.SwigPyIterator___ne__(self, *args)
def __iadd__(self, *args): return vimagemodule.SwigPyIterator___iadd__(self, *args)
def __isub__(self, *args): return vimagemodule.SwigPyIterator___isub__(self, *args)
def __add__(self, *args): return vimagemodule.SwigPyIterator___add__(self, *args)
def __sub__(self, *args): return vimagemodule.SwigPyIterator___sub__(self, *args)
def __iter__(self): return self
SwigPyIterator_swigregister = vimagemodule.SwigPyIterator_swigregister
SwigPyIterator_swigregister(SwigPyIterator)
import VError
import VMask
import VDisplay
class IntVector(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, IntVector, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, IntVector, name)
__repr__ = _swig_repr
def iterator(self): return vimagemodule.IntVector_iterator(self)
def __iter__(self): return self.iterator()
def __nonzero__(self): return vimagemodule.IntVector___nonzero__(self)
def __bool__(self): return vimagemodule.IntVector___bool__(self)
def __len__(self): return vimagemodule.IntVector___len__(self)
def pop(self): return vimagemodule.IntVector_pop(self)
def __getslice__(self, *args): return vimagemodule.IntVector___getslice__(self, *args)
def __setslice__(self, *args): return vimagemodule.IntVector___setslice__(self, *args)
def __delslice__(self, *args): return vimagemodule.IntVector___delslice__(self, *args)
def __delitem__(self, *args): return vimagemodule.IntVector___delitem__(self, *args)
def __getitem__(self, *args): return vimagemodule.IntVector___getitem__(self, *args)
def __setitem__(self, *args): return vimagemodule.IntVector___setitem__(self, *args)
def append(self, *args): return vimagemodule.IntVector_append(self, *args)
def empty(self): return vimagemodule.IntVector_empty(self)
def size(self): return vimagemodule.IntVector_size(self)
def clear(self): return vimagemodule.IntVector_clear(self)
def swap(self, *args): return vimagemodule.IntVector_swap(self, *args)
def get_allocator(self): return vimagemodule.IntVector_get_allocator(self)
def begin(self): return vimagemodule.IntVector_begin(self)
def end(self): return vimagemodule.IntVector_end(self)
def rbegin(self): return vimagemodule.IntVector_rbegin(self)
def rend(self): return vimagemodule.IntVector_rend(self)
def pop_back(self): return vimagemodule.IntVector_pop_back(self)
def erase(self, *args): return vimagemodule.IntVector_erase(self, *args)
def __init__(self, *args):
this = vimagemodule.new_IntVector(*args)
try: self.this.append(this)
except: self.this = this
def push_back(self, *args): return vimagemodule.IntVector_push_back(self, *args)
def front(self): return vimagemodule.IntVector_front(self)
def back(self): return vimagemodule.IntVector_back(self)
def assign(self, *args): return vimagemodule.IntVector_assign(self, *args)
def resize(self, *args): return vimagemodule.IntVector_resize(self, *args)
def insert(self, *args): return vimagemodule.IntVector_insert(self, *args)
def reserve(self, *args): return vimagemodule.IntVector_reserve(self, *args)
def capacity(self): return vimagemodule.IntVector_capacity(self)
__swig_destroy__ = vimagemodule.delete_IntVector
__del__ = lambda self : None;
IntVector_swigregister = vimagemodule.IntVector_swigregister
IntVector_swigregister(IntVector)
class DoubleVector(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, DoubleVector, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, DoubleVector, name)
__repr__ = _swig_repr
def iterator(self): return vimagemodule.DoubleVector_iterator(self)
def __iter__(self): return self.iterator()
def __nonzero__(self): return vimagemodule.DoubleVector___nonzero__(self)
def __bool__(self): return vimagemodule.DoubleVector___bool__(self)
def __len__(self): return vimagemodule.DoubleVector___len__(self)
def pop(self): return vimagemodule.DoubleVector_pop(self)
def __getslice__(self, *args): return vimagemodule.DoubleVector___getslice__(self, *args)
def __setslice__(self, *args): return vimagemodule.DoubleVector___setslice__(self, *args)
def __delslice__(self, *args): return vimagemodule.DoubleVector___delslice__(self, *args)
def __delitem__(self, *args): return vimagemodule.DoubleVector___delitem__(self, *args)
def __getitem__(self, *args): return vimagemodule.DoubleVector___getitem__(self, *args)
def __setitem__(self, *args): return vimagemodule.DoubleVector___setitem__(self, *args)
def append(self, *args): return vimagemodule.DoubleVector_append(self, *args)
def empty(self): return vimagemodule.DoubleVector_empty(self)
def size(self): return vimagemodule.DoubleVector_size(self)
def clear(self): return vimagemodule.DoubleVector_clear(self)
def swap(self, *args): return vimagemodule.DoubleVector_swap(self, *args)
def get_allocator(self): return vimagemodule.DoubleVector_get_allocator(self)
def begin(self): return vimagemodule.DoubleVector_begin(self)
def end(self): return vimagemodule.DoubleVector_end(self)
def rbegin(self): return vimagemodule.DoubleVector_rbegin(self)
def rend(self): return vimagemodule.DoubleVector_rend(self)
def pop_back(self): return vimagemodule.DoubleVector_pop_back(self)
def erase(self, *args): return vimagemodule.DoubleVector_erase(self, *args)
def __init__(self, *args):
this = vimagemodule.new_DoubleVector(*args)
try: self.this.append(this)
except: self.this = this
def push_back(self, *args): return vimagemodule.DoubleVector_push_back(self, *args)
def front(self): return vimagemodule.DoubleVector_front(self)
def back(self): return vimagemodule.DoubleVector_back(self)
def assign(self, *args): return vimagemodule.DoubleVector_assign(self, *args)
def resize(self, *args): return vimagemodule.DoubleVector_resize(self, *args)
def insert(self, *args): return vimagemodule.DoubleVector_insert(self, *args)
def reserve(self, *args): return vimagemodule.DoubleVector_reserve(self, *args)
def capacity(self): return vimagemodule.DoubleVector_capacity(self)
__swig_destroy__ = vimagemodule.delete_DoubleVector
__del__ = lambda self : None;
DoubleVector_swigregister = vimagemodule.DoubleVector_swigregister
DoubleVector_swigregister(DoubleVector)
class ImageVector(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, ImageVector, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, ImageVector, name)
__repr__ = _swig_repr
def iterator(self): return vimagemodule.ImageVector_iterator(self)
def __iter__(self): return self.iterator()
def __nonzero__(self): return vimagemodule.ImageVector___nonzero__(self)
def __bool__(self): return vimagemodule.ImageVector___bool__(self)
def __len__(self): return vimagemodule.ImageVector___len__(self)
def pop(self): return vimagemodule.ImageVector_pop(self)
def __getslice__(self, *args): return vimagemodule.ImageVector___getslice__(self, *args)
def __setslice__(self, *args): return vimagemodule.ImageVector___setslice__(self, *args)
def __delslice__(self, *args): return vimagemodule.ImageVector___delslice__(self, *args)
def __delitem__(self, *args): return vimagemodule.ImageVector___delitem__(self, *args)
def __getitem__(self, *args): return vimagemodule.ImageVector___getitem__(self, *args)
def __setitem__(self, *args): return vimagemodule.ImageVector___setitem__(self, *args)
def append(self, *args): return vimagemodule.ImageVector_append(self, *args)
def empty(self): return vimagemodule.ImageVector_empty(self)
def size(self): return vimagemodule.ImageVector_size(self)
def clear(self): return vimagemodule.ImageVector_clear(self)
def swap(self, *args): return vimagemodule.ImageVector_swap(self, *args)
def get_allocator(self): return vimagemodule.ImageVector_get_allocator(self)
def begin(self): return vimagemodule.ImageVector_begin(self)
def end(self): return vimagemodule.ImageVector_end(self)
def rbegin(self): return vimagemodule.ImageVector_rbegin(self)
def rend(self): return vimagemodule.ImageVector_rend(self)
def pop_back(self): return vimagemodule.ImageVector_pop_back(self)
def erase(self, *args): return vimagemodule.ImageVector_erase(self, *args)
def __init__(self, *args):
this = vimagemodule.new_ImageVector(*args)
try: self.this.append(this)
except: self.this = this
def push_back(self, *args): return vimagemodule.ImageVector_push_back(self, *args)
def front(self): return vimagemodule.ImageVector_front(self)
def back(self): return vimagemodule.ImageVector_back(self)
def assign(self, *args): return vimagemodule.ImageVector_assign(self, *args)
def resize(self, *args): return vimagemodule.ImageVector_resize(self, *args)
def insert(self, *args): return vimagemodule.ImageVector_insert(self, *args)
def reserve(self, *args): return vimagemodule.ImageVector_reserve(self, *args)
def capacity(self): return vimagemodule.ImageVector_capacity(self)
__swig_destroy__ = vimagemodule.delete_ImageVector
__del__ = lambda self : None;
ImageVector_swigregister = vimagemodule.ImageVector_swigregister
ImageVector_swigregister(ImageVector)
class VImage(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, VImage, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, VImage, name)
__repr__ = _swig_repr
__swig_getmethods__["print_all"] = lambda x: vimagemodule.VImage_print_all
if _newclass:print_all = staticmethod(vimagemodule.VImage_print_all)
MULTIBAND = vimagemodule.VImage_MULTIBAND
B_W = vimagemodule.VImage_B_W
LUMINACE = vimagemodule.VImage_LUMINACE
XRAY = vimagemodule.VImage_XRAY
IR = vimagemodule.VImage_IR
YUV = vimagemodule.VImage_YUV
RED_ONLY = vimagemodule.VImage_RED_ONLY
GREEN_ONLY = vimagemodule.VImage_GREEN_ONLY
BLUE_ONLY = vimagemodule.VImage_BLUE_ONLY
POWER_SPECTRUM = vimagemodule.VImage_POWER_SPECTRUM
HISTOGRAM = vimagemodule.VImage_HISTOGRAM
LUT = vimagemodule.VImage_LUT
XYZ = vimagemodule.VImage_XYZ
LAB = vimagemodule.VImage_LAB
CMC = vimagemodule.VImage_CMC
CMYK = vimagemodule.VImage_CMYK
LABQ = vimagemodule.VImage_LABQ
RGB = vimagemodule.VImage_RGB
UCS = vimagemodule.VImage_UCS
LCH = vimagemodule.VImage_LCH
LABS = vimagemodule.VImage_LABS
sRGB = vimagemodule.VImage_sRGB
YXY = vimagemodule.VImage_YXY
FOURIER = vimagemodule.VImage_FOURIER
RGB16 = vimagemodule.VImage_RGB16
GREY16 = vimagemodule.VImage_GREY16
FMTNOTSET = vimagemodule.VImage_FMTNOTSET
FMTUCHAR = vimagemodule.VImage_FMTUCHAR
FMTCHAR = vimagemodule.VImage_FMTCHAR
FMTUSHORT = vimagemodule.VImage_FMTUSHORT
FMTSHORT = vimagemodule.VImage_FMTSHORT
FMTUINT = vimagemodule.VImage_FMTUINT
FMTINT = vimagemodule.VImage_FMTINT
FMTFLOAT = vimagemodule.VImage_FMTFLOAT
FMTCOMPLEX = vimagemodule.VImage_FMTCOMPLEX
FMTDOUBLE = vimagemodule.VImage_FMTDOUBLE
FMTDPCOMPLEX = vimagemodule.VImage_FMTDPCOMPLEX
NOCODING = vimagemodule.VImage_NOCODING
COLQUANT = vimagemodule.VImage_COLQUANT
LABPACK = vimagemodule.VImage_LABPACK
LABPACK_COMPRESSED = vimagemodule.VImage_LABPACK_COMPRESSED
RGB_COMPRESSED = vimagemodule.VImage_RGB_COMPRESSED
LUM_COMPRESSED = vimagemodule.VImage_LUM_COMPRESSED
RAD = vimagemodule.VImage_RAD
NO_COMPRESSION = vimagemodule.VImage_NO_COMPRESSION
TCSF_COMPRESSION = vimagemodule.VImage_TCSF_COMPRESSION
JPEG_COMPRESSION = vimagemodule.VImage_JPEG_COMPRESSION
__swig_getmethods__["convert2disc"] = lambda x: vimagemodule.VImage_convert2disc
if _newclass:convert2disc = staticmethod(vimagemodule.VImage_convert2disc)
def __init__(self, *args):
this = vimagemodule.new_VImage(*args)
try: self.this.append(this)
except: self.this = this
def __assign__(self, *args): return vimagemodule.VImage___assign__(self, *args)
__swig_destroy__ = vimagemodule.delete_VImage
__del__ = lambda self : None;
def image(self): return vimagemodule.VImage_image(self)
def data(self): return vimagemodule.VImage_data(self)
def write(self, *args): return vimagemodule.VImage_write(self, *args)
def debug_print(self): return vimagemodule.VImage_debug_print(self)
def Xsize(self): return vimagemodule.VImage_Xsize(self)
def Ysize(self): return vimagemodule.VImage_Ysize(self)
def Bands(self): return vimagemodule.VImage_Bands(self)
def BandFmt(self): return vimagemodule.VImage_BandFmt(self)
def Coding(self): return vimagemodule.VImage_Coding(self)
def Type(self): return vimagemodule.VImage_Type(self)
def Xres(self): return vimagemodule.VImage_Xres(self)
def Yres(self): return vimagemodule.VImage_Yres(self)
def Length(self): return vimagemodule.VImage_Length(self)
def Compression(self): return vimagemodule.VImage_Compression(self)
def Level(self): return vimagemodule.VImage_Level(self)
def Xoffset(self): return vimagemodule.VImage_Xoffset(self)
def Yoffset(self): return vimagemodule.VImage_Yoffset(self)
def filename(self): return vimagemodule.VImage_filename(self)
def Hist(self): return vimagemodule.VImage_Hist(self)
def meta_remove(self, *args): return vimagemodule.VImage_meta_remove(self, *args)
def meta_get_typeof(self, *args): return vimagemodule.VImage_meta_get_typeof(self, *args)
def meta_get_int(self, *args): return vimagemodule.VImage_meta_get_int(self, *args)
def meta_get_double(self, *args): return vimagemodule.VImage_meta_get_double(self, *args)
def meta_get_string(self, *args): return vimagemodule.VImage_meta_get_string(self, *args)
def meta_get_area(self, *args): return vimagemodule.VImage_meta_get_area(self, *args)
def meta_get_blob(self, *args): return vimagemodule.VImage_meta_get_blob(self, *args)
def meta_set(self, *args): return vimagemodule.VImage_meta_set(self, *args)
def initdesc(self, *args): return vimagemodule.VImage_initdesc(self, *args)
def abs(self): return vimagemodule.VImage_abs(self)
def acos(self): return vimagemodule.VImage_acos(self)
def add(self, *args): return vimagemodule.VImage_add(self, *args)
def asin(self): return vimagemodule.VImage_asin(self)
def atan(self): return vimagemodule.VImage_atan(self)
def avg(self): return vimagemodule.VImage_avg(self)
def point_bilinear(self, *args): return vimagemodule.VImage_point_bilinear(self, *args)
def bandmean(self): return vimagemodule.VImage_bandmean(self)
def ceil(self): return vimagemodule.VImage_ceil(self)
def cmulnorm(self, *args): return vimagemodule.VImage_cmulnorm(self, *args)
def cos(self): return vimagemodule.VImage_cos(self)
def cross_phase(self, *args): return vimagemodule.VImage_cross_phase(self, *args)
def deviate(self): return vimagemodule.VImage_deviate(self)
def divide(self, *args): return vimagemodule.VImage_divide(self, *args)
def exp10(self): return vimagemodule.VImage_exp10(self)
def expn(self, *args): return vimagemodule.VImage_expn(self, *args)
def exp(self): return vimagemodule.VImage_exp(self)
def fav4(self, *args): return vimagemodule.VImage_fav4(self, *args)
def floor(self): return vimagemodule.VImage_floor(self)
def gadd(self, *args): return vimagemodule.VImage_gadd(self, *args)
def invert(self): return vimagemodule.VImage_invert(self)
__swig_getmethods__["linreg"] = lambda x: vimagemodule.VImage_linreg
if _newclass:linreg = staticmethod(vimagemodule.VImage_linreg)
def lin(self, *args): return vimagemodule.VImage_lin(self, *args)
def litecor(self, *args): return vimagemodule.VImage_litecor(self, *args)
def log10(self): return vimagemodule.VImage_log10(self)
def log(self): return vimagemodule.VImage_log(self)
def max(self): return vimagemodule.VImage_max(self)
def maxpos(self): return vimagemodule.VImage_maxpos(self)
def maxpos_avg(self, *args): return vimagemodule.VImage_maxpos_avg(self, *args)
def measure(self, *args): return vimagemodule.VImage_measure(self, *args)
def min(self): return vimagemodule.VImage_min(self)
def minpos(self): return vimagemodule.VImage_minpos(self)
def multiply(self, *args): return vimagemodule.VImage_multiply(self, *args)
def pow(self, *args): return vimagemodule.VImage_pow(self, *args)
def remainder(self, *args): return vimagemodule.VImage_remainder(self, *args)
def rint(self): return vimagemodule.VImage_rint(self)
def sign(self): return vimagemodule.VImage_sign(self)
def sin(self): return vimagemodule.VImage_sin(self)
def stats(self): return vimagemodule.VImage_stats(self)
def subtract(self, *args): return vimagemodule.VImage_subtract(self, *args)
def tan(self): return vimagemodule.VImage_tan(self)
def andimage(self, *args): return vimagemodule.VImage_andimage(self, *args)
def orimage(self, *args): return vimagemodule.VImage_orimage(self, *args)
def eorimage(self, *args): return vimagemodule.VImage_eorimage(self, *args)
def shiftleft(self, *args): return vimagemodule.VImage_shiftleft(self, *args)
def shiftright(self, *args): return vimagemodule.VImage_shiftright(self, *args)
def greyc(self, *args): return vimagemodule.VImage_greyc(self, *args)
def greyc_mask(self, *args): return vimagemodule.VImage_greyc_mask(self, *args)
def LCh2Lab(self): return vimagemodule.VImage_LCh2Lab(self)
def LCh2UCS(self): return vimagemodule.VImage_LCh2UCS(self)
def Lab2LCh(self): return vimagemodule.VImage_Lab2LCh(self)
def Lab2LabQ(self): return vimagemodule.VImage_Lab2LabQ(self)
def Lab2LabS(self): return vimagemodule.VImage_Lab2LabS(self)
def Lab2UCS(self): return vimagemodule.VImage_Lab2UCS(self)
def Lab2XYZ(self): return vimagemodule.VImage_Lab2XYZ(self)
def Lab2XYZ_temp(self, *args): return vimagemodule.VImage_Lab2XYZ_temp(self, *args)
def Lab2disp(self, *args): return vimagemodule.VImage_Lab2disp(self, *args)
def LabQ2LabS(self): return vimagemodule.VImage_LabQ2LabS(self)
def LabQ2Lab(self): return vimagemodule.VImage_LabQ2Lab(self)
def LabQ2XYZ(self): return vimagemodule.VImage_LabQ2XYZ(self)
def LabQ2disp(self, *args): return vimagemodule.VImage_LabQ2disp(self, *args)
def LabS2LabQ(self): return vimagemodule.VImage_LabS2LabQ(self)
def LabS2Lab(self): return vimagemodule.VImage_LabS2Lab(self)
def UCS2LCh(self): return vimagemodule.VImage_UCS2LCh(self)
def UCS2Lab(self): return vimagemodule.VImage_UCS2Lab(self)
def UCS2XYZ(self): return vimagemodule.VImage_UCS2XYZ(self)
def XYZ2Lab(self): return vimagemodule.VImage_XYZ2Lab(self)
def XYZ2Lab_temp(self, *args): return vimagemodule.VImage_XYZ2Lab_temp(self, *args)
def XYZ2UCS(self): return vimagemodule.VImage_XYZ2UCS(self)
def XYZ2Yxy(self): return vimagemodule.VImage_XYZ2Yxy(self)
def XYZ2disp(self, *args): return vimagemodule.VImage_XYZ2disp(self, *args)
def XYZ2sRGB(self): return vimagemodule.VImage_XYZ2sRGB(self)
def Yxy2XYZ(self): return vimagemodule.VImage_Yxy2XYZ(self)
def dE00_fromLab(self, *args): return vimagemodule.VImage_dE00_fromLab(self, *args)
def dECMC_fromLab(self, *args): return vimagemodule.VImage_dECMC_fromLab(self, *args)
def dECMC_fromdisp(self, *args): return vimagemodule.VImage_dECMC_fromdisp(self, *args)
def dE_fromLab(self, *args): return vimagemodule.VImage_dE_fromLab(self, *args)
def dE_fromXYZ(self, *args): return vimagemodule.VImage_dE_fromXYZ(self, *args)
def dE_fromdisp(self, *args): return vimagemodule.VImage_dE_fromdisp(self, *args)
def disp2Lab(self, *args): return vimagemodule.VImage_disp2Lab(self, *args)
def disp2XYZ(self, *args): return vimagemodule.VImage_disp2XYZ(self, *args)
def float2rad(self): return vimagemodule.VImage_float2rad(self)
def icc_ac2rc(self, *args): return vimagemodule.VImage_icc_ac2rc(self, *args)
def icc_export(self, *args): return vimagemodule.VImage_icc_export(self, *args)
def icc_export_depth(self, *args): return vimagemodule.VImage_icc_export_depth(self, *args)
def icc_import(self, *args): return vimagemodule.VImage_icc_import(self, *args)
def icc_import_embedded(self, *args): return vimagemodule.VImage_icc_import_embedded(self, *args)
def icc_transform(self, *args): return vimagemodule.VImage_icc_transform(self, *args)
def lab_morph(self, *args): return vimagemodule.VImage_lab_morph(self, *args)
def rad2float(self): return vimagemodule.VImage_rad2float(self)
def sRGB2XYZ(self): return vimagemodule.VImage_sRGB2XYZ(self)
def bandjoin(self, *args): return vimagemodule.VImage_bandjoin(self, *args)
__swig_getmethods__["black"] = lambda x: vimagemodule.VImage_black
if _newclass:black = staticmethod(vimagemodule.VImage_black)
def c2amph(self): return vimagemodule.VImage_c2amph(self)
def c2imag(self): return vimagemodule.VImage_c2imag(self)
def c2ps(self): return vimagemodule.VImage_c2ps(self)
def c2real(self): return vimagemodule.VImage_c2real(self)
def c2rect(self): return vimagemodule.VImage_c2rect(self)
def clip2c(self): return vimagemodule.VImage_clip2c(self)
def clip2cm(self): return vimagemodule.VImage_clip2cm(self)
def clip2d(self): return vimagemodule.VImage_clip2d(self)
def clip2dcm(self): return vimagemodule.VImage_clip2dcm(self)
def clip2f(self): return vimagemodule.VImage_clip2f(self)
def clip2fmt(self, *args): return vimagemodule.VImage_clip2fmt(self, *args)
def clip2i(self): return vimagemodule.VImage_clip2i(self)
def clip2s(self): return vimagemodule.VImage_clip2s(self)
def clip2ui(self): return vimagemodule.VImage_clip2ui(self)
def clip2us(self): return vimagemodule.VImage_clip2us(self)
def clip(self): return vimagemodule.VImage_clip(self)
def copy(self): return vimagemodule.VImage_copy(self)
def copy_morph(self, *args): return vimagemodule.VImage_copy_morph(self, *args)
def copy_swap(self): return vimagemodule.VImage_copy_swap(self)
def copy_set(self, *args): return vimagemodule.VImage_copy_set(self, *args)
def extract_area(self, *args): return vimagemodule.VImage_extract_area(self, *args)
def extract_areabands(self, *args): return vimagemodule.VImage_extract_areabands(self, *args)
def extract_band(self, *args): return vimagemodule.VImage_extract_band(self, *args)
def extract_bands(self, *args): return vimagemodule.VImage_extract_bands(self, *args)
def extract(self, *args): return vimagemodule.VImage_extract(self, *args)
def falsecolour(self): return vimagemodule.VImage_falsecolour(self)
def fliphor(self): return vimagemodule.VImage_fliphor(self)
def flipver(self): return vimagemodule.VImage_flipver(self)
__swig_getmethods__["gbandjoin"] = lambda x: vimagemodule.VImage_gbandjoin
if _newclass:gbandjoin = staticmethod(vimagemodule.VImage_gbandjoin)
def grid(self, *args): return vimagemodule.VImage_grid(self, *args)
def insert(self, *args): return vimagemodule.VImage_insert(self, *args)
def insert_noexpand(self, *args): return vimagemodule.VImage_insert_noexpand(self, *args)
def lrjoin(self, *args): return vimagemodule.VImage_lrjoin(self, *args)
__swig_getmethods__["mask2vips"] = lambda x: vimagemodule.VImage_mask2vips
if _newclass:mask2vips = staticmethod(vimagemodule.VImage_mask2vips)
def msb(self): return vimagemodule.VImage_msb(self)
def msb_band(self, *args): return vimagemodule.VImage_msb_band(self, *args)
def recomb(self, *args): return vimagemodule.VImage_recomb(self, *args)
def replicate(self, *args): return vimagemodule.VImage_replicate(self, *args)
def ri2c(self, *args): return vimagemodule.VImage_ri2c(self, *args)
def rot180(self): return vimagemodule.VImage_rot180(self)
def rot270(self): return vimagemodule.VImage_rot270(self)
def rot90(self): return vimagemodule.VImage_rot90(self)
def scale(self): return vimagemodule.VImage_scale(self)
def scaleps(self): return vimagemodule.VImage_scaleps(self)
def rightshift_size(self, *args): return vimagemodule.VImage_rightshift_size(self, *args)
def slice(self, *args): return vimagemodule.VImage_slice(self, *args)
def subsample(self, *args): return vimagemodule.VImage_subsample(self, *args)
def system(self, *args): return vimagemodule.VImage_system(self, *args)
def tbjoin(self, *args): return vimagemodule.VImage_tbjoin(self, *args)
__swig_getmethods__["text"] = lambda x: vimagemodule.VImage_text
if _newclass:text = staticmethod(vimagemodule.VImage_text)
def thresh(self, *args): return vimagemodule.VImage_thresh(self, *args)
def vips2mask(self): return vimagemodule.VImage_vips2mask(self)
def wrap(self, *args): return vimagemodule.VImage_wrap(self, *args)
def zoom(self, *args): return vimagemodule.VImage_zoom(self, *args)
def addgnoise(self, *args): return vimagemodule.VImage_addgnoise(self, *args)
def compass(self, *args): return vimagemodule.VImage_compass(self, *args)
def contrast_surface(self, *args): return vimagemodule.VImage_contrast_surface(self, *args)
def contrast_surface_raw(self, *args): return vimagemodule.VImage_contrast_surface_raw(self, *args)
def conv(self, *args): return vimagemodule.VImage_conv(self, *args)
def conv_raw(self, *args): return vimagemodule.VImage_conv_raw(self, *args)
def convf(self, *args): return vimagemodule.VImage_convf(self, *args)
def convf_raw(self, *args): return vimagemodule.VImage_convf_raw(self, *args)
def convsep(self, *args): return vimagemodule.VImage_convsep(self, *args)
def convsep_raw(self, *args): return vimagemodule.VImage_convsep_raw(self, *args)
def convsepf(self, *args): return vimagemodule.VImage_convsepf(self, *args)
def convsepf_raw(self, *args): return vimagemodule.VImage_convsepf_raw(self, *args)
def convsub(self, *args): return vimagemodule.VImage_convsub(self, *args)
def embed(self, *args): return vimagemodule.VImage_embed(self, *args)
def fastcor(self, *args): return vimagemodule.VImage_fastcor(self, *args)
def fastcor_raw(self, *args): return vimagemodule.VImage_fastcor_raw(self, *args)
__swig_getmethods__["gaussnoise"] = lambda x: vimagemodule.VImage_gaussnoise
if _newclass:gaussnoise = staticmethod(vimagemodule.VImage_gaussnoise)
def grad_x(self): return vimagemodule.VImage_grad_x(self)
def grad_y(self): return vimagemodule.VImage_grad_y(self)
def gradcor(self, *args): return vimagemodule.VImage_gradcor(self, *args)
def gradcor_raw(self, *args): return vimagemodule.VImage_gradcor_raw(self, *args)
def gradient(self, *args): return vimagemodule.VImage_gradient(self, *args)
__swig_getmethods__["rank_image"] = lambda x: vimagemodule.VImage_rank_image
if _newclass:rank_image = staticmethod(vimagemodule.VImage_rank_image)
def lindetect(self, *args): return vimagemodule.VImage_lindetect(self, *args)
__swig_getmethods__["maxvalue"] = lambda x: vimagemodule.VImage_maxvalue
if _newclass:maxvalue = staticmethod(vimagemodule.VImage_maxvalue)
def mpercent(self, *args): return vimagemodule.VImage_mpercent(self, *args)
def phasecor_fft(self, *args): return vimagemodule.VImage_phasecor_fft(self, *args)
def rank(self, *args): return vimagemodule.VImage_rank(self, *args)
def rank_raw(self, *args): return vimagemodule.VImage_rank_raw(self, *args)
def resize_linear(self, *args): return vimagemodule.VImage_resize_linear(self, *args)
def sharpen(self, *args): return vimagemodule.VImage_sharpen(self, *args)
def shrink(self, *args): return vimagemodule.VImage_shrink(self, *args)
def spcor(self, *args): return vimagemodule.VImage_spcor(self, *args)
def spcor_raw(self, *args): return vimagemodule.VImage_spcor_raw(self, *args)
def stretch3(self, *args): return vimagemodule.VImage_stretch3(self, *args)
def zerox(self, *args): return vimagemodule.VImage_zerox(self, *args)
__swig_getmethods__["csv2vips"] = lambda x: vimagemodule.VImage_csv2vips
if _newclass:csv2vips = staticmethod(vimagemodule.VImage_csv2vips)
__swig_getmethods__["jpeg2vips"] = lambda x: vimagemodule.VImage_jpeg2vips
if _newclass:jpeg2vips = staticmethod(vimagemodule.VImage_jpeg2vips)
__swig_getmethods__["magick2vips"] = lambda x: vimagemodule.VImage_magick2vips
if _newclass:magick2vips = staticmethod(vimagemodule.VImage_magick2vips)
__swig_getmethods__["png2vips"] = lambda x: vimagemodule.VImage_png2vips
if _newclass:png2vips = staticmethod(vimagemodule.VImage_png2vips)
__swig_getmethods__["exr2vips"] = lambda x: vimagemodule.VImage_exr2vips
if _newclass:exr2vips = staticmethod(vimagemodule.VImage_exr2vips)
__swig_getmethods__["ppm2vips"] = lambda x: vimagemodule.VImage_ppm2vips
if _newclass:ppm2vips = staticmethod(vimagemodule.VImage_ppm2vips)
__swig_getmethods__["analyze2vips"] = lambda x: vimagemodule.VImage_analyze2vips
if _newclass:analyze2vips = staticmethod(vimagemodule.VImage_analyze2vips)
__swig_getmethods__["tiff2vips"] = lambda x: vimagemodule.VImage_tiff2vips
if _newclass:tiff2vips = staticmethod(vimagemodule.VImage_tiff2vips)
def vips2csv(self, *args): return vimagemodule.VImage_vips2csv(self, *args)
def vips2jpeg(self, *args): return vimagemodule.VImage_vips2jpeg(self, *args)
def vips2mimejpeg(self, *args): return vimagemodule.VImage_vips2mimejpeg(self, *args)
def vips2png(self, *args): return vimagemodule.VImage_vips2png(self, *args)
def vips2ppm(self, *args): return vimagemodule.VImage_vips2ppm(self, *args)
def vips2tiff(self, *args): return vimagemodule.VImage_vips2tiff(self, *args)
__swig_getmethods__["create_fmask"] = lambda x: vimagemodule.VImage_create_fmask
if _newclass:create_fmask = staticmethod(vimagemodule.VImage_create_fmask)
def disp_ps(self): return vimagemodule.VImage_disp_ps(self)
def flt_image_freq(self, *args): return vimagemodule.VImage_flt_image_freq(self, *args)
__swig_getmethods__["fractsurf"] = lambda x: vimagemodule.VImage_fractsurf
if _newclass:fractsurf = staticmethod(vimagemodule.VImage_fractsurf)
def freqflt(self, *args): return vimagemodule.VImage_freqflt(self, *args)
def fwfft(self): return vimagemodule.VImage_fwfft(self)
def rotquad(self): return vimagemodule.VImage_rotquad(self)
def invfft(self): return vimagemodule.VImage_invfft(self)
def invfftr(self): return vimagemodule.VImage_invfftr(self)
def gammacorrect(self, *args): return vimagemodule.VImage_gammacorrect(self, *args)
def heq(self, *args): return vimagemodule.VImage_heq(self, *args)
def hist(self, *args): return vimagemodule.VImage_hist(self, *args)
def histcum(self): return vimagemodule.VImage_histcum(self)
def histeq(self): return vimagemodule.VImage_histeq(self)
def histgr(self, *args): return vimagemodule.VImage_histgr(self, *args)
def histnD(self, *args): return vimagemodule.VImage_histnD(self, *args)
def histnorm(self): return vimagemodule.VImage_histnorm(self)
def histplot(self): return vimagemodule.VImage_histplot(self)
def histspec(self, *args): return vimagemodule.VImage_histspec(self, *args)
def hsp(self, *args): return vimagemodule.VImage_hsp(self, *args)
__swig_getmethods__["identity"] = lambda x: vimagemodule.VImage_identity
if _newclass:identity = staticmethod(vimagemodule.VImage_identity)
__swig_getmethods__["identity_ushort"] = lambda x: vimagemodule.VImage_identity_ushort
if _newclass:identity_ushort = staticmethod(vimagemodule.VImage_identity_ushort)
def ismonotonic(self): return vimagemodule.VImage_ismonotonic(self)
def lhisteq(self, *args): return vimagemodule.VImage_lhisteq(self, *args)
def lhisteq_raw(self, *args): return vimagemodule.VImage_lhisteq_raw(self, *args)
__swig_getmethods__["invertlut"] = lambda x: vimagemodule.VImage_invertlut
if _newclass:invertlut = staticmethod(vimagemodule.VImage_invertlut)
__swig_getmethods__["buildlut"] = lambda x: vimagemodule.VImage_buildlut
if _newclass:buildlut = staticmethod(vimagemodule.VImage_buildlut)
def maplut(self, *args): return vimagemodule.VImage_maplut(self, *args)
def project(self, *args): return vimagemodule.VImage_project(self, *args)
def stdif(self, *args): return vimagemodule.VImage_stdif(self, *args)
def stdif_raw(self, *args): return vimagemodule.VImage_stdif_raw(self, *args)
def tone_analyse(self, *args): return vimagemodule.VImage_tone_analyse(self, *args)
__swig_getmethods__["tone_build"] = lambda x: vimagemodule.VImage_tone_build
if _newclass:tone_build = staticmethod(vimagemodule.VImage_tone_build)
__swig_getmethods__["tone_build_range"] = lambda x: vimagemodule.VImage_tone_build_range
if _newclass:tone_build_range = staticmethod(vimagemodule.VImage_tone_build_range)
def tone_map(self, *args): return vimagemodule.VImage_tone_map(self, *args)
def circle(self, *args): return vimagemodule.VImage_circle(self, *args)
def flood_blob_copy(self, *args): return vimagemodule.VImage_flood_blob_copy(self, *args)
def insertplace(self, *args): return vimagemodule.VImage_insertplace(self, *args)
def line(self, *args): return vimagemodule.VImage_line(self, *args)
def lineset(self, *args): return vimagemodule.VImage_lineset(self, *args)
__swig_getmethods__["binfile"] = lambda x: vimagemodule.VImage_binfile
if _newclass:binfile = staticmethod(vimagemodule.VImage_binfile)
def cache(self, *args): return vimagemodule.VImage_cache(self, *args)
def header_get_type(self, *args): return vimagemodule.VImage_header_get_type(self, *args)
def header_int(self, *args): return vimagemodule.VImage_header_int(self, *args)
def header_double(self, *args): return vimagemodule.VImage_header_double(self, *args)
def header_string(self, *args): return vimagemodule.VImage_header_string(self, *args)
def cntlines(self, *args): return vimagemodule.VImage_cntlines(self, *args)
def dilate(self, *args): return vimagemodule.VImage_dilate(self, *args)
def dilate_raw(self, *args): return vimagemodule.VImage_dilate_raw(self, *args)
def erode(self, *args): return vimagemodule.VImage_erode(self, *args)
def erode_raw(self, *args): return vimagemodule.VImage_erode_raw(self, *args)
def profile(self, *args): return vimagemodule.VImage_profile(self, *args)
def align_bands(self): return vimagemodule.VImage_align_bands(self)
def correl(self, *args): return vimagemodule.VImage_correl(self, *args)
def _find_lroverlap(self, *args): return vimagemodule.VImage__find_lroverlap(self, *args)
def _find_tboverlap(self, *args): return vimagemodule.VImage__find_tboverlap(self, *args)
def global_balance(self, *args): return vimagemodule.VImage_global_balance(self, *args)
def global_balancef(self, *args): return vimagemodule.VImage_global_balancef(self, *args)
def lrmerge(self, *args): return vimagemodule.VImage_lrmerge(self, *args)
def lrmerge1(self, *args): return vimagemodule.VImage_lrmerge1(self, *args)
def lrmosaic(self, *args): return vimagemodule.VImage_lrmosaic(self, *args)
def lrmosaic1(self, *args): return vimagemodule.VImage_lrmosaic1(self, *args)
def match_linear(self, *args): return vimagemodule.VImage_match_linear(self, *args)
def match_linear_search(self, *args): return vimagemodule.VImage_match_linear_search(self, *args)
def maxpos_subpel(self, *args): return vimagemodule.VImage_maxpos_subpel(self, *args)
def remosaic(self, *args): return vimagemodule.VImage_remosaic(self, *args)
def tbmerge(self, *args): return vimagemodule.VImage_tbmerge(self, *args)
def tbmerge1(self, *args): return vimagemodule.VImage_tbmerge1(self, *args)
def tbmosaic(self, *args): return vimagemodule.VImage_tbmosaic(self, *args)
def tbmosaic1(self, *args): return vimagemodule.VImage_tbmosaic1(self, *args)
def benchmark(self): return vimagemodule.VImage_benchmark(self)
def benchmark2(self): return vimagemodule.VImage_benchmark2(self)
def benchmarkn(self, *args): return vimagemodule.VImage_benchmarkn(self, *args)
__swig_getmethods__["eye"] = lambda x: vimagemodule.VImage_eye
if _newclass:eye = staticmethod(vimagemodule.VImage_eye)
__swig_getmethods__["grey"] = lambda x: vimagemodule.VImage_grey
if _newclass:grey = staticmethod(vimagemodule.VImage_grey)
__swig_getmethods__["feye"] = lambda x: vimagemodule.VImage_feye
if _newclass:feye = staticmethod(vimagemodule.VImage_feye)
__swig_getmethods__["fgrey"] = lambda x: vimagemodule.VImage_fgrey
if _newclass:fgrey = staticmethod(vimagemodule.VImage_fgrey)
__swig_getmethods__["fzone"] = lambda x: vimagemodule.VImage_fzone
if _newclass:fzone = staticmethod(vimagemodule.VImage_fzone)
__swig_getmethods__["make_xy"] = lambda x: vimagemodule.VImage_make_xy
if _newclass:make_xy = staticmethod(vimagemodule.VImage_make_xy)
__swig_getmethods__["zone"] = lambda x: vimagemodule.VImage_zone
if _newclass:zone = staticmethod(vimagemodule.VImage_zone)
def blend(self, *args): return vimagemodule.VImage_blend(self, *args)
def equal(self, *args): return vimagemodule.VImage_equal(self, *args)
def ifthenelse(self, *args): return vimagemodule.VImage_ifthenelse(self, *args)
def less(self, *args): return vimagemodule.VImage_less(self, *args)
def lesseq(self, *args): return vimagemodule.VImage_lesseq(self, *args)
def more(self, *args): return vimagemodule.VImage_more(self, *args)
def moreeq(self, *args): return vimagemodule.VImage_moreeq(self, *args)
def notequal(self, *args): return vimagemodule.VImage_notequal(self, *args)
def affine(self, *args): return vimagemodule.VImage_affine(self, *args)
def similarity_area(self, *args): return vimagemodule.VImage_similarity_area(self, *args)
def similarity(self, *args): return vimagemodule.VImage_similarity(self, *args)
__swig_getmethods__["video_test"] = lambda x: vimagemodule.VImage_video_test
if _newclass:video_test = staticmethod(vimagemodule.VImage_video_test)
__swig_getmethods__["video_v4l1"] = lambda x: vimagemodule.VImage_video_v4l1
if _newclass:video_v4l1 = staticmethod(vimagemodule.VImage_video_v4l1)
def tobuffer(self): return vimagemodule.VImage_tobuffer(self)
__swig_getmethods__["frombuffer"] = lambda x: vimagemodule.VImage_frombuffer
if _newclass:frombuffer = staticmethod(vimagemodule.VImage_frombuffer)
def tostring(self): return vimagemodule.VImage_tostring(self)
__swig_getmethods__["fromstring"] = lambda x: vimagemodule.VImage_fromstring
if _newclass:fromstring = staticmethod(vimagemodule.VImage_fromstring)
VImage_swigregister = vimagemodule.VImage_swigregister
VImage_swigregister(VImage)
def VImage_print_all():
return vimagemodule.VImage_print_all()
VImage_print_all = vimagemodule.VImage_print_all
def VImage_convert2disc(*args):
return vimagemodule.VImage_convert2disc(*args)
VImage_convert2disc = vimagemodule.VImage_convert2disc
def VImage_linreg(*args):
return vimagemodule.VImage_linreg(*args)
VImage_linreg = vimagemodule.VImage_linreg
def VImage_black(*args):
return vimagemodule.VImage_black(*args)
VImage_black = vimagemodule.VImage_black
def VImage_gbandjoin(*args):
return vimagemodule.VImage_gbandjoin(*args)
VImage_gbandjoin = vimagemodule.VImage_gbandjoin
def VImage_mask2vips(*args):
return vimagemodule.VImage_mask2vips(*args)
VImage_mask2vips = vimagemodule.VImage_mask2vips
def VImage_text(*args):
return vimagemodule.VImage_text(*args)
VImage_text = vimagemodule.VImage_text
def VImage_gaussnoise(*args):
return vimagemodule.VImage_gaussnoise(*args)
VImage_gaussnoise = vimagemodule.VImage_gaussnoise
def VImage_rank_image(*args):
return vimagemodule.VImage_rank_image(*args)
VImage_rank_image = vimagemodule.VImage_rank_image
def VImage_maxvalue(*args):
return vimagemodule.VImage_maxvalue(*args)
VImage_maxvalue = vimagemodule.VImage_maxvalue
def VImage_csv2vips(*args):
return vimagemodule.VImage_csv2vips(*args)
VImage_csv2vips = vimagemodule.VImage_csv2vips
def VImage_jpeg2vips(*args):
return vimagemodule.VImage_jpeg2vips(*args)
VImage_jpeg2vips = vimagemodule.VImage_jpeg2vips
def VImage_magick2vips(*args):
return vimagemodule.VImage_magick2vips(*args)
VImage_magick2vips = vimagemodule.VImage_magick2vips
def VImage_png2vips(*args):
return vimagemodule.VImage_png2vips(*args)
VImage_png2vips = vimagemodule.VImage_png2vips
def VImage_exr2vips(*args):
return vimagemodule.VImage_exr2vips(*args)
VImage_exr2vips = vimagemodule.VImage_exr2vips
def VImage_ppm2vips(*args):
return vimagemodule.VImage_ppm2vips(*args)
VImage_ppm2vips = vimagemodule.VImage_ppm2vips
def VImage_analyze2vips(*args):
return vimagemodule.VImage_analyze2vips(*args)
VImage_analyze2vips = vimagemodule.VImage_analyze2vips
def VImage_tiff2vips(*args):
return vimagemodule.VImage_tiff2vips(*args)
VImage_tiff2vips = vimagemodule.VImage_tiff2vips
def VImage_create_fmask(*args):
return vimagemodule.VImage_create_fmask(*args)
VImage_create_fmask = vimagemodule.VImage_create_fmask
def VImage_fractsurf(*args):
return vimagemodule.VImage_fractsurf(*args)
VImage_fractsurf = vimagemodule.VImage_fractsurf
def VImage_identity(*args):
return vimagemodule.VImage_identity(*args)
VImage_identity = vimagemodule.VImage_identity
def VImage_identity_ushort(*args):
return vimagemodule.VImage_identity_ushort(*args)
VImage_identity_ushort = vimagemodule.VImage_identity_ushort
def VImage_invertlut(*args):
return vimagemodule.VImage_invertlut(*args)
VImage_invertlut = vimagemodule.VImage_invertlut
def VImage_buildlut(*args):
return vimagemodule.VImage_buildlut(*args)
VImage_buildlut = vimagemodule.VImage_buildlut
def VImage_tone_build(*args):
return vimagemodule.VImage_tone_build(*args)
VImage_tone_build = vimagemodule.VImage_tone_build
def VImage_tone_build_range(*args):
return vimagemodule.VImage_tone_build_range(*args)
VImage_tone_build_range = vimagemodule.VImage_tone_build_range
def VImage_binfile(*args):
return vimagemodule.VImage_binfile(*args)
VImage_binfile = vimagemodule.VImage_binfile
def VImage_eye(*args):
return vimagemodule.VImage_eye(*args)
VImage_eye = vimagemodule.VImage_eye
def VImage_grey(*args):
return vimagemodule.VImage_grey(*args)
VImage_grey = vimagemodule.VImage_grey
def VImage_feye(*args):
return vimagemodule.VImage_feye(*args)
VImage_feye = vimagemodule.VImage_feye
def VImage_fgrey(*args):
return vimagemodule.VImage_fgrey(*args)
VImage_fgrey = vimagemodule.VImage_fgrey
def VImage_fzone(*args):
return vimagemodule.VImage_fzone(*args)
VImage_fzone = vimagemodule.VImage_fzone
def VImage_make_xy(*args):
return vimagemodule.VImage_make_xy(*args)
VImage_make_xy = vimagemodule.VImage_make_xy
def VImage_zone(*args):
return vimagemodule.VImage_zone(*args)
VImage_zone = vimagemodule.VImage_zone
def VImage_video_test(*args):
return vimagemodule.VImage_video_test(*args)
VImage_video_test = vimagemodule.VImage_video_test
def VImage_video_v4l1(*args):
return vimagemodule.VImage_video_v4l1(*args)
VImage_video_v4l1 = vimagemodule.VImage_video_v4l1
def VImage_frombuffer(*args):
return vimagemodule.VImage_frombuffer(*args)
VImage_frombuffer = vimagemodule.VImage_frombuffer
def VImage_fromstring(*args):
return vimagemodule.VImage_fromstring(*args)
VImage_fromstring = vimagemodule.VImage_fromstring
def im_init_world(*args):
return vimagemodule.im_init_world(*args)
im_init_world = vimagemodule.im_init_world
def im__print_all():
return vimagemodule.im__print_all()
im__print_all = vimagemodule.im__print_all
def im_col_Lab2XYZ(*args):
return vimagemodule.im_col_Lab2XYZ(*args)
im_col_Lab2XYZ = vimagemodule.im_col_Lab2XYZ
# try to guess a PIL mode string from a VIPS image
def PIL_mode_from_vips (vim):
if vim.Bands () == 3 and vim.BandFmt () == VImage.FMTUCHAR:
return 'RGB'
elif vim.Bands () == 4 and vim.BandFmt () == VImage.FMTUCHAR and vim.Type == VImage.VImage.RGB:
return 'RGBA'
elif vim.Bands () == 4 and vim.BandFmt () == VImage.FMTUCHAR and vim.Type == VImage.CMYK:
return 'CMYK'
elif vim.Bands () == 1 and vim.BandFmt () == VImage.FMTUCHAR:
return 'L'
elif vim.Bands () == 1 and vim.BandFmt () == VImage.FMTINT:
return 'I'
elif vim.Bands () == 1 and vim.BandFmt () == VImage.FMTFLOAT:
return 'F'
elif vim.Bands () == 2 and vim.BandFmt () == VImage.FMTUCHAR:
return 'LA'
else:
raise ValueError ('unsupported vips -> pil image')
# return vips (bands, format, type) for a PIL mode
def vips_from_PIL_mode (mode):
if mode == 'RGB':
return (3, VImage.FMTUCHAR, VImage.RGB)
elif mode == 'RGBA':
return (4, VImage.FMTUCHAR, VImage.RGB)
elif mode == 'CMYK':
return (4, VImage.FMTUCHAR, VImage.CMYK)
elif mode == 'L':
return (1, VImage.FMTUCHAR, VImage.B_W)
elif mode == 'I':
return (1, VImage.FMTINT, VImage.B_W)
elif mode == 'F':
return (1, VImage.FMTFLOAT, VImage.B_W)
elif mode == 'LA':
return (2, VImage.FMTUCHAR, VImage.B_W)
else:
raise ValueError ('unsupported pil -> vips image')

View File

@ -1,189 +0,0 @@
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.40
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
# This file is compatible with both classic and new-style classes.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('vmaskmodule', [dirname(__file__)])
except ImportError:
import vmaskmodule
return vmaskmodule
if fp is not None:
try:
_mod = imp.load_module('vmaskmodule', fp, pathname, description)
finally:
fp.close()
return _mod
vmaskmodule = swig_import_helper()
del swig_import_helper
else:
import vmaskmodule
del version_info
try:
_swig_property = property
except NameError:
pass # Python < 2.2 doesn't have 'property'.
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static) or hasattr(self,name):
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self,class_type,name,value):
return _swig_setattr_nondynamic(self,class_type,name,value,0)
def _swig_getattr(self,class_type,name):
if (name == "thisown"): return self.this.own()
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError(name)
def _swig_repr(self):
try: strthis = "proxy of " + self.this.__repr__()
except: strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
try:
_object = object
_newclass = 1
except AttributeError:
class _object : pass
_newclass = 0
import VError
import VImage
import VDisplay
class VMask(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, VMask, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, VMask, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = vmaskmodule.new_VMask(*args)
try: self.this.append(this)
except: self.this = this
def __assign__(self, *args): return vmaskmodule.VMask___assign__(self, *args)
__swig_destroy__ = vmaskmodule.delete_VMask
__del__ = lambda self : None;
def xsize(self): return vmaskmodule.VMask_xsize(self)
def ysize(self): return vmaskmodule.VMask_ysize(self)
def size(self): return vmaskmodule.VMask_size(self)
def filename(self): return vmaskmodule.VMask_filename(self)
def type(self): return vmaskmodule.VMask_type(self)
def mask(self): return vmaskmodule.VMask_mask(self)
def ostream_print(self, *args): return vmaskmodule.VMask_ostream_print(self, *args)
VMask_swigregister = vmaskmodule.VMask_swigregister
VMask_swigregister(VMask)
class VIMask(VMask):
__swig_setmethods__ = {}
for _s in [VMask]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, VIMask, name, value)
__swig_getmethods__ = {}
for _s in [VMask]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, VIMask, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = vmaskmodule.new_VIMask(*args)
try: self.this.append(this)
except: self.this = this
def scale(self): return vmaskmodule.VIMask_scale(self)
def offset(self): return vmaskmodule.VIMask_offset(self)
def embed(self, *args): return vmaskmodule.VIMask_embed(self, *args)
def __index__(self, *args): return vmaskmodule.VIMask___index__(self, *args)
def __call__(self, *args): return vmaskmodule.VIMask___call__(self, *args)
def get(self, *args): return vmaskmodule.VIMask_get(self, *args)
__swig_getmethods__["gauss"] = lambda x: vmaskmodule.VIMask_gauss
if _newclass:gauss = staticmethod(vmaskmodule.VIMask_gauss)
__swig_getmethods__["gauss_sep"] = lambda x: vmaskmodule.VIMask_gauss_sep
if _newclass:gauss_sep = staticmethod(vmaskmodule.VIMask_gauss_sep)
__swig_getmethods__["log"] = lambda x: vmaskmodule.VIMask_log
if _newclass:log = staticmethod(vmaskmodule.VIMask_log)
def rotate45(self): return vmaskmodule.VIMask_rotate45(self)
def rotate90(self): return vmaskmodule.VIMask_rotate90(self)
def trn(self): return vmaskmodule.VIMask_trn(self)
def inv(self): return vmaskmodule.VIMask_inv(self)
def cat(self, *args): return vmaskmodule.VIMask_cat(self, *args)
def mul(self, *args): return vmaskmodule.VIMask_mul(self, *args)
__swig_destroy__ = vmaskmodule.delete_VIMask
__del__ = lambda self : None;
VIMask_swigregister = vmaskmodule.VIMask_swigregister
VIMask_swigregister(VIMask)
def __lshift__(*args):
return vmaskmodule.__lshift__(*args)
__lshift__ = vmaskmodule.__lshift__
def VIMask_gauss(*args):
return vmaskmodule.VIMask_gauss(*args)
VIMask_gauss = vmaskmodule.VIMask_gauss
def VIMask_gauss_sep(*args):
return vmaskmodule.VIMask_gauss_sep(*args)
VIMask_gauss_sep = vmaskmodule.VIMask_gauss_sep
def VIMask_log(*args):
return vmaskmodule.VIMask_log(*args)
VIMask_log = vmaskmodule.VIMask_log
class VDMask(VMask):
__swig_setmethods__ = {}
for _s in [VMask]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, VDMask, name, value)
__swig_getmethods__ = {}
for _s in [VMask]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, VDMask, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = vmaskmodule.new_VDMask(*args)
try: self.this.append(this)
except: self.this = this
def embed(self, *args): return vmaskmodule.VDMask_embed(self, *args)
def scale(self): return vmaskmodule.VDMask_scale(self)
def offset(self): return vmaskmodule.VDMask_offset(self)
def __index__(self, *args): return vmaskmodule.VDMask___index__(self, *args)
def __call__(self, *args): return vmaskmodule.VDMask___call__(self, *args)
def get(self, *args): return vmaskmodule.VDMask_get(self, *args)
__swig_getmethods__["gauss"] = lambda x: vmaskmodule.VDMask_gauss
if _newclass:gauss = staticmethod(vmaskmodule.VDMask_gauss)
__swig_getmethods__["log"] = lambda x: vmaskmodule.VDMask_log
if _newclass:log = staticmethod(vmaskmodule.VDMask_log)
def rotate45(self): return vmaskmodule.VDMask_rotate45(self)
def rotate90(self): return vmaskmodule.VDMask_rotate90(self)
def scalei(self): return vmaskmodule.VDMask_scalei(self)
def trn(self): return vmaskmodule.VDMask_trn(self)
def inv(self): return vmaskmodule.VDMask_inv(self)
def cat(self, *args): return vmaskmodule.VDMask_cat(self, *args)
def mul(self, *args): return vmaskmodule.VDMask_mul(self, *args)
__swig_destroy__ = vmaskmodule.delete_VDMask
__del__ = lambda self : None;
VDMask_swigregister = vmaskmodule.VDMask_swigregister
VDMask_swigregister(VDMask)
def VDMask_gauss(*args):
return vmaskmodule.VDMask_gauss(*args)
VDMask_gauss = vmaskmodule.VDMask_gauss
def VDMask_log(*args):
return vmaskmodule.VDMask_log(*args)
VDMask_log = vmaskmodule.VDMask_log

View File

@ -1,3 +0,0 @@
#!/usr/bin/python
__all__ = ["VImage", "VMask", "VError", "VDisplay"]

File diff suppressed because it is too large Load Diff

View File

@ -1,24 +0,0 @@
#!/usr/bin/python
import Image, sys
import ImageFilter
im = Image.open (sys.argv[1])
# Crop 100 pixels off all edges.
im = im.crop ((100, 100, im.size[0] - 100, im.size[1] - 100))
# Shrink by 10%
im = im.resize ((int (im.size[0] * 0.9), int (im.size[1] * 0.9)),
Image.BILINEAR)
# sharpen
filter = ImageFilter.Kernel ((3, 3),
(-1, -1, -1,
-1, 16, -1,
-1, -1, -1))
im = im.filter (filter)
# write back again
im.save (sys.argv[2])

View File

@ -1,24 +0,0 @@
#!/usr/bin/python
import sys
from vipsCC import *
im = VImage.VImage (sys.argv[1])
# Crop 100 pixels off all edges.
im = im.extract_area (100, 100, im.Xsize() - 200, im.Ysize() - 200)
# Shrink by 10%
im = im.affine (0.9, 0, 0, 0.9, 0, 0, 0, 0,
int (im.Xsize() * 0.9), int (im.Ysize() * 0.9))
# sharpen
mask = VMask.VIMask (3, 3, 8, 0,
[-1, -1, -1,
-1, 16, -1,
-1, -1, -1])
im = im.conv (mask)
# write back again
im.write (sys.argv[2])

View File

@ -1,37 +0,0 @@
#!/usr/bin/python
import sys
from vipsCC import *
import Image
# try this 1,000 times and check for leaks
for i in range (0,1000):
vim = VImage.VImage (sys.argv[1])
# do some processing in vips ... cut out a small piece of image
vim = vim.extract_area (500, 500, 100, 100)
# make a PIL image
# we use Image.frombuffer (), so PIL is using vim's memory
# you need to be very careful not to destroy vim until you're done with pim
# ideally you should make a proxy class that wraps this lifetime problem up
mode = VImage.PIL_mode_from_vips (vim)
size = (vim.Xsize (), vim.Ysize ())
data = vim.tobuffer ()
pim = Image.frombuffer (mode, size, data, 'raw', mode, 0, 1)
# rotate 12 degrees with PIL
pim = pim.rotate (12, Image.BILINEAR, 1)
# back to vips again
# PIL doesn't have a tobuffer method, so we have to use tostring to copy the
# data out of PIL and then fromstring to copy back into VIPS
str = pim.tostring ()
bands, format, type = VImage.vips_from_PIL_mode (pim.mode)
width, height = pim.size
vim2 = VImage.VImage.fromstring (str, width, height, bands, format)
# finally write from vips
vim2.write (sys.argv[2])

View File

@ -1,44 +0,0 @@
#!/usr/bin/python
import sys
# just need this for leaktesting
import gc
from vipsCC import *
if len (sys.argv) != 3:
print 'usage:', sys.argv[0], 'inputimage outputimage'
print '\tcalculate photographic negative of inputimage'
sys.exit (1)
try:
a = VImage.VImage (sys.argv[1])
b = a.invert ()
c = b.lin ([1,2,3],[4,5,6])
m = VMask.VIMask (3, 3, 1, 0,
[-1, -1, -1,
-1, 8, -1,
-1, -1, -1])
d = a.conv (m)
d.write (sys.argv[2])
except VError.VError, e:
e.perror (sys.argv[0])
# we can get properties of VImage too
print 'inputimage is', a.Xsize (), 'pixels across'
print 'starting shutdown ...'
del b
del a
del c
del d
del m
# sometimes have to do several GCs to get them all, not sure why
for i in range(10):
gc.collect ()
print 'shutdown!'
print 'leaked IMAGEs:'
VImage.im__print_all ()
print 'done ... hopefully you saw no leaks'