SMIL  0.8
 All Classes Functions Variables Groups Pages
copy_crop.py

1 from smilPython import *
2 
3 im1 = Image("http://cmm.ensmp.fr/~faessel/smil/images/barbara.png")
4 im2 = Image("http://cmm.ensmp.fr/~faessel/smil/images/lena.png")
5 im3 = Image(im1)
6 
7 im1.show()
8 im2.show()
9 im3.show()
10 
11 # Crop the content of im1 from (256, 0) to im3 (which will be resized)
12 crop(im1, 256, 0, 256, 256, im3)
13 
14 # Copy the content of im2 and put it at position (0, 256) in im1
15 copy(im2, im1, 0, 256)
16 
17 # Copy the window starting at (256, 0) and with dimensions 128x128 and put it at (128, 128) in im2
18 copy(im1, 256, 0, 128, 128, im2, 128, 128)
19 # Same as previous (simple way)
20 copy(im1, 256, 0, im2, 128, 128)
21 
22 # Create a 3D image and copy slices inside
23 im3D = Image(im2.getWidth(), im2.getHeight(), 3)
24 im3D << 0
25 copy(im1, 0, 256, im3D)
26 copy(im3, im3D, 0, 0, 2)
27 close(im3D, im3D, cbSE())
28 im3D.show()