2012-01-05 14:26:25 +01:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
import logging
|
|
|
|
logging.basicConfig(level = logging.DEBUG)
|
|
|
|
|
2016-05-18 14:41:41 +02:00
|
|
|
import gi
|
|
|
|
gi.require_version('Vips', '8.0')
|
2012-01-06 15:56:24 +01:00
|
|
|
from gi.repository import Vips
|
|
|
|
Vips.cache_set_trace(True)
|
|
|
|
|
2012-01-05 14:26:25 +01:00
|
|
|
try:
|
2014-08-29 18:33:14 +02:00
|
|
|
a = Vips.Image.new_from_file("/home/john/pics/babe.poop")
|
|
|
|
except Vips.Error, e:
|
2012-01-05 14:26:25 +01:00
|
|
|
print e
|
|
|
|
|
2014-08-29 18:33:14 +02:00
|
|
|
a = Vips.Image.new_from_file("/home/john/pics/babe.jpg")
|
|
|
|
b = Vips.Image.new_from_file("/home/john/pics/k2.jpg")
|
2012-01-05 14:26:25 +01:00
|
|
|
|
|
|
|
print 'a =', a
|
|
|
|
print 'b =', b
|
|
|
|
|
2014-08-29 18:33:14 +02:00
|
|
|
out = Vips.call("add", a, b)
|
2012-01-05 14:26:25 +01:00
|
|
|
|
|
|
|
print 'out =', out
|
|
|
|
|
|
|
|
out = a.add(b)
|
|
|
|
|
|
|
|
print 'out =', out
|
2012-01-06 15:56:24 +01:00
|
|
|
|
2014-08-31 11:41:53 +02:00
|
|
|
ones = Vips.ArrayDouble.new([1])
|
|
|
|
twos = Vips.ArrayDouble.new([2])
|
2014-08-29 19:14:22 +02:00
|
|
|
|
|
|
|
out = out.linear(ones, twos)
|
|
|
|
|
|
|
|
out.write_to_file("x.v")
|