├── Libraries └── Imaging-1.1.7 │ ├── PIL.pth │ ├── Images │ ├── lena.gif │ ├── lena.jpg │ ├── lena.png │ ├── lena.ppm │ ├── courB08.pbm │ └── courB08.pil │ ├── PIL │ ├── WalImageFile.py │ ├── __init__.py │ ├── ImageGL.py │ ├── ImageSequence.py │ ├── ImageFileIO.py │ ├── PaletteFile.py │ ├── TarIO.py │ ├── ImageMode.py │ ├── GimpPaletteFile.py │ ├── ImagePath.py │ ├── BufrStubImagePlugin.py │ ├── GribStubImagePlugin.py │ ├── Hdf5StubImagePlugin.py │ ├── GbrImagePlugin.py │ ├── FitsStubImagePlugin.py │ ├── PixarImagePlugin.py │ ├── McIdasImagePlugin.py │ ├── PcdImagePlugin.py │ ├── XVThumbImagePlugin.py │ ├── MpegImagePlugin.py │ ├── ImageGrab.py │ ├── DcxImagePlugin.py │ ├── IcoImagePlugin.py │ └── CurImagePlugin.py │ ├── BUILDME │ ├── libImaging │ ├── Raw.h │ ├── QuantHeap.h │ ├── QuantDefines.h │ ├── Bit.h │ ├── Negative.c │ ├── Quant.h │ ├── QuantTypes.h │ ├── Lzw.h │ ├── Copy.c │ ├── HexDecode.c │ ├── QuantHash.h │ ├── Offset.c │ ├── Zip.h │ ├── Crop.c │ ├── PcxDecode.c │ ├── ImDib.h │ ├── XbmDecode.c │ ├── EpsEncode.c │ ├── Except.c │ ├── MspDecode.c │ ├── PcdDecode.c │ ├── PackDecode.c │ ├── RawDecode.c │ ├── Matrix.c │ ├── ImPlatform.h │ ├── RawEncode.c │ ├── Blend.c │ ├── XbmEncode.c │ └── SunRleDecode.c │ ├── Docs │ ├── pythondoc-PIL.PdfImagePlugin.html │ ├── pythondoc-PIL.PalmImagePlugin.html │ ├── pythondoc-PIL.BufrStubImagePlugin.html │ ├── pythondoc-PIL.FitsStubImagePlugin.html │ ├── pythondoc-PIL.GribStubImagePlugin.html │ ├── pythondoc-PIL.Hdf5StubImagePlugin.html │ ├── pythondoc-PIL.ImageColor.html │ ├── pythondoc-PIL.TiffTags.html │ ├── pythondoc-PIL.ExifTags.html │ ├── pythondoc-PIL.PSDraw.html │ ├── pythondoc-PIL.FontFile.html │ ├── pythondoc-PIL.WalImageFile.html │ ├── pythondoc-PIL.ImageGL.html │ ├── pythondoc-PIL.BdfFontFile.html │ ├── pythondoc-PIL.PcfFontFile.html │ ├── pythondoc-PIL.PaletteFile.html │ ├── pythondoc-PIL.ImImagePlugin.html │ ├── pythondoc-PIL.GifImagePlugin.html │ ├── pythondoc-PIL.PngImagePlugin.html │ ├── pythondoc-PIL.SgiImagePlugin.html │ ├── pythondoc-PIL.TgaImagePlugin.html │ ├── pythondoc-PIL.XbmImagePlugin.html │ ├── pythondoc-PIL.IcoImagePlugin.html │ ├── pythondoc-PIL.ImtImagePlugin.html │ ├── pythondoc-PIL.MspImagePlugin.html │ ├── pythondoc-PIL.PcdImagePlugin.html │ ├── pythondoc-PIL.PcxImagePlugin.html │ ├── pythondoc-PIL.PsdImagePlugin.html │ ├── pythondoc-PIL.SunImagePlugin.html │ ├── pythondoc-PIL.XpmImagePlugin.html │ ├── pythondoc-PIL.BmpImagePlugin.html │ ├── pythondoc-PIL.CurImagePlugin.html │ ├── pythondoc-PIL.DcxImagePlugin.html │ ├── pythondoc-PIL.EpsImagePlugin.html │ ├── pythondoc-PIL.FpxImagePlugin.html │ ├── pythondoc-PIL.GbrImagePlugin.html │ ├── pythondoc-PIL.PpmImagePlugin.html │ ├── pythondoc-PIL.IcnsImagePlugin.html │ ├── pythondoc-PIL.MpegImagePlugin.html │ ├── pythondoc-PIL.JpegImagePlugin.html │ ├── pythondoc-PIL.MicImagePlugin.html │ ├── pythondoc-PIL.ArgImagePlugin.html │ ├── pythondoc-PIL.PixarImagePlugin.html │ ├── pythondoc-PIL.GimpPaletteFile.html │ ├── pythondoc-PIL.McIdasImagePlugin.html │ ├── pythondoc-PIL.GimpGradientFile.html │ ├── pythondoc-PIL.ImagePalette.html │ ├── pythondoc-PIL.XVThumbImagePlugin.html │ ├── pythondoc-PIL.FliImagePlugin.html │ ├── pythondoc-PIL.ImageGrab.html │ ├── pythondoc-PIL.TarIO.html │ ├── pythondoc-PIL.SpiderImagePlugin.html │ ├── pythondoc-PIL.ImageSequence.html │ ├── pythondoc-PIL.WmfImagePlugin.html │ ├── pythondoc-PIL.ImageStat.html │ ├── pythondoc-PIL.IptcImagePlugin.html │ ├── pythondoc-PIL.GdImageFile.html │ ├── pythondoc-PIL.TiffImagePlugin.html │ ├── pythondoc-PIL.ImageFileIO.html │ ├── pythondoc-PIL.OleFileIO.html │ └── pythondoc-PIL.ImagePath.html │ ├── Sane │ ├── setup.py │ ├── README │ ├── demo_pil.py │ ├── demo_numarray.py │ └── CHANGES │ ├── Scripts │ ├── viewer.py │ ├── pilfont.py │ ├── enhancer.py │ ├── thresholder.py │ └── painter.py │ ├── Tk │ └── install.txt │ └── _imagingtk.c ├── Kernel Scripts ├── abq2img_v0.1 │ ├── neon.png │ └── README ├── Python Example Script │ ├── MatlabFiles │ │ └── Explicit │ │ │ ├── ConstFiles │ │ │ ├── ConstHole.mat │ │ │ ├── ConstWall_10_30.mat │ │ │ ├── ConstWall_10_35.mat │ │ │ ├── ConstWall_10_40.mat │ │ │ ├── ConstWall_10_45.mat │ │ │ ├── ConstWall_10_50.mat │ │ │ ├── ConstWall_10_55.mat │ │ │ ├── ConstWall_10_60.mat │ │ │ ├── ConstWall_15_30.mat │ │ │ ├── ConstWall_15_35.mat │ │ │ ├── ConstWall_15_40.mat │ │ │ ├── ConstWall_15_45.mat │ │ │ ├── ConstWall_15_50.mat │ │ │ ├── ConstWall_15_55.mat │ │ │ ├── ConstWall_15_60.mat │ │ │ ├── ConstWall_20_30.mat │ │ │ ├── ConstWall_20_35.mat │ │ │ ├── ConstWall_20_40.mat │ │ │ ├── ConstWall_20_45.mat │ │ │ ├── ConstWall_20_50.mat │ │ │ ├── ConstWall_20_55.mat │ │ │ ├── ConstWall_20_60.mat │ │ │ ├── ConstWall_25_30.mat │ │ │ ├── ConstWall_25_35.mat │ │ │ ├── ConstWall_25_40.mat │ │ │ ├── ConstWall_25_45.mat │ │ │ ├── ConstWall_25_50.mat │ │ │ ├── ConstWall_25_55.mat │ │ │ ├── ConstWall_25_60.mat │ │ │ ├── ConstWall_30_30.mat │ │ │ ├── ConstWall_30_35.mat │ │ │ ├── ConstWall_30_40.mat │ │ │ ├── ConstWall_30_45.mat │ │ │ ├── ConstWall_30_50.mat │ │ │ ├── ConstWall_30_55.mat │ │ │ ├── ConstWall_30_60.mat │ │ │ ├── ConstWall_5_30.mat │ │ │ ├── ConstWall_5_35.mat │ │ │ ├── ConstWall_5_40.mat │ │ │ ├── ConstWall_5_45.mat │ │ │ ├── ConstWall_5_50.mat │ │ │ ├── ConstWall_5_55.mat │ │ │ ├── ConstWall_5_60.mat │ │ │ ├── eContact_15_50.mat │ │ │ └── ConstPeriodic_50.mat │ │ │ ├── CalcPhi.m │ │ │ ├── GlobPar.m │ │ │ ├── ConVal.m │ │ │ ├── InEqConstraint2.m │ │ │ ├── FileNameSave.m │ │ │ ├── MainOpt.m │ │ │ ├── FuncPer.m │ │ │ ├── MainBrutePois.m │ │ │ ├── ModelCalc.m │ │ │ ├── MakeVar.m │ │ │ └── GlobVar.m │ ├── AbaqusFiles │ │ ├── All-DelFile.py │ │ ├── Pois-Analysis1.py │ │ ├── Pois-Analysis2.py │ │ ├── Pois-Assembly.py │ │ ├── Pois-Movie.py │ │ ├── All-Fig.py │ │ └── Pois-Eval.py │ └── ReadMe.txt └── Write Input Deck │ └── writeInputDeck.py ├── README ├── abaqusPythonRepoTodo.txt └── contents_overview.txt /Libraries/Imaging-1.1.7/PIL.pth: -------------------------------------------------------------------------------- 1 | PIL 2 | -------------------------------------------------------------------------------- /Kernel Scripts/abq2img_v0.1/neon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/abq2img_v0.1/neon.png -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Images/lena.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Libraries/Imaging-1.1.7/Images/lena.gif -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Images/lena.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Libraries/Imaging-1.1.7/Images/lena.jpg -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Images/lena.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Libraries/Imaging-1.1.7/Images/lena.png -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Images/lena.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Libraries/Imaging-1.1.7/Images/lena.ppm -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | abaqusPython 2 | ============ 3 | 4 | A collection of frequently used abaqus scripts and other useful gems! 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Images/courB08.pbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Libraries/Imaging-1.1.7/Images/courB08.pbm -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Images/courB08.pil: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Libraries/Imaging-1.1.7/Images/courB08.pil -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/PIL/WalImageFile.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Libraries/Imaging-1.1.7/PIL/WalImageFile.py -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstHole.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstHole.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_10_30.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_10_30.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_10_35.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_10_35.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_10_40.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_10_40.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_10_45.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_10_45.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_10_50.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_10_50.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_10_55.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_10_55.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_10_60.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_10_60.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_15_30.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_15_30.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_15_35.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_15_35.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_15_40.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_15_40.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_15_45.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_15_45.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_15_50.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_15_50.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_15_55.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_15_55.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_15_60.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_15_60.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_20_30.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_20_30.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_20_35.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_20_35.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_20_40.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_20_40.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_20_45.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_20_45.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_20_50.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_20_50.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_20_55.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_20_55.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_20_60.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_20_60.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_25_30.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_25_30.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_25_35.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_25_35.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_25_40.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_25_40.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_25_45.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_25_45.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_25_50.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_25_50.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_25_55.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_25_55.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_25_60.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_25_60.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_30_30.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_30_30.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_30_35.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_30_35.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_30_40.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_30_40.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_30_45.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_30_45.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_30_50.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_30_50.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_30_55.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_30_55.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_30_60.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_30_60.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_5_30.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_5_30.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_5_35.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_5_35.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_5_40.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_5_40.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_5_45.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_5_45.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_5_50.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_5_50.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_5_55.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_5_55.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_5_60.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstWall_5_60.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/eContact_15_50.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/eContact_15_50.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstPeriodic_50.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quisten/abaqusPython/HEAD/Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConstFiles/ConstPeriodic_50.mat -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/CalcPhi.m: -------------------------------------------------------------------------------- 1 | %Made by J.T.B. Overvelde on 9 may 2011 2 | 3 | function phiMin=CalcPhi(c,t) 4 | 5 | GlobPar 6 | 7 | [C x0 y0]=ConVal(c,t); 8 | A=abs(trapz(C(1,2:end),C(2,2:end))); 9 | phiMin=A/(GridSpaceX*GridSpaceY)-phi; -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/PIL/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library. 3 | # $Id$ 4 | # 5 | # package placeholder 6 | # 7 | # Copyright (c) 1999 by Secret Labs AB. 8 | # 9 | # See the README file for information on usage and redistribution. 10 | # 11 | 12 | # ;-) 13 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/BUILDME: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | # quick build (for lazy programmers). for more information on the 3 | # build process, see the README file. 4 | 5 | if [ "$1" = "clean" ]; then 6 | python setup.py clean 7 | rm -f *.so PIL/*.so 8 | fi 9 | 10 | python setup.py build_ext -i 11 | python selftest.py 12 | -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/GlobPar.m: -------------------------------------------------------------------------------- 1 | %Made by J.T.B. Overvelde on 9 may 2011 2 | 3 | global np numModes maxIncr maxNumIncr wMin 4 | global GridSpaceX GridSpaceY numHolesX numHolesY imperf sizeMesh 5 | global saveData phi MatDir AbDir saveFile 6 | global MatSaveDir saveFig saveMov Mat xv yv muVar K rho mo -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/Raw.h: -------------------------------------------------------------------------------- 1 | /* Raw.h */ 2 | 3 | typedef struct { 4 | 5 | /* CONFIGURATION */ 6 | 7 | /* Distance between lines (0=no padding) */ 8 | int stride; 9 | 10 | /* PRIVATE (initialized by decoder) */ 11 | 12 | /* Padding between lines */ 13 | int skip; 14 | 15 | } RAWSTATE; 16 | -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/AbaqusFiles/All-DelFile.py: -------------------------------------------------------------------------------- 1 | #Made by J.T.B. Overvelde on 9 may 2011 2 | 3 | listBack=['.com','.dat','.inp','.ipm','.lck','.log','.msg','.odb','.prt','.sta'] 4 | for i in listBack: 5 | if os.path.exists(tDr+'/'+jobName1+i)==True: 6 | os.remove(tDr+'/'+jobName1+i) 7 | if os.path.exists(tDr+'/'+jobName2+i)==True: 8 | os.remove(tDr+'/'+jobName2+i) 9 | 10 | -------------------------------------------------------------------------------- /abaqusPythonRepoTodo.txt: -------------------------------------------------------------------------------- 1 | Abaqus Python Script Repo Todolist 2 | -------------------------------------- 3 | 4 | - Create a meaningful folder structure (done) 5 | 6 | - Select a license for the scripts 7 | 8 | - Contact other contributours and ask for permission 9 | - Example Abaqus Script - Johannes T. B Overvelde - http://www.overvelde.com/projects/scriptabaqus/ 10 | 11 | - Create an incomming branch 12 | 13 | -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ConVal.m: -------------------------------------------------------------------------------- 1 | %Made by J.T.B. Overvelde on 9 may 2011 2 | 3 | function [C,x0,y0]=ConVal(c,t) 4 | 5 | GlobPar 6 | 7 | theta=0:2*pi/(np-1):2*pi; 8 | R=1+c(1)*cos(4*theta)+c(2)*cos(8*theta);%+c(3)*cos(12*theta); 9 | C(1,:)=[0 t*R.*cos(theta)]; 10 | C(2,:)=[length(theta) t*R.*sin(theta)]; 11 | 12 | x0=GridSpaceX/2; 13 | y0=GridSpaceY/2; 14 | 15 | %plot(C(1,2:end),C(2,2:end)) -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/InEqConstraint2.m: -------------------------------------------------------------------------------- 1 | %Made by J.T.B. Overvelde on 9 may 2011 2 | 3 | function [ConstVal,Nothing]=InEqConstraint2(c) 4 | 5 | GlobPar 6 | 7 | Nothing=[]; 8 | 9 | cd('./ConstFiles'); 10 | 11 | load(['ConstWall_',num2str(wMin*100),'_',num2str(phi*100)],'c1m','c2m','InEq') 12 | ConstVal(1)=interp2(c1m,c2m,InEq,c(1),c(2)); 13 | 14 | load(['ConstPeriodic_',num2str(phi*100)],'c1m','c2m','ConstPer'); 15 | ConstVal(2)=interp2(c1m,c2m,ConstPer,c(1),c(2)); 16 | 17 | ConstVal 18 | cd('../'); -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/FileNameSave.m: -------------------------------------------------------------------------------- 1 | %Made by J.T.B. Overvelde on 9 may 2011 2 | 3 | %directories 4 | MatDir=pwd; 5 | cd('../');cd('../'); 6 | cd('./AbaqusFiles'); 7 | AbDir=pwd; 8 | cd('../'); 9 | cd('./MatlabOutputFiles'); 10 | if exist(date) 11 | else 12 | mkdir(date) 13 | end 14 | cd(['./',date]) 15 | MatSaveDir=pwd; 16 | cd(MatDir); 17 | 18 | %name save files 19 | saveFile='Test'; 20 | saveFileOld=saveFile; 21 | cd(MatSaveDir) 22 | rep=0; 23 | while exist([saveFile,'.mat'])~=0 24 | rep=rep+1; 25 | saveFile=[saveFileOld,num2str(rep)]; 26 | end 27 | cd(MatDir) -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/MainOpt.m: -------------------------------------------------------------------------------- 1 | %Made by J.T.B. Overvelde on 9 may 2011 2 | 3 | clear, close all, clc; 4 | 5 | GlobPar 6 | 7 | FileNameSave 8 | 9 | %options 10 | options = optimset('Display','iter','LargeScale','off','Tolfun',1e-3,'tolcon',1e-3,'TolX',1e-3,'MaxFunEvals',1000,'Algorithm','active-set','DiffMaxChange',0.5e-1,'DiffMinChange',1e-3); 11 | %optimize 12 | [OptVar, Poisson, drie, vier, vijf, zes] = fmincon(@(c)ModelCalc(c,3),[0,0],[],[],[],[],[],[],@(c)InEqConstraint2(c),options); 13 | 14 | %save mat file 15 | cd(MatSaveDir); 16 | save(saveFile); 17 | cd(MatDir); -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/QuantHeap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library 3 | * $Id$ 4 | * 5 | * image quantizer 6 | * 7 | * Written by Toby J Sargeant . 8 | * 9 | * See the README file for information on usage and redistribution. 10 | */ 11 | 12 | #ifndef __HEAP_H__ 13 | #define __HEAP_H__ 14 | 15 | #include "QuantTypes.h" 16 | 17 | void ImagingQuantHeapFree(Heap); 18 | int ImagingQuantHeapRemove(Heap,void **); 19 | int ImagingQuantHeapAdd(Heap,void *); 20 | int ImagingQuantHeapTop(Heap,void **); 21 | Heap *ImagingQuantHeapNew(HeapCmpFunc); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /Kernel Scripts/Write Input Deck/writeInputDeck.py: -------------------------------------------------------------------------------- 1 | # writeInputDeck.py 2 | # 2014-01-17 Ebbe Smith - PLM Tech AS 3 | # 4 | # Dumps condenced inputdecks for all models in the CAE (same as shown in keyword editor) 5 | # 6 | #-------------------------------------------------- 7 | 8 | from abaqus import * 9 | from abaqusConstants import * 10 | 11 | for modelKey in mdb.models.keys(): 12 | m = mdb.models[modelKey] 13 | block = m.keywordBlock.sieBlocks 14 | 15 | outputfile = open(modelKey+'.txt', 'w') 16 | for line in block: 17 | print line 18 | outputfile.write(line) 19 | outputfile.write('\n') 20 | outputfile.close() 21 | 22 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/PIL/ImageGL.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library. 3 | # $Id$ 4 | # 5 | # OpenGL pixmap/texture interface (requires imToolkit OpenGL extensions) 6 | # 7 | # History: 8 | # 2003-09-13 fl Added 9 | # 10 | # Copyright (c) Secret Labs AB 2003. 11 | # 12 | # See the README file for information on usage and redistribution. 13 | # 14 | 15 | ## 16 | # OpenGL pixmap/texture interface (requires imToolkit OpenGL 17 | # extensions.) 18 | ## 19 | 20 | import _imaginggl 21 | 22 | ## 23 | # Texture factory. 24 | 25 | class TextureFactory: 26 | pass # overwritten by the _imaginggl module 27 | 28 | from _imaginggl import * 29 | -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/AbaqusFiles/Pois-Analysis1.py: -------------------------------------------------------------------------------- 1 | #Made by J.T.B. Overvelde on 9 may 2011 2 | 3 | #execute 4 | os.chdir(tDr) 5 | mdb.Job(contactPrint=OFF, description='', echoPrint=OFF, explicitPrecision= 6 | SINGLE, historyPrint=OFF, memory=90, memoryUnits=PERCENTAGE, model= 7 | modelName1, modelPrint=OFF, multiprocessingMode=DEFAULT, name=jobName1, 8 | nodalOutputPrecision=SINGLE, numCpus=1, numDomains=1, 9 | parallelizationMethodExplicit=DOMAIN, scratch='', type=ANALYSIS, 10 | userSubroutine='') 11 | mdb.jobs[jobName1].submit(consistencyChecking=OFF) 12 | mdb.jobs[jobName1].waitForCompletion() 13 | os.chdir(wDr) 14 | 15 | 16 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/QuantDefines.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library 3 | * $Id$ 4 | * 5 | * image quantizer 6 | * 7 | * Written by Toby J Sargeant . 8 | * 9 | * See the README file for information on usage and redistribution. 10 | */ 11 | 12 | #ifndef __DEFINES_H__ 13 | #define __DEFINES_H__ 14 | 15 | #if 0 16 | 17 | void *newMalloc(size_t,const char *,const char *,int); 18 | void newFree(void *,const char *,const char *,int); 19 | void print_malloc_stats(); 20 | #define malloc(x) newMalloc(x,__FILE__,__FUNCTION__,__LINE__) 21 | #define free(x) newFree(x,__FILE__,__FUNCTION__,__LINE__) 22 | 23 | #endif 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/Bit.h: -------------------------------------------------------------------------------- 1 | /* Bit.h */ 2 | 3 | typedef struct { 4 | 5 | /* CONFIGURATION */ 6 | 7 | /* Number of bits per pixel */ 8 | int bits; 9 | 10 | /* Line padding (0 or 8) */ 11 | int pad; 12 | 13 | /* Fill order */ 14 | /* 0=msb/msb, 1=msbfill/lsbshift, 2=lsbfill/msbshift, 3=lsb/lsb */ 15 | int fill; 16 | 17 | /* Signed integers (0=unsigned, 1=signed) */ 18 | int sign; 19 | 20 | /* Lookup table (not implemented) */ 21 | unsigned long lutsize; 22 | FLOAT32* lut; 23 | 24 | /* INTERNAL */ 25 | unsigned long mask; 26 | unsigned long signmask; 27 | unsigned long bitbuffer; 28 | int bitcount; 29 | 30 | } BITSTATE; 31 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.PdfImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.PdfImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.PdfImagePlugin Module

10 |

Module Contents

11 |
12 |
_save(im, fp, filename) [#]
13 |
14 |
15 |
16 | 17 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.PalmImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.PalmImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.PalmImagePlugin Module

10 |

Module Contents

11 |
12 |
_save(im, fp, filename, check=0) [#]
13 |
14 |
15 |
16 | 17 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Sane/setup.py: -------------------------------------------------------------------------------- 1 | from distutils.core import setup, Extension 2 | 3 | PIL_BUILD_DIR = '..' 4 | PIL_IMAGING_DIR = PIL_BUILD_DIR+'/libImaging' 5 | 6 | defs = [] 7 | try: 8 | import numarray 9 | defs.append(('WITH_NUMARRAY',None)) 10 | except ImportError: 11 | pass 12 | 13 | sane = Extension('_sane', 14 | include_dirs = [PIL_IMAGING_DIR], 15 | libraries = ['sane'], 16 | library_dirs = [PIL_IMAGING_DIR], 17 | define_macros = defs, 18 | sources = ['_sane.c']) 19 | 20 | setup (name = 'pysane', 21 | version = '2.0', 22 | description = 'This is the pysane package', 23 | py_modules = ['sane'], 24 | ext_modules = [sane]) 25 | -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/FuncPer.m: -------------------------------------------------------------------------------- 1 | %Made by J.T.B. Overvelde on 9 may 2011 2 | 3 | function [s]=FuncPer(c) 4 | 5 | GlobPar 6 | 7 | %figure 8 | tf1=fzero(@(t)CalcPhi(c,t),0.5); 9 | %figure 10 | [C,x0,y0]=ConVal(c,tf1); 11 | 12 | i=1; num=0; 13 | while i=-x0*1.04) 19 | if and(sum(y)/n<=y0*1.04,sum(y)/n>=-y0*1.04) 20 | num=num+1; 21 | x(1)=x(end); 22 | y(1)=y(end); 23 | s(num).x=x; 24 | s(num).y=y; 25 | %hold on 26 | %plot(x,y,'-o') 27 | end 28 | end 29 | i=i+n+1; 30 | end 31 | pause(0.5) -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.BufrStubImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.BufrStubImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.BufrStubImagePlugin Module

10 |
11 |
register_handler(handler) [#]
12 |
13 |
14 |
handler
15 |
16 |
17 |

18 |
19 |
20 | 21 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.FitsStubImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.FitsStubImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.FitsStubImagePlugin Module

10 |
11 |
register_handler(handler) [#]
12 |
13 |
14 |
handler
15 |
16 |
17 |

18 |
19 |
20 | 21 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.GribStubImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.GribStubImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.GribStubImagePlugin Module

10 |
11 |
register_handler(handler) [#]
12 |
13 |
14 |
handler
15 |
16 |
17 |

18 |
19 |
20 | 21 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.Hdf5StubImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.Hdf5StubImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.Hdf5StubImagePlugin Module

10 |
11 |
register_handler(handler) [#]
12 |
13 |
14 |
handler
15 |
16 |
17 |

18 |
19 |
20 | 21 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.ImageColor.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.ImageColor Module 6 | 7 | 8 | 9 |

The PIL.ImageColor Module

10 |
11 |
getrgb(color) [#]
12 |
13 |
14 |
color
15 |
16 |
17 |
Returns:
18 |
19 |
20 |
Raises ValueError:
21 |
22 |

23 |
24 |
25 | 26 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Sane/README: -------------------------------------------------------------------------------- 1 | 2 | Python SANE module V1.1 (30 Sep. 2004) 3 | 4 | The SANE module provides an interface to the SANE scanner and frame 5 | grabber interface for Linux. This module was contributed by Andrew 6 | Kuchling and is extended and currently maintained by Ralph Heinkel 7 | (rheinkel-at-email.de). If you write to me please make sure to have the 8 | word 'SANE' or 'sane' in the subject of your mail, otherwise it might 9 | be classified as spam in the future. 10 | 11 | 12 | To build this module, type (in the Sane directory): 13 | 14 | python setup.py build 15 | 16 | In order to install the module type: 17 | 18 | python setup.py install 19 | 20 | 21 | For some basic documentation please look at the file sanedoc.txt 22 | The two demo_*.py scripts give basic examples on how to use the software. 23 | -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/AbaqusFiles/Pois-Analysis2.py: -------------------------------------------------------------------------------- 1 | #Made by J.T.B. Overvelde on 9 may 2011 2 | 3 | #execute job 4 | mdb.Job(contactPrint=OFF, description='', echoPrint=OFF, explicitPrecision= 5 | SINGLE, historyPrint=OFF, memory=90, memoryUnits=PERCENTAGE, model= 6 | modelName2, modelPrint=OFF, multiprocessingMode=DEFAULT, name=jobName2, 7 | nodalOutputPrecision=SINGLE, numCpus=1, numDomains=1, 8 | parallelizationMethodExplicit=DOMAIN, scratch='', type=ANALYSIS, 9 | userSubroutine='') 10 | os.chdir(tDr) 11 | try: 12 | mdb.jobs[jobName2].submit(consistencyChecking=OFF) 13 | mdb.jobs[jobName2].waitForCompletion() 14 | os.chdir(wDr) 15 | except: pass 16 | 17 | os.chdir(wDr) 18 | execfile('Pois-Eval.py') 19 | if saveFig==1: 20 | execfile('All-Fig.py') 21 | if saveMov==1: 22 | execfile('Pois-Movie.py') 23 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.TiffTags.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.TiffTags Module 6 | 7 | 8 | 9 |

The PIL.TiffTags Module

10 |

Module Contents

11 |
12 |
TAGS (variable) [#]
13 |
14 |
15 |
TYPES (variable) [#]
16 |
17 |
18 |
19 | 20 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.ExifTags.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.ExifTags Module 6 | 7 | 8 | 9 |

The PIL.ExifTags Module

10 |

Module Contents

11 |
12 |
GPSTAGS (variable) [#]
13 |
14 |
15 |
TAGS (variable) [#]
16 |
17 |
18 |
19 | 20 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Sane/demo_pil.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # 4 | # Shows how to scan a color image into a PIL rgb-image 5 | # 6 | 7 | # Get the path set up to find PIL modules if not installed yet: 8 | import sys ; sys.path.append('../PIL') 9 | 10 | import sane 11 | print 'SANE version:', sane.init() 12 | print 'Available devices=', sane.get_devices() 13 | 14 | s = sane.open(sane.get_devices()[0][0]) 15 | 16 | s.mode = 'color' 17 | s.br_x=320. ; s.br_y=240. 18 | 19 | print 'Device parameters:', s.get_parameters() 20 | 21 | # Initiate the scan 22 | s.start() 23 | 24 | # Get an Image object 25 | # (For my B&W QuickCam, this is a grey-scale image. Other scanning devices 26 | # may return a 27 | im=s.snap() 28 | 29 | # Write the image out as a GIF file 30 | #im.save('foo.gif') 31 | 32 | # The show method() simply saves the image to a temporary file and calls "xv". 33 | im.show() 34 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/Negative.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library 3 | * $Id$ 4 | * 5 | * negate image 6 | * 7 | * to do: 8 | * FIXME: Maybe this should be implemented using ImagingPoint() 9 | * 10 | * history: 11 | * 95-11-27 fl: Created 12 | * 13 | * Copyright (c) Fredrik Lundh 1995. 14 | * Copyright (c) Secret Labs AB 1997. 15 | * 16 | * See the README file for information on usage and redistribution. 17 | */ 18 | 19 | 20 | #include "Imaging.h" 21 | 22 | 23 | Imaging 24 | ImagingNegative(Imaging im) 25 | { 26 | Imaging imOut; 27 | int x, y; 28 | 29 | if (!im) 30 | return (Imaging) ImagingError_ModeError(); 31 | 32 | imOut = ImagingNew(im->mode, im->xsize, im->ysize); 33 | if (!imOut) 34 | return NULL; 35 | 36 | for (y = 0; y < im->ysize; y++) 37 | for (x = 0; x < im->linesize; x++) 38 | imOut->image[y][x] = ~im->image[y][x]; 39 | 40 | return imOut; 41 | } 42 | 43 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.PSDraw.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.PSDraw Module 6 | 7 | 8 | 9 |

The PIL.PSDraw Module

10 |
11 |
PSDraw(fp=None) (class) [#]
12 |
13 |

Simple Postscript graphics interface.

14 |

For more information about this class, see The PSDraw Class.

15 |
16 |
17 |

The PSDraw Class

18 |
19 |
PSDraw(fp=None) (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/AbaqusFiles/Pois-Assembly.py: -------------------------------------------------------------------------------- 1 | #Made by J.T.B. Overvelde on 9 may 2011 2 | 3 | mdb.models[modelName1].rootAssembly.DatumCsysByDefault(CARTESIAN) 4 | mdb.models[modelName1].rootAssembly.Instance(dependent=ON, name=instName1, 5 | part=mdb.models[modelName1].parts[partName1]) 6 | 7 | mdb.models[modelName1].rootAssembly.Instance(dependent=ON, name= 8 | instRefName1, part=mdb.models[modelName1].parts[refName1]) 9 | mdb.models[modelName1].rootAssembly.Instance(dependent=ON, name= 10 | instRefName2, part=mdb.models[modelName1].parts[refName2]) 11 | 12 | mdb.models[modelName1].parts[refName1].Set(name='VIRTUAL1', 13 | referencePoints=( 14 | mdb.models[modelName1].parts[refName1].referencePoints[1], )) 15 | mdb.models[modelName1].parts[refName2].Set(name='VIRTUAL2', 16 | referencePoints=( 17 | mdb.models[modelName1].parts[refName2].referencePoints[1], )) 18 | mdb.models[modelName1].rootAssembly.regenerate() 19 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/Quant.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library 3 | * $Id$ 4 | * 5 | * image quantizer 6 | * 7 | * Written by Toby J Sargeant . 8 | * 9 | * See the README file for information on usage and redistribution. 10 | */ 11 | 12 | #ifndef __QUANT_H__ 13 | #define __QUANT_H__ 14 | 15 | typedef union { 16 | struct { 17 | unsigned char r,g,b,a; 18 | } c; 19 | struct { 20 | unsigned char v[4]; 21 | } a; 22 | unsigned long v; 23 | } Pixel; 24 | 25 | int quantize(Pixel *, 26 | unsigned long, 27 | unsigned long, 28 | Pixel **, 29 | unsigned long *, 30 | unsigned long **, 31 | int); 32 | 33 | int quantize2(Pixel *, 34 | unsigned long, 35 | unsigned long, 36 | Pixel **, 37 | unsigned long *, 38 | unsigned long **, 39 | int); 40 | #endif 41 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.FontFile.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.FontFile Module 6 | 7 | 8 | 9 |

The PIL.FontFile Module

10 |
11 |
FontFile() (class) [#]
12 |
13 |

Base class for raster font file handlers.

14 |

For more information about this class, see The FontFile Class.

15 |
16 |
17 |

The FontFile Class

18 |
19 |
FontFile() (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.WalImageFile.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.WalImageFile Module 6 | 7 | 8 | 9 |

The PIL.WalImageFile Module

10 |
11 |
open(filename) [#]
12 |
13 |

Load texture from a Quake2 WAL texture file. 14 |

15 | By default, a Quake2 standard palette is attached to the texture. 16 | To override the palette, use the putpalette method. 17 | 18 |

19 |
filename
20 |
21 |
22 |
Returns:
23 |
24 |
25 |

26 |
27 |
28 | 29 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/PIL/ImageSequence.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library. 3 | # $Id$ 4 | # 5 | # sequence support classes 6 | # 7 | # history: 8 | # 1997-02-20 fl Created 9 | # 10 | # Copyright (c) 1997 by Secret Labs AB. 11 | # Copyright (c) 1997 by Fredrik Lundh. 12 | # 13 | # See the README file for information on usage and redistribution. 14 | # 15 | 16 | ## 17 | # This class implements an iterator object that can be used to loop 18 | # over an image sequence. 19 | 20 | class Iterator: 21 | 22 | ## 23 | # Create an iterator. 24 | # 25 | # @param im An image object. 26 | 27 | def __init__(self, im): 28 | if not hasattr(im, "seek"): 29 | raise AttributeError("im must have seek method") 30 | self.im = im 31 | 32 | def __getitem__(self, ix): 33 | try: 34 | if ix: 35 | self.im.seek(ix) 36 | return self.im 37 | except EOFError: 38 | raise IndexError # end of sequence 39 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/QuantTypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library 3 | * $Id$ 4 | * 5 | * image quantizer 6 | * 7 | * Written by Toby J Sargeant . 8 | * 9 | * See the README file for information on usage and redistribution. 10 | */ 11 | 12 | #ifndef __TYPES_H__ 13 | #define __TYPES_H__ 14 | 15 | typedef void *HashTable; 16 | typedef void *Heap; 17 | 18 | typedef unsigned long (*HashFunc)(const HashTable,const void *); 19 | typedef int (*HashCmpFunc)(const HashTable,const void *,const void *); 20 | typedef void (*IteratorFunc)(const HashTable,const void *,const void *,void *); 21 | typedef void (*IteratorUpdateFunc)(const HashTable,const void *,void **,void *); 22 | typedef void (*DestroyFunc)(const HashTable,void *); 23 | typedef void (*ComputeFunc)(const HashTable,const void *,void **); 24 | typedef void (*CollisionFunc)(const HashTable,void **,void **,void *,void *); 25 | 26 | typedef int (*HeapCmpFunc)(const Heap,const void *,const void *); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.ImageGL.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.ImageGL Module 6 | 7 | 8 | 9 |

The PIL.ImageGL Module

10 |

Module Contents

11 |
12 |
TextureFactory (class) [#]
13 |
14 |

Texture factory.

15 |

For more information about this class, see The TextureFactory Class.

16 |
17 |
18 |

The TextureFactory Class

19 |
20 |
TextureFactory (class) [#]
21 |
22 |
23 |
24 | 25 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.BdfFontFile.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.BdfFontFile Module 6 | 7 | 8 | 9 |

The PIL.BdfFontFile Module

10 |
11 |
BdfFontFile(fp) (class) [#]
12 |
13 |

Font file plugin for the X11 BDF format.

14 |

For more information about this class, see The BdfFontFile Class.

15 |
16 |
17 |

The BdfFontFile Class

18 |
19 |
BdfFontFile(fp) (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.PcfFontFile.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.PcfFontFile Module 6 | 7 | 8 | 9 |

The PIL.PcfFontFile Module

10 |
11 |
PcfFontFile(fp) (class) [#]
12 |
13 |

Font file plugin for the X11 PCF format.

14 |

For more information about this class, see The PcfFontFile Class.

15 |
16 |
17 |

The PcfFontFile Class

18 |
19 |
PcfFontFile(fp) (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.PaletteFile.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.PaletteFile Module 6 | 7 | 8 | 9 |

The PIL.PaletteFile Module

10 |
11 |
PaletteFile(fp) (class) [#]
12 |
13 |

File handler for Teragon-style palette files.

14 |

For more information about this class, see The PaletteFile Class.

15 |
16 |
17 |

The PaletteFile Class

18 |
19 |
PaletteFile(fp) (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/ReadMe.txt: -------------------------------------------------------------------------------- 1 | I used these files for my work on buckling on periodic structures. 2 | You can probably use it to get an idea of the possibilities of coupling Matlab with Abaqus. 3 | Therefore, the files are not meant to explain in any way the calculation of buckling of periodic structures. 4 | 5 | The order of the programme is as follows: 6 | 7 | First the Matlab file with MainBrutePois.m is called. This will call for the other Matlab files. 8 | The matlab files will create the variables used in Abaqus. These variables are written to a text file in MakeVar.m. 9 | Next Modelcalc.m will call Abaqus and runs the Python script files. 10 | The Python script files will first read the variables from the text file and create the model according to these variables. 11 | After the simulation is done, Abaqus writes the interesting data to an output files (I create the output file myself, it is not a standard Abaqus output file). 12 | Then Abaqus quites and Matlab will continue by reading the output text file from Abaqus. 13 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.ImImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.ImImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.ImImagePlugin Module

10 |
11 |
ImImageFile (class) [#]
12 |
13 |

Image plugin for the IFUNC IM file format.

14 |

For more information about this class, see The ImImageFile Class.

15 |
16 |
17 |

The ImImageFile Class

18 |
19 |
ImImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.GifImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.GifImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.GifImagePlugin Module

10 |
11 |
GifImageFile (class) [#]
12 |
13 |

Image plugin for GIF images.

14 |

For more information about this class, see The GifImageFile Class.

15 |
16 |
17 |

The GifImageFile Class

18 |
19 |
GifImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.PngImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.PngImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.PngImagePlugin Module

10 |
11 |
PngImageFile (class) [#]
12 |
13 |

Image plugin for PNG images.

14 |

For more information about this class, see The PngImageFile Class.

15 |
16 |
17 |

The PngImageFile Class

18 |
19 |
PngImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.SgiImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.SgiImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.SgiImagePlugin Module

10 |
11 |
SgiImageFile (class) [#]
12 |
13 |

Image plugin for SGI images.

14 |

For more information about this class, see The SgiImageFile Class.

15 |
16 |
17 |

The SgiImageFile Class

18 |
19 |
SgiImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.TgaImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.TgaImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.TgaImagePlugin Module

10 |
11 |
TgaImageFile (class) [#]
12 |
13 |

Image plugin for Targa files.

14 |

For more information about this class, see The TgaImageFile Class.

15 |
16 |
17 |

The TgaImageFile Class

18 |
19 |
TgaImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.XbmImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.XbmImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.XbmImagePlugin Module

10 |
11 |
XbmImageFile (class) [#]
12 |
13 |

Image plugin for X11 bitmaps.

14 |

For more information about this class, see The XbmImageFile Class.

15 |
16 |
17 |

The XbmImageFile Class

18 |
19 |
XbmImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.IcoImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.IcoImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.IcoImagePlugin Module

10 |
11 |
IcoImageFile (class) [#]
12 |
13 |

Image plugin for Windows Icon files.

14 |

For more information about this class, see The IcoImageFile Class.

15 |
16 |
17 |

The IcoImageFile Class

18 |
19 |
IcoImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.ImtImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.ImtImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.ImtImagePlugin Module

10 |
11 |
ImtImageFile (class) [#]
12 |
13 |

Image plugin for IM Tools images.

14 |

For more information about this class, see The ImtImageFile Class.

15 |
16 |
17 |

The ImtImageFile Class

18 |
19 |
ImtImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.MspImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.MspImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.MspImagePlugin Module

10 |
11 |
MspImageFile (class) [#]
12 |
13 |

Image plugin for Windows MSP images.

14 |

For more information about this class, see The MspImageFile Class.

15 |
16 |
17 |

The MspImageFile Class

18 |
19 |
MspImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.PcdImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.PcdImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.PcdImagePlugin Module

10 |
11 |
PcdImageFile (class) [#]
12 |
13 |

Image plugin for PhotoCD images.

14 |

For more information about this class, see The PcdImageFile Class.

15 |
16 |
17 |

The PcdImageFile Class

18 |
19 |
PcdImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.PcxImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.PcxImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.PcxImagePlugin Module

10 |
11 |
PcxImageFile (class) [#]
12 |
13 |

Image plugin for Paintbrush images.

14 |

For more information about this class, see The PcxImageFile Class.

15 |
16 |
17 |

The PcxImageFile Class

18 |
19 |
PcxImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.PsdImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.PsdImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.PsdImagePlugin Module

10 |
11 |
PsdImageFile (class) [#]
12 |
13 |

Image plugin for Photoshop images.

14 |

For more information about this class, see The PsdImageFile Class.

15 |
16 |
17 |

The PsdImageFile Class

18 |
19 |
PsdImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.SunImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.SunImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.SunImagePlugin Module

10 |
11 |
SunImageFile (class) [#]
12 |
13 |

Image plugin for Sun raster files.

14 |

For more information about this class, see The SunImageFile Class.

15 |
16 |
17 |

The SunImageFile Class

18 |
19 |
SunImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.XpmImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.XpmImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.XpmImagePlugin Module

10 |
11 |
XpmImageFile (class) [#]
12 |
13 |

Image plugin for X11 pixel maps.

14 |

For more information about this class, see The XpmImageFile Class.

15 |
16 |
17 |

The XpmImageFile Class

18 |
19 |
XpmImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.BmpImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.BmpImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.BmpImagePlugin Module

10 |
11 |
BmpImageFile (class) [#]
12 |
13 |

Image plugin for the Windows BMP format.

14 |

For more information about this class, see The BmpImageFile Class.

15 |
16 |
17 |

The BmpImageFile Class

18 |
19 |
BmpImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.CurImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.CurImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.CurImagePlugin Module

10 |
11 |
CurImageFile (class) [#]
12 |
13 |

Image plugin for Windows Cursor files.

14 |

For more information about this class, see The CurImageFile Class.

15 |
16 |
17 |

The CurImageFile Class

18 |
19 |
CurImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.DcxImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.DcxImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.DcxImagePlugin Module

10 |
11 |
DcxImageFile (class) [#]
12 |
13 |

Image plugin for the Intel DCX format.

14 |

For more information about this class, see The DcxImageFile Class.

15 |
16 |
17 |

The DcxImageFile Class

18 |
19 |
DcxImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.EpsImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.EpsImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.EpsImagePlugin Module

10 |
11 |
EpsImageFile (class) [#]
12 |
13 |

Image plugin for Encapsulated Postscript.

14 |

For more information about this class, see The EpsImageFile Class.

15 |
16 |
17 |

The EpsImageFile Class

18 |
19 |
EpsImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.FpxImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.FpxImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.FpxImagePlugin Module

10 |
11 |
FpxImageFile (class) [#]
12 |
13 |

Image plugin for the FlashPix images.

14 |

For more information about this class, see The FpxImageFile Class.

15 |
16 |
17 |

The FpxImageFile Class

18 |
19 |
FpxImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.GbrImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.GbrImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.GbrImagePlugin Module

10 |
11 |
GbrImageFile (class) [#]
12 |
13 |

Image plugin for the GIMP brush format.

14 |

For more information about this class, see The GbrImageFile Class.

15 |
16 |
17 |

The GbrImageFile Class

18 |
19 |
GbrImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.PpmImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.PpmImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.PpmImagePlugin Module

10 |
11 |
PpmImageFile (class) [#]
12 |
13 |

Image plugin for PBM, PGM, and PPM images.

14 |

For more information about this class, see The PpmImageFile Class.

15 |
16 |
17 |

The PpmImageFile Class

18 |
19 |
PpmImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.IcnsImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.IcnsImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.IcnsImagePlugin Module

10 |
11 |
IcnsImageFile (class) [#]
12 |
13 |

Image plugin for Mac OS icons.

14 |

For more information about this class, see The IcnsImageFile Class.

15 |
16 |
17 |

The IcnsImageFile Class

18 |
19 |
IcnsImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.MpegImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.MpegImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.MpegImagePlugin Module

10 |
11 |
MpegImageFile (class) [#]
12 |
13 |

Image plugin for MPEG streams.

14 |

For more information about this class, see The MpegImageFile Class.

15 |
16 |
17 |

The MpegImageFile Class

18 |
19 |
MpegImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.JpegImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.JpegImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.JpegImagePlugin Module

10 |
11 |
JpegImageFile (class) [#]
12 |
13 |

Image plugin for JPEG and JFIF images.

14 |

For more information about this class, see The JpegImageFile Class.

15 |
16 |
17 |

The JpegImageFile Class

18 |
19 |
JpegImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.MicImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.MicImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.MicImagePlugin Module

10 |
11 |
MicImageFile (class) [#]
12 |
13 |

Image plugin for Microsoft's Image Composer file format.

14 |

For more information about this class, see The MicImageFile Class.

15 |
16 |
17 |

The MicImageFile Class

18 |
19 |
MicImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Scripts/viewer.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library 3 | # $Id$ 4 | # 5 | 6 | from Tkinter import * 7 | from PIL import Image, ImageTk 8 | 9 | # 10 | # an image viewer 11 | 12 | class UI(Label): 13 | 14 | def __init__(self, master, im): 15 | 16 | if im.mode == "1": 17 | # bitmap image 18 | self.image = ImageTk.BitmapImage(im, foreground="white") 19 | Label.__init__(self, master, image=self.image, bg="black", bd=0) 20 | 21 | else: 22 | # photo image 23 | self.image = ImageTk.PhotoImage(im) 24 | Label.__init__(self, master, image=self.image, bd=0) 25 | 26 | # 27 | # script interface 28 | 29 | if __name__ == "__main__": 30 | 31 | import sys 32 | 33 | if not sys.argv[1:]: 34 | print "Syntax: python viewer.py imagefile" 35 | sys.exit(1) 36 | 37 | filename = sys.argv[1] 38 | 39 | root = Tk() 40 | root.title(filename) 41 | 42 | im = Image.open(filename) 43 | 44 | UI(root, im).pack() 45 | 46 | root.mainloop() 47 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.ArgImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.ArgImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.ArgImagePlugin Module

10 |
11 |
ArgImageFile (class) [#]
12 |
13 |

Image plugin for the experimental Animated Raster Graphics format.

14 |

For more information about this class, see The ArgImageFile Class.

15 |
16 |
17 |

The ArgImageFile Class

18 |
19 |
ArgImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.PixarImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.PixarImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.PixarImagePlugin Module

10 |
11 |
PixarImageFile (class) [#]
12 |
13 |

Image plugin for PIXAR raster images.

14 |

For more information about this class, see The PixarImageFile Class.

15 |
16 |
17 |

The PixarImageFile Class

18 |
19 |
PixarImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.GimpPaletteFile.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.GimpPaletteFile Module 6 | 7 | 8 | 9 |

The PIL.GimpPaletteFile Module

10 |
11 |
GimpPaletteFile(fp) (class) [#]
12 |
13 |

File handler for GIMP's palette format.

14 |

For more information about this class, see The GimpPaletteFile Class.

15 |
16 |
17 |

The GimpPaletteFile Class

18 |
19 |
GimpPaletteFile(fp) (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.McIdasImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.McIdasImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.McIdasImagePlugin Module

10 |
11 |
McIdasImageFile (class) [#]
12 |
13 |

Image plugin for McIdas area images.

14 |

For more information about this class, see The McIdasImageFile Class.

15 |
16 |
17 |

The McIdasImageFile Class

18 |
19 |
McIdasImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/Lzw.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library. 3 | * $Id$ 4 | * 5 | * declarations for the TIFF LZW decoder. 6 | * 7 | * Copyright (c) Fredrik Lundh 1995-96. 8 | */ 9 | 10 | 11 | /* Max size for LZW code words */ 12 | 13 | #define LZWBITS 12 14 | 15 | #define LZWTABLE (1< 2 | 3 | 4 | 5 | The PIL.GimpGradientFile Module 6 | 7 | 8 | 9 |

The PIL.GimpGradientFile Module

10 |
11 |
GimpGradientFile(fp) (class) [#]
12 |
13 |

File handler for GIMP's gradient format.

14 |

For more information about this class, see The GimpGradientFile Class.

15 |
16 |
17 |

The GimpGradientFile Class

18 |
19 |
GimpGradientFile(fp) (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.ImagePalette.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.ImagePalette Module 6 | 7 | 8 | 9 |

The PIL.ImagePalette Module

10 |
11 |
ImagePalette(mode="RGB", palette=None) (class) [#]
12 |
13 |

Colour palette wrapper for palette mapped images.

14 |

For more information about this class, see The ImagePalette Class.

15 |
16 |
17 |

The ImagePalette Class

18 |
19 |
ImagePalette(mode="RGB", palette=None) (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.XVThumbImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.XVThumbImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.XVThumbImagePlugin Module

10 |
11 |
XVThumbImageFile (class) [#]
12 |
13 |

Image plugin for XV thumbnail images.

14 |

For more information about this class, see The XVThumbImageFile Class.

15 |
16 |
17 |

The XVThumbImageFile Class

18 |
19 |
XVThumbImageFile (class) [#]
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /Kernel Scripts/abq2img_v0.1/README: -------------------------------------------------------------------------------- 1 | ==================================================================== 2 | abq2img version 0.1 3 | 4 | Distributed AS IS. 5 | Comes with no warranty. 6 | 7 | ==================================================================== 8 | abq2img is a small utility written in Python that reads an ABAQUS file and 9 | creates an image of the model. Run abq2img --help for details. 10 | 11 | The Python Imaging Library (PIL) is used to create the images. abq2img has been 12 | tested with PIL 1.1.6. You can get PIL at: 13 | http://www.pythonware.com/products/pil/ 14 | 15 | Images are created in PNG and EPS formats. Other formats supported by PIL can 16 | also be implemented. 17 | 18 | ==================================================================== 19 | ABAQUS entities supported (v 0.1): 20 | Shells: 21 | S4, S4R, S4RS, S3, S3R, S3RS, M3D4, M3D4R, M3D3, S8R, S8R5, M3D8, 22 | M3D8R, M3D6, SFM3D4, SFM3D4R, SFM3D3 23 | Bars: 24 | B31, CONN3D2 25 | Solids: To be added. 26 | 27 | ==================================================================== 28 | Writen by: 29 | Michalis Giannakidis, mgiannakidis@gmail.com, 2007 June 17 30 | -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/MainBrutePois.m: -------------------------------------------------------------------------------- 1 | %Made by J.T.B. Overvelde on 9 may 2011 2 | 3 | clear, close all, clc; 4 | 5 | GlobPar 6 | 7 | FileNameSave 8 | 9 | %c1a=-0.2:0.005:0.4; 10 | %c2a=-0.25:0.005:0.4; 11 | c1a=0.08; 12 | c2a=-0.1; 13 | n=length(c1a)*length(c2a); rep=0; timeCalc=0; 14 | PoissonFinal=-2*ones(length(c1a),length(c2a)); 15 | 16 | rep=0;i=0; 17 | for c1=c1a 18 | i=i+1; 19 | j=0; 20 | for c2=c2a 21 | rep=rep+1; 22 | tic 23 | j=j+1; 24 | c=[c1 c2]; 25 | GlobVar(c,3); 26 | 27 | answ=InEqConstraint2(c); 28 | if max(answ)<0 29 | PoissonFinal(i,j)=ModelCalc(c,3); 30 | end 31 | 32 | %save mat file 33 | cd(MatSaveDir); 34 | save(saveFile); 35 | cd(MatDir) 36 | timeNow=toc; 37 | timeCalc=timeCalc+timeNow; 38 | disp(['Time remaining (on all previous)= ',num2str((n*timeCalc/rep-timeCalc)/60),' min']) 39 | disp(['Time remaining (on last)=',num2str((n-rep)*timeNow/60),' min']) 40 | end 41 | end 42 | 43 | %save mat file 44 | cd(MatSaveDir); 45 | save(saveFile); 46 | cd(MatDir); -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.FliImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.FliImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.FliImagePlugin Module

10 |
11 |
FliImageFile (class) [#]
12 |
13 |

Image plugin for the FLI/FLC animation format.

14 |

For more information about this class, see The FliImageFile Class.

15 |
16 |
17 |

The FliImageFile Class

18 |
19 |
FliImageFile (class) [#]
20 |
21 |

Image plugin for the FLI/FLC animation format. Use the seek 22 | method to load individual frames. 23 |

24 |
25 | 26 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/PIL/ImageFileIO.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library. 3 | # $Id$ 4 | # 5 | # kludge to get basic ImageFileIO functionality 6 | # 7 | # History: 8 | # 1998-08-06 fl Recreated 9 | # 10 | # Copyright (c) Secret Labs AB 1998-2002. 11 | # 12 | # See the README file for information on usage and redistribution. 13 | # 14 | 15 | from StringIO import StringIO 16 | 17 | ## 18 | # The ImageFileIO module can be used to read an image from a 19 | # socket, or any other stream device. 20 | #

21 | # This module is deprecated. New code should use the Parser 22 | # class in the ImageFile module instead. 23 | # 24 | # @see ImageFile#Parser 25 | 26 | class ImageFileIO(StringIO): 27 | 28 | ## 29 | # Adds buffering to a stream file object, in order to 30 | # provide seek and tell methods required 31 | # by the Image.open method. The stream object must 32 | # implement read and close methods. 33 | # 34 | # @param fp Stream file handle. 35 | # @see Image#open 36 | 37 | def __init__(self, fp): 38 | data = fp.read() 39 | StringIO.__init__(self, data) 40 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Sane/demo_numarray.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # 4 | # Shows how to scan a 16 bit grayscale image into a numarray object 5 | # 6 | 7 | # Get the path set up to find PIL modules if not installed yet: 8 | import sys ; sys.path.append('../PIL') 9 | 10 | from numarray import * 11 | import sane 12 | import Image 13 | 14 | def toImage(arr): 15 | if arr.type().bytes == 1: 16 | # need to swap coordinates btw array and image (with [::-1]) 17 | im = Image.fromstring('L', arr.shape[::-1], arr.tostring()) 18 | else: 19 | arr_c = arr - arr.min() 20 | arr_c *= (255./arr_c.max()) 21 | arr = arr_c.astype(UInt8) 22 | # need to swap coordinates btw array and image (with [::-1]) 23 | im = Image.fromstring('L', arr.shape[::-1], arr.tostring()) 24 | return im 25 | 26 | print 'SANE version:', sane.init() 27 | print 'Available devices=', sane.get_devices() 28 | 29 | s = sane.open(sane.get_devices()[0][0]) 30 | 31 | # Set scan parameters 32 | s.mode = 'gray' 33 | s.br_x=320. ; s.br_y=240. 34 | 35 | print 'Device parameters:', s.get_parameters() 36 | 37 | s.depth=16 38 | arr16 = s.arr_scan() 39 | toImage(arr16).show() 40 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Scripts/pilfont.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library 3 | # $Id$ 4 | # 5 | # PIL raster font compiler 6 | # 7 | # history: 8 | # 1997-08-25 fl created 9 | # 2002-03-10 fl use "from PIL import" 10 | # 11 | 12 | VERSION = "0.4" 13 | 14 | import site 15 | import glob, os, sys 16 | 17 | # drivers 18 | from PIL import BdfFontFile 19 | from PIL import PcfFontFile 20 | 21 | if len(sys.argv) <= 1: 22 | print "PILFONT", VERSION, "-- PIL font compiler." 23 | print 24 | print "Usage: pilfont fontfiles..." 25 | print 26 | print "Convert given font files to the PIL raster font format." 27 | print "This version of pilfont supports X BDF and PCF fonts." 28 | sys.exit(1) 29 | 30 | files = [] 31 | for f in sys.argv[1:]: 32 | files = files + glob.glob(f) 33 | 34 | for f in files: 35 | 36 | print f + "...", 37 | 38 | try: 39 | 40 | fp = open(f, "rb") 41 | 42 | try: 43 | p = PcfFontFile.PcfFontFile(fp) 44 | except SyntaxError: 45 | fp.seek(0) 46 | p = BdfFontFile.BdfFontFile(fp) 47 | 48 | p.save(f) 49 | 50 | except (SyntaxError, IOError): 51 | print "failed" 52 | 53 | else: 54 | print "OK" 55 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.ImageGrab.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.ImageGrab Module 6 | 7 | 8 | 9 |

The PIL.ImageGrab Module

10 |

(New in 1.1.3) The ImageGrab module can be used to copy 11 | the contents of the screen to a PIL image memory. 12 |

13 | The current version works on Windows only.

14 | 15 |

Module Contents

16 |
17 |
grab(bbox=None) [#]
18 |
19 |
20 |
bbox
21 |
22 |
23 |
Returns:
24 |
25 |
26 |

27 |
28 |
grabclipboard() [#]
29 |
30 |
31 |
Returns:
32 |
33 |
34 |

35 |
36 |
37 | 38 | -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/ModelCalc.m: -------------------------------------------------------------------------------- 1 | %Made by J.T.B. Overvelde on 9 may 2011 2 | 3 | function Values=ModelCalc(c,routine) 4 | 5 | GlobPar 6 | 7 | [e22ct,stepSize]=GlobVar(c,routine); 8 | 9 | s=FuncPer(c); 10 | MakeVar(s,routine,c,e22ct,stepSize); 11 | 12 | %run mode analysis (run Abaqus) 13 | disp(['c = (',num2str(c(1)),',',num2str(c(2)),')']) 14 | cd(AbDir) 15 | unix(['abaqus cae ',mo,'=All-Main.py']); 16 | 17 | %make Matlab Output Files 18 | if exist('Output-PoisAll.txt') 19 | fid1 = fopen('Output-PoisAll.txt','r'); 20 | A=fscanf(fid1,'%f ',[6 inf]); 21 | fclose(fid1); 22 | 23 | Poisson=A(1,end); 24 | e22=A(2,end); 25 | kInit=A(5,1)/A(6,1); 26 | 27 | cd(MatSaveDir); 28 | fid=fopen([saveFile,'All'],'a+'); 29 | sss=[]; 30 | for i=1:length(c)+6 31 | sss=[sss,'%f ']; 32 | end 33 | for i=1:length(A(1,:)) 34 | fprintf(fid,sss,[c,A(:,i)']); 35 | fprintf(fid,'\n'); 36 | end 37 | fclose(fid); 38 | Values=Poisson; 39 | else 40 | cd(MatSaveDir); 41 | fid=fopen([saveFile,'Err'],'a+'); 42 | sss=[]; 43 | for i=1:length(c) 44 | sss=[sss,'%f ']; 45 | end 46 | fprintf(fid,sss,[c]); 47 | fprintf('\n') 48 | fclose(fid); 49 | Values=-2; 50 | end 51 | 52 | cd(MatDir); -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.TarIO.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.TarIO Module 6 | 7 | 8 | 9 |

The PIL.TarIO Module

10 |
11 |
TarIO(tarfile, file) (class) [#]
12 |
13 |

A file object that provides read access to a given member of a TAR 14 | file.

15 |

For more information about this class, see The TarIO Class.

16 |
17 |
18 |

The TarIO Class

19 |
20 |
TarIO(tarfile, file) (class) [#]
21 |
22 |
23 |
__init__(tarfile, file) [#]
24 |
25 |
26 |
tarfile
27 |
28 |
29 |
file
30 |
31 |
32 |

33 |
34 |
35 | 36 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.SpiderImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.SpiderImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.SpiderImagePlugin Module

10 |

Image plugin for the Spider image format. This format is is used 11 | by the SPIDER software, in processing image data from electron 12 | microscopy and tomography.

13 |

Module Contents

14 |
15 |
SpiderImageFile (class) [#]
16 |
17 |

Image plugin for the SPIDER format.

18 |

For more information about this class, see The SpiderImageFile Class.

19 |
20 |
21 |

The SpiderImageFile Class

22 |
23 |
SpiderImageFile (class) [#]
24 |
25 |

Image plugin for the SPIDER format.

26 |
27 |
28 | 29 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.ImageSequence.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.ImageSequence Module 6 | 7 | 8 | 9 |

The PIL.ImageSequence Module

10 |
11 |
Iterator(im) (class) [#]
12 |
13 |

This class implements an iterator object that can be used to loop 14 | over an image sequence.

15 |

For more information about this class, see The Iterator Class.

16 |
17 |
18 |

The Iterator Class

19 |
20 |
Iterator(im) (class) [#]
21 |
22 |
23 |
__init__(im) [#]
24 |
25 |
26 |
im
27 |
28 |
29 |

30 |
31 |
32 | 33 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/PIL/PaletteFile.py: -------------------------------------------------------------------------------- 1 | # 2 | # Python Imaging Library 3 | # $Id$ 4 | # 5 | # stuff to read simple, teragon-style palette files 6 | # 7 | # History: 8 | # 97-08-23 fl Created 9 | # 10 | # Copyright (c) Secret Labs AB 1997. 11 | # Copyright (c) Fredrik Lundh 1997. 12 | # 13 | # See the README file for information on usage and redistribution. 14 | # 15 | 16 | import string 17 | 18 | ## 19 | # File handler for Teragon-style palette files. 20 | 21 | class PaletteFile: 22 | 23 | rawmode = "RGB" 24 | 25 | def __init__(self, fp): 26 | 27 | self.palette = map(lambda i: (i, i, i), range(256)) 28 | 29 | while 1: 30 | 31 | s = fp.readline() 32 | 33 | if not s: 34 | break 35 | if s[0] == "#": 36 | continue 37 | if len(s) > 100: 38 | raise SyntaxError, "bad palette file" 39 | 40 | v = map(int, string.split(s)) 41 | try: 42 | [i, r, g, b] = v 43 | except ValueError: 44 | [i, r] = v 45 | g = b = r 46 | 47 | if 0 <= i <= 255: 48 | self.palette[i] = chr(r) + chr(g) + chr(b) 49 | 50 | self.palette = string.join(self.palette, "") 51 | 52 | 53 | def getpalette(self): 54 | 55 | return self.palette, self.rawmode 56 | -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/AbaqusFiles/Pois-Movie.py: -------------------------------------------------------------------------------- 1 | #Made by J.T.B. Overvelde on 9 may 2011 2 | 3 | os.chdir(tDr) 4 | 5 | # Create a new vieport for this example. 6 | myViewport=session.Viewport(name='MakeMov', 7 | origin=(0,0), width=300, height=200) 8 | session.viewports['MakeMov'].makeCurrent() 9 | session.viewports['MakeMov'].maximize() 10 | session.viewports['MakeMov'].view.fitView() 11 | 12 | # Open the output database and associate with the new viewport odbPath = jobName2+'.odb' 13 | myOdb = visualization.openOdb(path=odbPath) 14 | myViewport.setValues(displayedObject=myOdb) 15 | myViewport.odbDisplay.superimposeOptions.setValues( 16 | visibleEdges=NONE, translucencyFactor=0.15) 17 | myViewport.odbDisplay.basicOptions.setValues( 18 | translucencySort=ON) 19 | myViewport.odbDisplay.commonOptions.setValues( 20 | visibleEdges=NONE) 21 | myViewport.odbDisplay.display.setValues(plotState=( 22 | UNDEFORMED, CONTOURS_ON_DEF, )) 23 | 24 | #print 25 | session.animationController.setValues(animationType=TIME_HISTORY, viewports=( 26 | 'MakeMov', )) 27 | session.imageAnimationOptions.setValues(vpDecorations=ON, vpBackground=OFF, 28 | compass=OFF, timeScale=1, frameRate=12) 29 | session.writeImageAnimation(fileName='Movie-Full', format=AVI, canvasObjects=( 30 | session.viewports['MakeMov'], )) 31 | 32 | os.chdir(wDr) 33 | myOdb.close() 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.WmfImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.WmfImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.WmfImagePlugin Module

10 |
11 |
register_handler(handler) [#]
12 |
13 |
14 |
handler
15 |
16 |
17 |

18 |
19 |
WmfStubImageFile (class) [#]
20 |
21 |

Image plugin for Windows metafiles.

22 |

For more information about this class, see The WmfStubImageFile Class.

23 |
24 |
25 |

The WmfStubImageFile Class

26 |
27 |
WmfStubImageFile (class) [#]
28 |
29 |
30 |
31 | 32 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/Copy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library 3 | * $Id$ 4 | * 5 | * copy image 6 | * 7 | * history: 8 | * 95-11-26 fl Moved from Imaging.c 9 | * 97-05-12 fl Added ImagingCopy2 10 | * 97-08-28 fl Allow imOut == NULL in ImagingCopy2 11 | * 12 | * Copyright (c) Fredrik Lundh 1995-97. 13 | * Copyright (c) Secret Labs AB 1997. 14 | * 15 | * See the README file for details on usage and redistribution. 16 | */ 17 | 18 | 19 | #include "Imaging.h" 20 | 21 | 22 | static Imaging 23 | _copy(Imaging imOut, Imaging imIn) 24 | { 25 | ImagingSectionCookie cookie; 26 | int y; 27 | 28 | if (!imIn) 29 | return (Imaging) ImagingError_ValueError(NULL); 30 | 31 | imOut = ImagingNew2(imIn->mode, imOut, imIn); 32 | if (!imOut) 33 | return NULL; 34 | 35 | ImagingCopyInfo(imOut, imIn); 36 | 37 | ImagingSectionEnter(&cookie); 38 | if (imIn->block != NULL && imOut->block != NULL) 39 | memcpy(imOut->block, imIn->block, imIn->ysize * imIn->linesize); 40 | else 41 | for (y = 0; y < imIn->ysize; y++) 42 | memcpy(imOut->image[y], imIn->image[y], imIn->linesize); 43 | ImagingSectionLeave(&cookie); 44 | 45 | return imOut; 46 | } 47 | 48 | Imaging 49 | ImagingCopy(Imaging imIn) 50 | { 51 | return _copy(NULL, imIn); 52 | } 53 | 54 | Imaging 55 | ImagingCopy2(Imaging imOut, Imaging imIn) 56 | { 57 | return _copy(imOut, imIn); 58 | } 59 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/HexDecode.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library. 3 | * $Id$ 4 | * 5 | * decoder for hex encoded image data 6 | * 7 | * history: 8 | * 96-05-16 fl Created 9 | * 10 | * Copyright (c) Fredrik Lundh 1996. 11 | * Copyright (c) Secret Labs AB 1997. 12 | * 13 | * See the README file for information on usage and redistribution. 14 | */ 15 | 16 | 17 | #include "Imaging.h" 18 | 19 | #define HEX(v) ((v >= '0' && v <= '9') ? v - '0' :\ 20 | (v >= 'a' && v <= 'f') ? v - 'a' + 10 :\ 21 | (v >= 'A' && v <= 'F') ? v - 'A' + 10 : -1) 22 | 23 | int 24 | ImagingHexDecode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes) 25 | { 26 | UINT8* ptr; 27 | int a, b; 28 | 29 | ptr = buf; 30 | 31 | for (;;) { 32 | 33 | if (bytes < 2) 34 | return ptr - buf; 35 | 36 | a = HEX(ptr[0]); 37 | b = HEX(ptr[1]); 38 | 39 | if (a < 0 || b < 0) { 40 | 41 | ptr++; 42 | bytes--; 43 | 44 | } else { 45 | 46 | ptr += 2; 47 | bytes -= 2; 48 | 49 | state->buffer[state->x] = (a<<4) + b; 50 | 51 | if (++state->x >= state->bytes) { 52 | 53 | /* Got a full line, unpack it */ 54 | state->shuffle((UINT8*) im->image[state->y], state->buffer, 55 | state->xsize); 56 | 57 | state->x = 0; 58 | 59 | if (++state->y >= state->ysize) { 60 | /* End of file (errcode = 0) */ 61 | return -1; 62 | } 63 | } 64 | 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.ImageStat.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.ImageStat Module 6 | 7 | 8 | 9 |

The PIL.ImageStat Module

10 |

The ImageStat module calculates global statistics for an 11 | image, or a region of an image. 12 |

Module Contents

13 |
14 |
Stat(image, mask=None) (class) [#]
15 |
16 |

Calculate statistics for the given image.

17 |

For more information about this class, see The Stat Class.

18 |
19 |
20 |

The Stat Class

21 |
22 |
Stat(image, mask=None) (class) [#]
23 |
24 |
25 |
__init__(image, mask=None) [#]
26 |
27 |
28 |
image
29 |
30 |
31 |
mask
32 |
33 |
34 |

35 |
36 |
37 | 38 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/QuantHash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library 3 | * $Id$ 4 | * 5 | * image quantizer 6 | * 7 | * Written by Toby J Sargeant . 8 | * 9 | * See the README file for information on usage and redistribution. 10 | */ 11 | 12 | #ifndef __HASH_H__ 13 | #define __HASH_H__ 14 | 15 | #include "QuantTypes.h" 16 | 17 | HashTable hashtable_new(HashFunc,HashCmpFunc); 18 | void hashtable_free(HashTable); 19 | void hashtable_foreach(HashTable,IteratorFunc,void *); 20 | void hashtable_foreach_update(HashTable,IteratorUpdateFunc,void *); 21 | int hashtable_insert(HashTable,void *,void *); 22 | int hashtable_update(HashTable,void *,void *); 23 | int hashtable_lookup(const HashTable,const void *,void **); 24 | int hashtable_lookup_or_insert(HashTable,void *,void **,void *); 25 | int hashtable_insert_or_update_computed(HashTable,void *,ComputeFunc,ComputeFunc); 26 | int hashtable_delete(HashTable,const void *); 27 | int hashtable_remove(HashTable,const void *,void **,void **); 28 | void *hashtable_set_user_data(HashTable,void *); 29 | void *hashtable_get_user_data(const HashTable); 30 | DestroyFunc hashtable_set_key_destroy_func(HashTable,DestroyFunc); 31 | DestroyFunc hashtable_set_value_destroy_func(HashTable,DestroyFunc); 32 | unsigned long hashtable_get_count(const HashTable); 33 | void hashtable_rehash(HashTable); 34 | void hashtable_rehash_compute(HashTable,CollisionFunc); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/PIL/TarIO.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library. 3 | # $Id$ 4 | # 5 | # read files from within a tar file 6 | # 7 | # History: 8 | # 95-06-18 fl Created 9 | # 96-05-28 fl Open files in binary mode 10 | # 11 | # Copyright (c) Secret Labs AB 1997. 12 | # Copyright (c) Fredrik Lundh 1995-96. 13 | # 14 | # See the README file for information on usage and redistribution. 15 | # 16 | 17 | import ContainerIO 18 | import string 19 | 20 | ## 21 | # A file object that provides read access to a given member of a TAR 22 | # file. 23 | 24 | class TarIO(ContainerIO.ContainerIO): 25 | 26 | ## 27 | # Create file object. 28 | # 29 | # @param tarfile Name of TAR file. 30 | # @param file Name of member file. 31 | 32 | def __init__(self, tarfile, file): 33 | 34 | fh = open(tarfile, "rb") 35 | 36 | while 1: 37 | 38 | s = fh.read(512) 39 | if len(s) != 512: 40 | raise IOError, "unexpected end of tar file" 41 | 42 | name = s[:100] 43 | i = string.find(name, chr(0)) 44 | if i == 0: 45 | raise IOError, "cannot find subfile" 46 | if i > 0: 47 | name = name[:i] 48 | 49 | size = string.atoi(s[124:136], 8) 50 | 51 | if file == name: 52 | break 53 | 54 | fh.seek((size + 511) & (~511), 1) 55 | 56 | # Open region 57 | ContainerIO.ContainerIO.__init__(self, fh, fh.tell(), size) 58 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/Offset.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library 3 | * $Id$ 4 | * 5 | * offset an image in x and y directions 6 | * 7 | * history: 8 | * 96-07-22 fl: Created 9 | * 98-11-01 cgw@pgt.com: Fixed negative-array index bug 10 | * 11 | * Copyright (c) Fredrik Lundh 1996. 12 | * Copyright (c) Secret Labs AB 1997. 13 | * 14 | * See the README file for information on usage and redistribution. 15 | */ 16 | 17 | 18 | #include "Imaging.h" 19 | 20 | 21 | Imaging 22 | ImagingOffset(Imaging im, int xoffset, int yoffset) 23 | { 24 | int x, y; 25 | Imaging imOut; 26 | 27 | if (!im) 28 | return (Imaging) ImagingError_ModeError(); 29 | 30 | imOut = ImagingNew(im->mode, im->xsize, im->ysize); 31 | if (!imOut) 32 | return NULL; 33 | 34 | ImagingCopyInfo(imOut, im); 35 | 36 | /* make offsets positive to avoid negative coordinates */ 37 | xoffset %= im->xsize; 38 | xoffset = im->xsize - xoffset; 39 | if (xoffset < 0) 40 | xoffset += im->xsize; 41 | 42 | yoffset %= im->ysize; 43 | yoffset = im->ysize - yoffset; 44 | if (yoffset < 0) 45 | yoffset += im->ysize; 46 | 47 | #define OFFSET(image)\ 48 | for (y = 0; y < im->ysize; y++)\ 49 | for (x = 0; x < im->xsize; x++) {\ 50 | int yi = (y + yoffset) % im->ysize;\ 51 | int xi = (x + xoffset) % im->xsize;\ 52 | imOut->image[y][x] = im->image[yi][xi];\ 53 | } 54 | 55 | if (im->image8) 56 | OFFSET(image8) 57 | else 58 | OFFSET(image32) 59 | 60 | return imOut; 61 | } 62 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/Zip.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library. 3 | * $Id$ 4 | * 5 | * declarations for the ZIP codecs 6 | * 7 | * Copyright (c) Fredrik Lundh 1996. 8 | */ 9 | 10 | 11 | #include "zlib.h" 12 | 13 | 14 | /* modes */ 15 | #define ZIP_PNG 0 /* continuous, filtered image data */ 16 | #define ZIP_PNG_PALETTE 1 /* non-continuous data, disable filtering */ 17 | #define ZIP_TIFF_PREDICTOR 2 /* TIFF, with predictor */ 18 | #define ZIP_TIFF 3 /* TIFF, without predictor */ 19 | 20 | 21 | typedef struct { 22 | 23 | /* CONFIGURATION */ 24 | 25 | /* Codec mode */ 26 | int mode; 27 | 28 | /* Optimize (max compression) SLOW!!! */ 29 | int optimize; 30 | 31 | /* Predefined dictionary (experimental) */ 32 | char* dictionary; 33 | int dictionary_size; 34 | 35 | /* PRIVATE CONTEXT (set by decoder/encoder) */ 36 | 37 | z_stream z_stream; /* (de)compression stream */ 38 | 39 | UINT8* previous; /* previous line (allocated) */ 40 | 41 | int last_output; /* # bytes last output by inflate */ 42 | 43 | /* Compressor specific stuff */ 44 | UINT8* prior; /* filter storage (allocated) */ 45 | UINT8* up; 46 | UINT8* average; 47 | UINT8* paeth; 48 | 49 | UINT8* output; /* output data */ 50 | 51 | int prefix; /* size of filter prefix (0 for TIFF data) */ 52 | 53 | int interlaced; /* is the image interlaced? (PNG) */ 54 | 55 | int pass; /* current pass of the interlaced image (PNG) */ 56 | 57 | } ZIPSTATE; 58 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/PIL/ImageMode.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library. 3 | # $Id$ 4 | # 5 | # standard mode descriptors 6 | # 7 | # History: 8 | # 2006-03-20 fl Added 9 | # 10 | # Copyright (c) 2006 by Secret Labs AB. 11 | # Copyright (c) 2006 by Fredrik Lundh. 12 | # 13 | # See the README file for information on usage and redistribution. 14 | # 15 | 16 | # mode descriptor cache 17 | _modes = {} 18 | 19 | ## 20 | # Wrapper for mode strings. 21 | 22 | class ModeDescriptor: 23 | 24 | def __init__(self, mode, bands, basemode, basetype): 25 | self.mode = mode 26 | self.bands = bands 27 | self.basemode = basemode 28 | self.basetype = basetype 29 | 30 | def __str__(self): 31 | return self.mode 32 | 33 | ## 34 | # Gets a mode descriptor for the given mode. 35 | 36 | def getmode(mode): 37 | if not _modes: 38 | # initialize mode cache 39 | import Image 40 | # core modes 41 | for m, (basemode, basetype, bands) in Image._MODEINFO.items(): 42 | _modes[m] = ModeDescriptor(m, bands, basemode, basetype) 43 | # extra experimental modes 44 | _modes["LA"] = ModeDescriptor("LA", ("L", "A"), "L", "L") 45 | _modes["PA"] = ModeDescriptor("PA", ("P", "A"), "RGB", "L") 46 | # mapping modes 47 | _modes["I;16"] = ModeDescriptor("I;16", "I", "L", "L") 48 | _modes["I;16L"] = ModeDescriptor("I;16L", "I", "L", "L") 49 | _modes["I;16B"] = ModeDescriptor("I;16B", "I", "L", "L") 50 | return _modes[mode] 51 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.IptcImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.IptcImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.IptcImagePlugin Module

10 |
11 |
getiptcinfo(im) [#]
12 |
13 |
14 |
im
15 |
16 |
17 |
Returns:
18 |
19 |
20 |

21 |
22 |
IptcImageFile (class) [#]
23 |
24 |

Image plugin for IPTC/NAA datastreams.

25 |

For more information about this class, see The IptcImageFile Class.

26 |
27 |
28 |

The IptcImageFile Class

29 |
30 |
IptcImageFile (class) [#]
31 |
32 |

Image plugin for IPTC/NAA datastreams. To read IPTC/NAA fields 33 | from TIFF and JPEG files, use the getiptcinfo function. 34 |

35 |
36 | 37 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/Crop.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library 3 | * $Id$ 4 | * 5 | * cut region from image 6 | * 7 | * history: 8 | * 95-11-27 fl Created 9 | * 98-07-10 fl Fixed "null result" error 10 | * 99-02-05 fl Rewritten to use Paste primitive 11 | * 12 | * Copyright (c) Secret Labs AB 1997-99. 13 | * Copyright (c) Fredrik Lundh 1995. 14 | * 15 | * See the README file for information on usage and redistribution. 16 | */ 17 | 18 | 19 | #include "Imaging.h" 20 | 21 | 22 | Imaging 23 | ImagingCrop(Imaging imIn, int sx0, int sy0, int sx1, int sy1) 24 | { 25 | Imaging imOut; 26 | int xsize, ysize; 27 | int dx0, dy0, dx1, dy1; 28 | INT32 zero = 0; 29 | 30 | if (!imIn) 31 | return (Imaging) ImagingError_ModeError(); 32 | 33 | xsize = sx1 - sx0; 34 | if (xsize < 0) 35 | xsize = 0; 36 | ysize = sy1 - sy0; 37 | if (ysize < 0) 38 | ysize = 0; 39 | 40 | imOut = ImagingNew(imIn->mode, xsize, ysize); 41 | if (!imOut) 42 | return NULL; 43 | 44 | ImagingCopyInfo(imOut, imIn); 45 | 46 | if (sx0 < 0 || sy0 < 0 || sx1 > imIn->xsize || sy1 > imIn->ysize) 47 | (void) ImagingFill(imOut, &zero); 48 | 49 | dx0 = -sx0; 50 | dy0 = -sy0; 51 | dx1 = imIn->xsize - sx0; 52 | dy1 = imIn->ysize - sy0; 53 | 54 | /* paste the source image on top of the output image!!! */ 55 | if (ImagingPaste(imOut, imIn, NULL, dx0, dy0, dx1, dy1) < 0) { 56 | ImagingDelete(imOut); 57 | return NULL; 58 | } 59 | 60 | return imOut; 61 | } 62 | -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/MakeVar.m: -------------------------------------------------------------------------------- 1 | %Made by J.T.B. Overvelde on 9 may 2011 2 | 3 | function MakeVar(s,routine,c,e22ct,stepSize) 4 | 5 | GlobPar 6 | 7 | cd(AbDir) 8 | %make variable file 9 | delete('All-Var.py'); 10 | fid = fopen('All-Var.py', 'w'); 11 | fprintf(fid,'routine = %d\n',routine); 12 | for i=1:length(c) 13 | fprintf(fid,['c',num2str(i),' = %1.5f\n'],c(i)); 14 | end 15 | fprintf(fid,'numModes = %d\n',numModes); 16 | fprintf(fid,'stepSize = %0.12f\n',stepSize); 17 | fprintf(fid,'ec = %0.12f\n',e22ct); 18 | fprintf(fid,'maxIncr = %d\n',maxIncr); 19 | fprintf(fid,'maxNumIncr = %d\n',maxNumIncr); 20 | fprintf(fid,'GridSpaceX = %0.12f\n',GridSpaceX); 21 | fprintf(fid,'GridSpaceY = %0.12f\n',GridSpaceY); 22 | fprintf(fid,'numHolesX = %d\n',numHolesX); 23 | fprintf(fid,'numHolesY = %d\n',numHolesY); 24 | fprintf(fid,'imperf = %0.12f\n',imperf); 25 | fprintf(fid,'sizeMesh = %0.12f\n',sizeMesh); 26 | fprintf(fid,'saveData = %d\n',saveData); 27 | fprintf(fid,'saveFig = %d\n',saveFig); 28 | fprintf(fid,'saveMov = %d\n',saveMov); 29 | fprintf(fid,'mu = %1.8f\n',muVar); 30 | fprintf(fid,'K = %1.8f\n',K); 31 | fprintf(fid,'rho = %1.8f\n',rho); 32 | fprintf(fid,'nS = %d\n',length(s)); 33 | for i=1:length(s) 34 | fprintf(fid,['valSpline',num2str(i),' = [(%0.12f,%0.12f)'],s(i).x(1)+GridSpaceX/2,s(i).y(1)+GridSpaceY/2); 35 | for j=2:length(s(i).x) 36 | fprintf(fid,',(%0.12f,%0.12f)',s(i).x(j)+GridSpaceX/2,s(i).y(j)+GridSpaceY/2); 37 | end 38 | fprintf(fid,']\n'); 39 | end 40 | fclose(fid); 41 | cd(MatDir) 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/PcxDecode.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library. 3 | * $Id$ 4 | * 5 | * decoder for PCX image data. 6 | * 7 | * history: 8 | * 95-09-14 fl Created 9 | * 10 | * Copyright (c) Fredrik Lundh 1995. 11 | * Copyright (c) Secret Labs AB 1997. 12 | * 13 | * See the README file for information on usage and redistribution. 14 | */ 15 | 16 | 17 | #include "Imaging.h" 18 | 19 | int 20 | ImagingPcxDecode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes) 21 | { 22 | UINT8 n; 23 | UINT8* ptr; 24 | 25 | ptr = buf; 26 | 27 | for (;;) { 28 | 29 | if (bytes < 1) 30 | return ptr - buf; 31 | 32 | if ((*ptr & 0xC0) == 0xC0) { 33 | 34 | /* Run */ 35 | if (bytes < 2) 36 | return ptr - buf; 37 | 38 | n = ptr[0] & 0x3F; 39 | 40 | while (n > 0) { 41 | if (state->x >= state->bytes) { 42 | state->errcode = IMAGING_CODEC_OVERRUN; 43 | break; 44 | } 45 | state->buffer[state->x++] = ptr[1]; 46 | n--; 47 | } 48 | 49 | ptr += 2; bytes -= 2; 50 | 51 | } else { 52 | 53 | /* Literal */ 54 | state->buffer[state->x++] = ptr[0]; 55 | ptr++; bytes--; 56 | 57 | } 58 | 59 | if (state->x >= state->bytes) { 60 | 61 | /* Got a full line, unpack it */ 62 | state->shuffle((UINT8*) im->image[state->y + state->yoff] + 63 | state->xoff * im->pixelsize, state->buffer, 64 | state->xsize); 65 | 66 | state->x = 0; 67 | 68 | if (++state->y >= state->ysize) { 69 | /* End of file (errcode = 0) */ 70 | return -1; 71 | } 72 | } 73 | 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Scripts/enhancer.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library 3 | # $Id$ 4 | # 5 | # this demo script creates four windows containing an image and a slider. 6 | # drag the slider to modify the image. 7 | # 8 | 9 | from Tkinter import * 10 | from PIL import Image, ImageTk, ImageEnhance 11 | import sys 12 | 13 | # 14 | # enhancer widget 15 | 16 | class Enhance(Frame): 17 | def __init__(self, master, image, name, enhancer, lo, hi): 18 | Frame.__init__(self, master) 19 | 20 | # set up the image 21 | self.tkim = ImageTk.PhotoImage(image.mode, image.size) 22 | self.enhancer = enhancer(image) 23 | self.update("1.0") # normalize 24 | 25 | # image window 26 | Label(self, image=self.tkim).pack() 27 | 28 | # scale 29 | s = Scale(self, label=name, orient=HORIZONTAL, 30 | from_=lo, to=hi, resolution=0.01, 31 | command=self.update) 32 | s.set(self.value) 33 | s.pack() 34 | 35 | def update(self, value): 36 | self.value = eval(value) 37 | self.tkim.paste(self.enhancer.enhance(self.value)) 38 | 39 | # 40 | # main 41 | 42 | root = Tk() 43 | 44 | im = Image.open(sys.argv[1]) 45 | 46 | im.thumbnail((200, 200)) 47 | 48 | Enhance(root, im, "Color", ImageEnhance.Color, 0.0, 4.0).pack() 49 | Enhance(Toplevel(), im, "Sharpness", ImageEnhance.Sharpness, -2.0, 2.0).pack() 50 | Enhance(Toplevel(), im, "Brightness", ImageEnhance.Brightness, -1.0, 3.0).pack() 51 | Enhance(Toplevel(), im, "Contrast", ImageEnhance.Contrast, -1.0, 3.0).pack() 52 | 53 | root.mainloop() 54 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Tk/install.txt: -------------------------------------------------------------------------------- 1 | ==================================================================== 2 | Using PIL With Tkinter 3 | ==================================================================== 4 | 5 | Starting with 1.0 final (release candidate 2 and later, to be 6 | precise), PIL can attach itself to Tkinter in flight. As a result, 7 | you no longer need to rebuild the Tkinter extension to be able to 8 | use PIL. 9 | 10 | However, if you cannot get the this to work on your platform, you 11 | can do it in the old way: 12 | 13 | * Adding Tkinter support 14 | 15 | 1. Compile Python's _tkinter.c with the WITH_APPINIT and WITH_PIL 16 | flags set, and link it with tkImaging.c and tkappinit.c. To 17 | do this, copy the former to the Modules directory, and edit 18 | the _tkinter line in Setup (or Setup.in) according to the 19 | instructions in that file. 20 | 21 | NOTE: if you have an old Python version, the tkappinit.c 22 | file is not included by default. If this is the case, you 23 | will have to add the following lines to tkappinit.c, after 24 | the MOREBUTTONS stuff: 25 | 26 | { 27 | extern void TkImaging_Init(Tcl_Interp* interp); 28 | TkImaging_Init(interp); 29 | } 30 | 31 | This registers a Tcl command called "PyImagingPhoto", which is 32 | use to communicate between PIL and Tk's PhotoImage handler. 33 | 34 | You must also change the _tkinter line in Setup (or Setup.in) 35 | to something like: 36 | 37 | _tkinter _tkinter.c tkImaging.c tkappinit.c -DWITH_APPINIT 38 | -I/usr/local/include -L/usr/local/lib -ltk8.0 -ltcl8.0 -lX11 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/ImDib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library 3 | * $Id$ 4 | * 5 | * Windows DIB specifics 6 | * 7 | * Copyright (c) Secret Labs AB 1997-98. 8 | * Copyright (c) Fredrik Lundh 1996. 9 | * 10 | * See the README file for information on usage and redistribution. 11 | */ 12 | 13 | #ifdef WIN32 14 | 15 | #if (defined(_MSC_VER) && _MSC_VER >= 1200) || (defined __GNUC__) 16 | /* already defined in basetsd.h */ 17 | #undef INT32 18 | #undef INT64 19 | #undef UINT32 20 | #endif 21 | 22 | #include 23 | 24 | #if defined(__cplusplus) 25 | extern "C" { 26 | #endif 27 | 28 | struct ImagingDIBInstance { 29 | /* Windows interface */ 30 | HDC dc; 31 | HBITMAP bitmap; 32 | HGDIOBJ old_bitmap; 33 | BITMAPINFO *info; 34 | UINT8 *bits; 35 | HPALETTE palette; 36 | /* Used by cut and paste */ 37 | char mode[4]; 38 | int xsize, ysize; 39 | int pixelsize; 40 | int linesize; 41 | ImagingShuffler pack; 42 | ImagingShuffler unpack; 43 | }; 44 | 45 | typedef struct ImagingDIBInstance* ImagingDIB; 46 | 47 | extern char* ImagingGetModeDIB(int size_out[2]); 48 | 49 | extern ImagingDIB ImagingNewDIB(const char *mode, int xsize, int ysize); 50 | 51 | extern void ImagingDeleteDIB(ImagingDIB im); 52 | 53 | extern void ImagingDrawDIB(ImagingDIB dib, int dc, int dst[4], int src[4]); 54 | extern void ImagingExposeDIB(ImagingDIB dib, int dc); 55 | 56 | extern int ImagingQueryPaletteDIB(ImagingDIB dib, int dc); 57 | 58 | extern void ImagingPasteDIB(ImagingDIB dib, Imaging im, int xy[4]); 59 | 60 | #if defined(__cplusplus) 61 | } 62 | #endif 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/PIL/GimpPaletteFile.py: -------------------------------------------------------------------------------- 1 | # 2 | # Python Imaging Library 3 | # $Id$ 4 | # 5 | # stuff to read GIMP palette files 6 | # 7 | # History: 8 | # 1997-08-23 fl Created 9 | # 2004-09-07 fl Support GIMP 2.0 palette files. 10 | # 11 | # Copyright (c) Secret Labs AB 1997-2004. All rights reserved. 12 | # Copyright (c) Fredrik Lundh 1997-2004. 13 | # 14 | # See the README file for information on usage and redistribution. 15 | # 16 | 17 | import re, string 18 | 19 | ## 20 | # File handler for GIMP's palette format. 21 | 22 | class GimpPaletteFile: 23 | 24 | rawmode = "RGB" 25 | 26 | def __init__(self, fp): 27 | 28 | self.palette = map(lambda i: chr(i)*3, range(256)) 29 | 30 | if fp.readline()[:12] != "GIMP Palette": 31 | raise SyntaxError, "not a GIMP palette file" 32 | 33 | i = 0 34 | 35 | while i <= 255: 36 | 37 | s = fp.readline() 38 | 39 | if not s: 40 | break 41 | # skip fields and comment lines 42 | if re.match("\w+:|#", s): 43 | continue 44 | if len(s) > 100: 45 | raise SyntaxError, "bad palette file" 46 | 47 | v = tuple(map(int, string.split(s)[:3])) 48 | if len(v) != 3: 49 | raise ValueError, "bad palette entry" 50 | 51 | if 0 <= i <= 255: 52 | self.palette[i] = chr(v[0]) + chr(v[1]) + chr(v[2]) 53 | 54 | i = i + 1 55 | 56 | self.palette = string.join(self.palette, "") 57 | 58 | 59 | def getpalette(self): 60 | 61 | return self.palette, self.rawmode 62 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/PIL/ImagePath.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library 3 | # $Id$ 4 | # 5 | # path interface 6 | # 7 | # History: 8 | # 1996-11-04 fl Created 9 | # 2002-04-14 fl Added documentation stub class 10 | # 11 | # Copyright (c) Secret Labs AB 1997. 12 | # Copyright (c) Fredrik Lundh 1996. 13 | # 14 | # See the README file for information on usage and redistribution. 15 | # 16 | 17 | import Image 18 | 19 | ## 20 | # Path wrapper. 21 | 22 | class Path: 23 | 24 | ## 25 | # Creates a path object. 26 | # 27 | # @param xy Sequence. The sequence can contain 2-tuples [(x, y), ...] 28 | # or a flat list of numbers [x, y, ...]. 29 | 30 | def __init__(self, xy): 31 | pass 32 | 33 | ## 34 | # Compacts the path, by removing points that are close to each 35 | # other. This method modifies the path in place. 36 | 37 | def compact(self, distance=2): 38 | pass 39 | 40 | ## 41 | # Gets the bounding box. 42 | 43 | def getbbox(self): 44 | pass 45 | 46 | ## 47 | # Maps the path through a function. 48 | 49 | def map(self, function): 50 | pass 51 | 52 | ## 53 | # Converts the path to Python list. 54 | # 55 | # @param flat By default, this function returns a list of 2-tuples 56 | # [(x, y), ...]. If this argument is true, it returns a flat 57 | # list [x, y, ...] instead. 58 | # @return A list of coordinates. 59 | 60 | def tolist(self, flat=0): 61 | pass 62 | 63 | ## 64 | # Transforms the path. 65 | 66 | def transform(self, matrix): 67 | pass 68 | 69 | 70 | # override with C implementation 71 | Path = Image.core.path 72 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.GdImageFile.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.GdImageFile Module 6 | 7 | 8 | 9 |

The PIL.GdImageFile Module

10 |
11 |
GdImageFile (class) [#]
12 |
13 |

Image plugin for the GD uncompressed format.

14 |

For more information about this class, see The GdImageFile Class.

15 |
16 |
open(fp, mode="r") [#]
17 |
18 |
19 |
filename
20 |
21 |
22 |
mode
23 |
24 |
25 |
Returns:
26 |
27 |
28 |
Raises IOError:
29 |
30 |

31 |
32 |
33 |

The GdImageFile Class

34 |
35 |
GdImageFile (class) [#]
36 |
37 |

Image plugin for the GD uncompressed format. Note that this format 38 | is not supported by the standard Image.open function. To use 39 | this plugin, you have to import the GdImageFile module and 40 | use the GdImageFile.open function. 41 |

42 |
43 | 44 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/XbmDecode.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library. 3 | * $Id$ 4 | * 5 | * decoder for XBM hex image data 6 | * 7 | * history: 8 | * 96-04-13 fl Created 9 | * 10 | * Copyright (c) Fredrik Lundh 1996. 11 | * Copyright (c) Secret Labs AB 1997. 12 | * 13 | * See the README file for information on usage and redistribution. 14 | */ 15 | 16 | 17 | #include "Imaging.h" 18 | 19 | #define HEX(v) ((v >= '0' && v <= '9') ? v - '0' :\ 20 | (v >= 'a' && v <= 'f') ? v - 'a' + 10 :\ 21 | (v >= 'A' && v <= 'F') ? v - 'A' + 10 : 0) 22 | 23 | int 24 | ImagingXbmDecode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes) 25 | { 26 | enum { BYTE = 1, SKIP }; 27 | 28 | UINT8* ptr; 29 | 30 | if (!state->state) 31 | state->state = SKIP; 32 | 33 | ptr = buf; 34 | 35 | for (;;) { 36 | 37 | if (state->state == SKIP) { 38 | 39 | /* Skip forward until next 'x' */ 40 | 41 | while (bytes > 0) { 42 | if (*ptr == 'x') 43 | break; 44 | ptr++; 45 | bytes--; 46 | } 47 | 48 | if (bytes == 0) 49 | return ptr - buf; 50 | 51 | state->state = BYTE; 52 | 53 | } 54 | 55 | if (bytes < 3) 56 | return ptr - buf; 57 | 58 | state->buffer[state->x] = (HEX(ptr[1])<<4) + HEX(ptr[2]); 59 | 60 | if (++state->x >= state->bytes) { 61 | 62 | /* Got a full line, unpack it */ 63 | state->shuffle((UINT8*) im->image[state->y], state->buffer, 64 | state->xsize); 65 | 66 | state->x = 0; 67 | 68 | if (++state->y >= state->ysize) { 69 | /* End of file (errcode = 0) */ 70 | return -1; 71 | } 72 | } 73 | 74 | ptr += 3; 75 | bytes -= 3; 76 | 77 | state->state = SKIP; 78 | 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.TiffImagePlugin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.TiffImagePlugin Module 6 | 7 | 8 | 9 |

The PIL.TiffImagePlugin Module

10 |
11 |
ImageFileDirectory(prefix="II") (class) [#]
12 |
13 |

Wrapper for TIFF IFDs.

14 |

For more information about this class, see The ImageFileDirectory Class.

15 |
16 |
TiffImageFile (class) [#]
17 |
18 |

Image plugin for TIFF files.

19 |

For more information about this class, see The TiffImageFile Class.

20 |
21 |
22 |

The ImageFileDirectory Class

23 |
24 |
ImageFileDirectory(prefix="II") (class) [#]
25 |
26 |
27 |
28 |

The TiffImageFile Class

29 |
30 |
TiffImageFile (class) [#]
31 |
32 |
33 |
34 | 35 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Sane/CHANGES: -------------------------------------------------------------------------------- 1 | 2 | from V1.0 to V2.0 3 | 4 | _sane.c: 5 | - Values for option constraints are correctly translated to floats 6 | if value type is TYPE_FIXED for SANE_CONSTRAINT_RANGE and 7 | SANE_CONSTRAINT_WORD_LIST 8 | - added constants INFO_INEXACT, INFO_RELOAD_OPTIONS, 9 | INFO_RELOAD_PARAMS (possible return values of set_option()) 10 | to module dictionnary. 11 | - removed additional return variable 'i' from SaneDev_get_option(), 12 | because it is only set when SANE_ACTION_SET_VALUE is used. 13 | - scanDev.get_parameters() now returns the scanner mode as 'format', 14 | no more the typical PIL codes. So 'L' became 'gray', 'RGB' is now 15 | 'color', 'R' is 'red', 'G' is 'green', 'B' is 'red'. This matches 16 | the way scanDev.mode is set. 17 | This should be the only incompatibility vs. version 1.0. 18 | 19 | sane.py 20 | - ScanDev got new method __load_option_dict() called from __init__() 21 | and from __setattr__() if backend reported that the frontend should 22 | reload the options. 23 | - Nice human-readable __repr__() method added for class Option 24 | - if __setattr__ (i.e. set_option) reports that all other options 25 | have to be reloaded due to a change in the backend then they are reloaded. 26 | - due to the change in SaneDev_get_option() only the 'value' is 27 | returned from get_option(). 28 | - in __setattr__ integer values are automatically converted to floats 29 | if SANE backend expects SANE_FIXED (i.e. fix-point float) 30 | - The scanner options can now directly be accessed via scanDev[optionName] 31 | instead scanDev.opt[optionName]. (The old way still works). 32 | 33 | V1.0: 34 | A.M. Kuchling's original pysane package. -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/EpsEncode.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library. 3 | * $Id$ 4 | * 5 | * encoder for EPS hex data 6 | * 7 | * history: 8 | * 96-04-19 fl created 9 | * 96-06-27 fl don't drop last block of encoded data 10 | * 11 | * notes: 12 | * FIXME: rename to HexEncode.c ?? 13 | * 14 | * Copyright (c) Fredrik Lundh 1996. 15 | * Copyright (c) Secret Labs AB 1997. 16 | * 17 | * See the README file for information on usage and redistribution. 18 | */ 19 | 20 | 21 | #include "Imaging.h" 22 | 23 | 24 | int 25 | ImagingEpsEncode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes) 26 | { 27 | enum { HEXBYTE=1, NEWLINE }; 28 | const char *hex = "0123456789abcdef"; 29 | 30 | UINT8* ptr = buf; 31 | UINT8* in, i; 32 | 33 | if (!state->state) { 34 | state->state = HEXBYTE; 35 | state->xsize *= im->pixelsize; /* Hack! */ 36 | } 37 | 38 | in = (UINT8*) im->image[state->y]; 39 | 40 | for (;;) { 41 | 42 | if (state->state == NEWLINE) { 43 | if (bytes < 1) 44 | break; 45 | *ptr++ = '\n'; 46 | bytes--; 47 | state->state = HEXBYTE; 48 | } 49 | 50 | if (bytes < 2) 51 | break; 52 | 53 | i = in[state->x++]; 54 | *ptr++ = hex[(i>>4)&15]; 55 | *ptr++ = hex[i&15]; 56 | bytes -= 2; 57 | 58 | /* Skip junk bytes */ 59 | if (im->bands == 3 && (state->x & 3) == 3) 60 | state->x++; 61 | 62 | if (++state->count >= 79/2) { 63 | state->state = NEWLINE; 64 | state->count = 0; 65 | } 66 | 67 | if (state->x >= state->xsize) { 68 | state->x = 0; 69 | if (++state->y >= state->ysize) { 70 | state->errcode = IMAGING_CODEC_END; 71 | break; 72 | } 73 | in = (UINT8*) im->image[state->y]; 74 | } 75 | 76 | } 77 | 78 | return ptr - buf; 79 | 80 | } 81 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/_imagingtk.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library. 3 | * 4 | * tkinter hooks 5 | * 6 | * history: 7 | * 99-07-26 fl created 8 | * 99-08-15 fl moved to its own support module 9 | * 10 | * Copyright (c) Secret Labs AB 1999. 11 | * 12 | * See the README file for information on usage and redistribution. 13 | */ 14 | 15 | 16 | #include "Python.h" 17 | #include "Imaging.h" 18 | 19 | #include "tk.h" 20 | 21 | /* must link with Tk/tkImaging.c */ 22 | extern void TkImaging_Init(Tcl_Interp* interp); 23 | 24 | /* copied from _tkinter.c (this isn't as bad as it may seem: for new 25 | versions, we use _tkinter's interpaddr hook instead, and all older 26 | versions use this structure layout) */ 27 | 28 | typedef struct { 29 | PyObject_HEAD 30 | Tcl_Interp* interp; 31 | } TkappObject; 32 | 33 | static PyObject* 34 | _tkinit(PyObject* self, PyObject* args) 35 | { 36 | Tcl_Interp* interp; 37 | 38 | long arg; 39 | int is_interp; 40 | if (!PyArg_ParseTuple(args, "li", &arg, &is_interp)) 41 | return NULL; 42 | 43 | if (is_interp) 44 | interp = (Tcl_Interp*) arg; 45 | else { 46 | TkappObject* app; 47 | /* Do it the hard way. This will break if the TkappObject 48 | layout changes */ 49 | app = (TkappObject*) arg; 50 | interp = app->interp; 51 | } 52 | 53 | /* This will bomb if interp is invalid... */ 54 | TkImaging_Init(interp); 55 | 56 | Py_INCREF(Py_None); 57 | return Py_None; 58 | } 59 | 60 | static PyMethodDef functions[] = { 61 | /* Tkinter interface stuff */ 62 | {"tkinit", (PyCFunction)_tkinit, 1}, 63 | {NULL, NULL} /* sentinel */ 64 | }; 65 | 66 | DL_EXPORT(void) 67 | init_imagingtk(void) 68 | { 69 | Py_InitModule("_imagingtk", functions); 70 | } 71 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/PIL/BufrStubImagePlugin.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library 3 | # $Id$ 4 | # 5 | # BUFR stub adapter 6 | # 7 | # Copyright (c) 1996-2003 by Fredrik Lundh 8 | # 9 | # See the README file for information on usage and redistribution. 10 | # 11 | 12 | import Image, ImageFile 13 | 14 | _handler = None 15 | 16 | ## 17 | # Install application-specific BUFR image handler. 18 | # 19 | # @param handler Handler object. 20 | 21 | def register_handler(handler): 22 | global _handler 23 | _handler = handler 24 | 25 | # -------------------------------------------------------------------- 26 | # Image adapter 27 | 28 | def _accept(prefix): 29 | return prefix[:4] == "BUFR" or prefix[:4] == "ZCZC" 30 | 31 | class BufrStubImageFile(ImageFile.StubImageFile): 32 | 33 | format = "BUFR" 34 | format_description = "BUFR" 35 | 36 | def _open(self): 37 | 38 | offset = self.fp.tell() 39 | 40 | if not _accept(self.fp.read(8)): 41 | raise SyntaxError("Not a BUFR file") 42 | 43 | self.fp.seek(offset) 44 | 45 | # make something up 46 | self.mode = "F" 47 | self.size = 1, 1 48 | 49 | loader = self._load() 50 | if loader: 51 | loader.open(self) 52 | 53 | def _load(self): 54 | return _handler 55 | 56 | def _save(im, fp, filename): 57 | if _handler is None or not hasattr("_handler", "save"): 58 | raise IOError("BUFR save handler not installed") 59 | _handler.save(im, fp, filename) 60 | 61 | 62 | # -------------------------------------------------------------------- 63 | # Registry 64 | 65 | Image.register_open(BufrStubImageFile.format, BufrStubImageFile, _accept) 66 | Image.register_save(BufrStubImageFile.format, _save) 67 | 68 | Image.register_extension(BufrStubImageFile.format, ".bufr") 69 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/PIL/GribStubImagePlugin.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library 3 | # $Id$ 4 | # 5 | # GRIB stub adapter 6 | # 7 | # Copyright (c) 1996-2003 by Fredrik Lundh 8 | # 9 | # See the README file for information on usage and redistribution. 10 | # 11 | 12 | import Image, ImageFile 13 | 14 | _handler = None 15 | 16 | ## 17 | # Install application-specific GRIB image handler. 18 | # 19 | # @param handler Handler object. 20 | 21 | def register_handler(handler): 22 | global _handler 23 | _handler = handler 24 | 25 | # -------------------------------------------------------------------- 26 | # Image adapter 27 | 28 | def _accept(prefix): 29 | return prefix[0:4] == "GRIB" and prefix[7] == chr(1) 30 | 31 | class GribStubImageFile(ImageFile.StubImageFile): 32 | 33 | format = "GRIB" 34 | format_description = "GRIB" 35 | 36 | def _open(self): 37 | 38 | offset = self.fp.tell() 39 | 40 | if not _accept(self.fp.read(8)): 41 | raise SyntaxError("Not a GRIB file") 42 | 43 | self.fp.seek(offset) 44 | 45 | # make something up 46 | self.mode = "F" 47 | self.size = 1, 1 48 | 49 | loader = self._load() 50 | if loader: 51 | loader.open(self) 52 | 53 | def _load(self): 54 | return _handler 55 | 56 | def _save(im, fp, filename): 57 | if _handler is None or not hasattr("_handler", "save"): 58 | raise IOError("GRIB save handler not installed") 59 | _handler.save(im, fp, filename) 60 | 61 | 62 | # -------------------------------------------------------------------- 63 | # Registry 64 | 65 | Image.register_open(GribStubImageFile.format, GribStubImageFile, _accept) 66 | Image.register_save(GribStubImageFile.format, _save) 67 | 68 | Image.register_extension(GribStubImageFile.format, ".grib") 69 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/Except.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library 3 | * $Id$ 4 | * 5 | * default exception handling 6 | * 7 | * This module is usually overridden by application code (e.g. 8 | * _imaging.c for PIL's standard Python bindings). If you get 9 | * linking errors, remove this file from your project/library. 10 | * 11 | * history: 12 | * 1995-06-15 fl Created 13 | * 1998-12-29 fl Minor tweaks 14 | * 2003-09-13 fl Added ImagingEnter/LeaveSection() 15 | * 16 | * Copyright (c) 1997-2003 by Secret Labs AB. 17 | * Copyright (c) 1995-2003 by Fredrik Lundh. 18 | * 19 | * See the README file for information on usage and redistribution. 20 | */ 21 | 22 | 23 | #include "Imaging.h" 24 | 25 | 26 | /* exception state */ 27 | 28 | void * 29 | ImagingError_IOError(void) 30 | { 31 | fprintf(stderr, "*** exception: file access error\n"); 32 | return NULL; 33 | } 34 | 35 | void * 36 | ImagingError_MemoryError(void) 37 | { 38 | fprintf(stderr, "*** exception: out of memory\n"); 39 | return NULL; 40 | } 41 | 42 | void * 43 | ImagingError_ModeError(void) 44 | { 45 | return ImagingError_ValueError("bad image mode"); 46 | return NULL; 47 | } 48 | 49 | void * 50 | ImagingError_Mismatch(void) 51 | { 52 | return ImagingError_ValueError("images don't match"); 53 | return NULL; 54 | } 55 | 56 | void * 57 | ImagingError_ValueError(const char *message) 58 | { 59 | if (!message) 60 | message = "exception: bad argument to function"; 61 | fprintf(stderr, "*** %s\n", message); 62 | return NULL; 63 | } 64 | 65 | void 66 | ImagingError_Clear(void) 67 | { 68 | /* nop */; 69 | } 70 | 71 | /* thread state */ 72 | 73 | void 74 | ImagingSectionEnter(ImagingSectionCookie* cookie) 75 | { 76 | /* pass */ 77 | } 78 | 79 | void 80 | ImagingSectionLeave(ImagingSectionCookie* cookie) 81 | { 82 | /* pass */ 83 | } 84 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/PIL/Hdf5StubImagePlugin.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library 3 | # $Id$ 4 | # 5 | # HDF5 stub adapter 6 | # 7 | # Copyright (c) 2000-2003 by Fredrik Lundh 8 | # 9 | # See the README file for information on usage and redistribution. 10 | # 11 | 12 | import Image, ImageFile 13 | 14 | _handler = None 15 | 16 | ## 17 | # Install application-specific HDF5 image handler. 18 | # 19 | # @param handler Handler object. 20 | 21 | def register_handler(handler): 22 | global _handler 23 | _handler = handler 24 | 25 | # -------------------------------------------------------------------- 26 | # Image adapter 27 | 28 | def _accept(prefix): 29 | return prefix[:8] == "\x89HDF\r\n\x1a\n" 30 | 31 | class HDF5StubImageFile(ImageFile.StubImageFile): 32 | 33 | format = "HDF5" 34 | format_description = "HDF5" 35 | 36 | def _open(self): 37 | 38 | offset = self.fp.tell() 39 | 40 | if not _accept(self.fp.read(8)): 41 | raise SyntaxError("Not an HDF file") 42 | 43 | self.fp.seek(offset) 44 | 45 | # make something up 46 | self.mode = "F" 47 | self.size = 1, 1 48 | 49 | loader = self._load() 50 | if loader: 51 | loader.open(self) 52 | 53 | def _load(self): 54 | return _handler 55 | 56 | 57 | def _save(im, fp, filename): 58 | if _handler is None or not hasattr("_handler", "save"): 59 | raise IOError("HDF5 save handler not installed") 60 | _handler.save(im, fp, filename) 61 | 62 | 63 | # -------------------------------------------------------------------- 64 | # Registry 65 | 66 | Image.register_open(HDF5StubImageFile.format, HDF5StubImageFile, _accept) 67 | Image.register_save(HDF5StubImageFile.format, _save) 68 | 69 | Image.register_extension(HDF5StubImageFile.format, ".h5") 70 | Image.register_extension(HDF5StubImageFile.format, ".hdf") 71 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.ImageFileIO.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.ImageFileIO Module 6 | 7 | 8 | 9 |

The PIL.ImageFileIO Module

10 |
11 |
ImageFileIO(fp) (class) [#]
12 |
13 |

The ImageFileIO module can be used to read an image from a 14 | socket, or any other stream device.

15 |

For more information about this class, see The ImageFileIO Class.

16 |
17 |
18 |

The ImageFileIO Class

19 |
20 |
ImageFileIO(fp) (class) [#]
21 |
22 |

The ImageFileIO module can be used to read an image from a 23 | socket, or any other stream device. 24 |

25 | This module is deprecated. New code should use the Parser 26 | class in the ImageFile module instead. 27 | 28 |

29 |
__init__(fp) [#]
30 |
31 |

Adds buffering to a stream file object, in order to 32 | provide seek and tell methods required 33 | by the Image.open method. The stream object must 34 | implement read and close methods. 35 | 36 |

37 |
fp
38 |
39 |
40 |

41 |
42 |
43 | 44 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/MspDecode.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library. 3 | * $Id$ 4 | * 5 | * decoder for MSP version 2 data. 6 | * 7 | * history: 8 | * 97-01-03 fl Created 9 | * 10 | * Copyright (c) Fredrik Lundh 1997. 11 | * Copyright (c) Secret Labs AB 1997. 12 | * 13 | * See the README file for information on usage and redistribution. 14 | */ 15 | 16 | 17 | #include "Imaging.h" 18 | 19 | 20 | int 21 | ImagingMspDecode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes) 22 | { 23 | int n; 24 | UINT8* ptr; 25 | 26 | ptr = buf; 27 | 28 | for (;;) { 29 | 30 | if (bytes < 1) 31 | return ptr - buf; 32 | 33 | if (ptr[0] == 0) { 34 | 35 | /* Run (3 bytes block) */ 36 | if (bytes < 3) 37 | break; 38 | 39 | n = ptr[1]; 40 | 41 | if (state->x + n > state->bytes) { 42 | state->errcode = IMAGING_CODEC_OVERRUN; 43 | return -1; 44 | } 45 | 46 | memset(state->buffer + state->x, ptr[2], n); 47 | 48 | ptr += 3; 49 | bytes -= 3; 50 | 51 | } else { 52 | 53 | /* Literal (1+n bytes block) */ 54 | n = ptr[0]; 55 | 56 | if (bytes < 1 + n) 57 | break; 58 | 59 | if (state->x + n > state->bytes) { 60 | state->errcode = IMAGING_CODEC_OVERRUN; 61 | return -1; 62 | } 63 | 64 | memcpy(state->buffer + state->x, ptr + 1, n); 65 | 66 | ptr += 1 + n; 67 | bytes -= 1 + n; 68 | 69 | } 70 | 71 | state->x += n; 72 | 73 | if (state->x >= state->bytes) { 74 | 75 | /* Got a full line, unpack it */ 76 | state->shuffle((UINT8*) im->image[state->y + state->yoff] + 77 | state->xoff * im->pixelsize, state->buffer, 78 | state->xsize); 79 | 80 | state->x = 0; 81 | 82 | if (++state->y >= state->ysize) { 83 | /* End of file (errcode = 0) */ 84 | return -1; 85 | } 86 | } 87 | 88 | } 89 | 90 | return ptr - buf; 91 | } 92 | -------------------------------------------------------------------------------- /contents_overview.txt: -------------------------------------------------------------------------------- 1 | Contents&Status 2 | -------------------------------- 3 | 4 | todo: decide on license&include copyright (vikas) 5 | 6 | Kernel Scripts 7 | ---------------------- 8 | todo: create a 'how to run' instruction 9 | 10 | - Write Input Deck 11 | : missing description 12 | : author:: Ebbe Smith 13 | - Python Example Script 14 | : not approved by author: Johannes T. B Overvelde - http://www.overvelde com/projects/scriptabaqus/ 15 | - abq2img_v01 16 | : not approved by author 17 | : NB: requires library: PIL (imageing-1.1.7) 18 | - Principal Stress Directions 19 | : not approved -> included in installation files? 20 | 21 | 22 | Libraries 23 | ------------------------- 24 | todo: create a 'how to install' instruction 25 | - linearAlgebraUtils.puy 26 | : Series of 27 | Description: a series of frequently used functions 28 | to perform vector algebra 29 | 30 | - Imaging-1.1.7 31 | : is it completly opensource? and are we free to host it? 32 | :: Add numpy/matplotlib! 33 | 34 | ::: jpeg-8d 35 | ::: tcl8.5.12 36 | ::: tk8.5.12 37 | 38 | 39 | GUI Plugins 40 | ---------------------------------- 41 | -> add bolt studio 42 | : ask for permission 43 | 44 | 45 | Environment Mods 46 | ---------------------------------- 47 | todo: create a 'how to mod' instruction 48 | -> add legend font mod 49 | -> add geometry refinement mod 50 | 51 | 52 | Challenges 53 | ---------------------------------------- 54 | Empty atm 55 | 56 | 57 | ______________________________________________________________________________________________________ 58 | 59 | Possible Contributors: 60 | ------------------------------ 61 | 62 | Tim Hunter: 63 | http://www.wolfstartech.com/ -> 'free downloads' 64 | 65 | Brent Fillery: 66 | not sure, worth checking though 67 | 68 | Christer Gustavsson: 69 | Spoke about some scripts for plotting graphs 70 | 71 | swym : alot of plugins and such! -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/PcdDecode.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library. 3 | * $Id$ 4 | * 5 | * decoder for uncompressed PCD image data. 6 | * 7 | * history: 8 | * 96-05-10 fl Created 9 | * 96-05-18 fl New tables 10 | * 97-01-25 fl Use PhotoYCC unpacker 11 | * 12 | * notes: 13 | * This driver supports uncompressed PCD modes only 14 | * (resolutions up to 768x512). 15 | * 16 | * Copyright (c) Fredrik Lundh 1996-97. 17 | * Copyright (c) Secret Labs AB 1997. 18 | * 19 | * See the README file for information on usage and redistribution. 20 | */ 21 | 22 | 23 | #include "Imaging.h" 24 | 25 | 26 | int 27 | ImagingPcdDecode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes) 28 | { 29 | int x; 30 | int chunk; 31 | UINT8* out; 32 | UINT8* ptr; 33 | 34 | ptr = buf; 35 | 36 | chunk = 3 * state->xsize; 37 | 38 | for (;;) { 39 | 40 | /* We need data for two full lines before we can do anything */ 41 | if (bytes < chunk) 42 | return ptr - buf; 43 | 44 | /* Unpack first line */ 45 | out = state->buffer; 46 | for (x = 0; x < state->xsize; x++) { 47 | out[0] = ptr[x]; 48 | out[1] = ptr[(x+4*state->xsize)/2]; 49 | out[2] = ptr[(x+5*state->xsize)/2]; 50 | out += 4; 51 | } 52 | 53 | state->shuffle((UINT8*) im->image[state->y], 54 | state->buffer, state->xsize); 55 | 56 | if (++state->y >= state->ysize) 57 | return -1; /* This can hardly happen */ 58 | 59 | /* Unpack second line */ 60 | out = state->buffer; 61 | for (x = 0; x < state->xsize; x++) { 62 | out[0] = ptr[x+state->xsize]; 63 | out[1] = ptr[(x+4*state->xsize)/2]; 64 | out[2] = ptr[(x+5*state->xsize)/2]; 65 | out += 4; 66 | } 67 | 68 | state->shuffle((UINT8*) im->image[state->y], 69 | state->buffer, state->xsize); 70 | 71 | if (++state->y >= state->ysize) 72 | return -1; 73 | 74 | ptr += chunk; 75 | bytes -= chunk; 76 | 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/AbaqusFiles/All-Fig.py: -------------------------------------------------------------------------------- 1 | os.chdir(tDr) 2 | 3 | if routine==3: 4 | names=[(jobName1,stepName1),(jobName2,stepName2)] 5 | FrameNum=-1 6 | if routine==4: 7 | names=[(jobName2,stepName1+'1')] 8 | FrameNum=1 9 | 10 | 11 | for case in names: 12 | # Create a new vieport for this example. 13 | myViewport=session.Viewport(name='MakeFig', 14 | origin=(0,0), width=300, height=200) 15 | session.viewports['MakeFig'].makeCurrent() 16 | session.viewports['MakeFig'].maximize() 17 | session.viewports['MakeFig'].view.fitView() 18 | 19 | # Open the output database and associate with the new viewport odbPath = case[0]+'.odb' 20 | myOdb = visualization.openOdb(path=odbPath) 21 | myViewport.setValues(displayedObject=myOdb) 22 | 23 | #Display a contour plot of the output database. 24 | myViewport.odbDisplay.display.setValues(plotState=(DEFORMED,)) 25 | #Do not print the viewport decorations or Black background. 26 | session.printOptions.setValues(rendition=COLOR, 27 | vpDecorations=OFF, vpBackground=OFF) 28 | 29 | #print 30 | # numStep= myOdb.steps[case[1]] 31 | # nFrame=len(numStep.frames) 32 | # for m in range(0,nFrame): 33 | # numFrame = numStep.frames[m] 34 | # displacement=numFrame.fieldOutputs['U'] 35 | # myViewport.odbDisplay.setFrame(step=numStep,frame=numFrame) 36 | # # Print the viewport to a local EPS-Format file. 37 | # session.printToFile('Figures/Fig-'+case[0]+'-'+case[1]+'-Frame-'+str(m),EPS,(myViewport,)) 38 | # myOdb.close() 39 | 40 | numStep= myOdb.steps[case[1]] 41 | numFrame = numStep.frames[-1] 42 | displacement=numFrame.fieldOutputs['U'] 43 | myViewport.odbDisplay.setFrame(step=numStep,frame=numFrame) 44 | # Print the viewport to a local EPS-Format file. 45 | os.chdir(wDr) 46 | session.printToFile('Figures/Fig_'+str(int(100*c1))+'_'+str(int(100*c2))+'_'+str(int(100*stepSize)),EPS,(myViewport,)) 47 | os.chdir(tDr) 48 | myOdb.close() 49 | 50 | os.chdir(wDr) 51 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/PIL/GbrImagePlugin.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library 3 | # $Id$ 4 | # 5 | # load a GIMP brush file 6 | # 7 | # History: 8 | # 96-03-14 fl Created 9 | # 10 | # Copyright (c) Secret Labs AB 1997. 11 | # Copyright (c) Fredrik Lundh 1996. 12 | # 13 | # See the README file for information on usage and redistribution. 14 | # 15 | 16 | import Image, ImageFile 17 | 18 | def i32(c): 19 | return ord(c[3]) + (ord(c[2])<<8) + (ord(c[1])<<16) + (ord(c[0])<<24L) 20 | 21 | def _accept(prefix): 22 | return i32(prefix) >= 20 and i32(prefix[4:8]) == 1 23 | 24 | ## 25 | # Image plugin for the GIMP brush format. 26 | 27 | class GbrImageFile(ImageFile.ImageFile): 28 | 29 | format = "GBR" 30 | format_description = "GIMP brush file" 31 | 32 | def _open(self): 33 | 34 | header_size = i32(self.fp.read(4)) 35 | version = i32(self.fp.read(4)) 36 | if header_size < 20 or version != 1: 37 | raise SyntaxError, "not a GIMP brush" 38 | 39 | width = i32(self.fp.read(4)) 40 | height = i32(self.fp.read(4)) 41 | bytes = i32(self.fp.read(4)) 42 | if width <= 0 or height <= 0 or bytes != 1: 43 | raise SyntaxError, "not a GIMP brush" 44 | 45 | comment = self.fp.read(header_size - 20)[:-1] 46 | 47 | self.mode = "L" 48 | self.size = width, height 49 | 50 | self.info["comment"] = comment 51 | 52 | # Since the brush is so small, we read the data immediately 53 | self.data = self.fp.read(width * height) 54 | 55 | def load(self): 56 | 57 | if not self.data: 58 | return 59 | 60 | # create an image out of the brush data block 61 | self.im = Image.core.new(self.mode, self.size) 62 | self.im.fromstring(self.data) 63 | self.data = "" 64 | 65 | # 66 | # registry 67 | 68 | Image.register_open("GBR", GbrImageFile, _accept) 69 | 70 | Image.register_extension("GBR", ".gbr") 71 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/PackDecode.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library. 3 | * $Id$ 4 | * 5 | * decoder for PackBits image data. 6 | * 7 | * history: 8 | * 96-04-19 fl Created 9 | * 10 | * Copyright (c) Fredrik Lundh 1996. 11 | * Copyright (c) Secret Labs AB 1997. 12 | * 13 | * See the README file for information on usage and redistribution. 14 | */ 15 | 16 | 17 | #include "Imaging.h" 18 | 19 | int 20 | ImagingPackbitsDecode(Imaging im, ImagingCodecState state, 21 | UINT8* buf, int bytes) 22 | { 23 | UINT8 n; 24 | UINT8* ptr; 25 | int i; 26 | 27 | ptr = buf; 28 | 29 | for (;;) { 30 | 31 | if (bytes < 1) 32 | return ptr - buf; 33 | 34 | if (ptr[0] & 0x80) { 35 | 36 | if (ptr[0] == 0x80) { 37 | /* Nop */ 38 | ptr++; bytes--; 39 | continue; 40 | } 41 | 42 | /* Run */ 43 | if (bytes < 2) 44 | return ptr - buf; 45 | 46 | for (n = 257 - ptr[0]; n > 0; n--) { 47 | if (state->x >= state->bytes) { 48 | /* state->errcode = IMAGING_CODEC_OVERRUN; */ 49 | break; 50 | } 51 | state->buffer[state->x++] = ptr[1]; 52 | } 53 | 54 | ptr += 2; bytes -= 2; 55 | 56 | } else { 57 | 58 | /* Literal */ 59 | n = ptr[0]+2; 60 | 61 | if (bytes < n) 62 | return ptr - buf; 63 | 64 | for (i = 1; i < n; i++) { 65 | if (state->x >= state->bytes) { 66 | /* state->errcode = IMAGING_CODEC_OVERRUN; */ 67 | break; 68 | } 69 | state->buffer[state->x++] = ptr[i]; 70 | } 71 | 72 | ptr += n; bytes -= n; 73 | 74 | } 75 | 76 | if (state->x >= state->bytes) { 77 | 78 | /* Got a full line, unpack it */ 79 | state->shuffle((UINT8*) im->image[state->y + state->yoff] + 80 | state->xoff * im->pixelsize, state->buffer, 81 | state->xsize); 82 | 83 | state->x = 0; 84 | 85 | if (++state->y >= state->ysize) { 86 | /* End of file (errcode = 0) */ 87 | return -1; 88 | } 89 | } 90 | 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/MatlabFiles/Explicit/GlobVar.m: -------------------------------------------------------------------------------- 1 | %Made by J.T.B. Overvelde on 9 may 2011 2 | 3 | function [e22ct,stepSize]=GlobVar(c,routine) 4 | 5 | GlobPar 6 | 7 | %constants 8 | np=60; 9 | phi=0.5; 10 | wMin=0.15; 11 | maxIncr=1; 12 | maxNumIncr=500; 13 | 14 | GridSpaceX=1; 15 | GridSpaceY=1; 16 | sizeMesh=0.05*min([GridSpaceX,GridSpaceY]); %1,2,3 17 | mo='noGUI'; 18 | 19 | %default values (if not used in routine) 20 | numModes=1; 21 | numHolesX=1; 22 | numHolesY=1; 23 | stepSize=1; 24 | stepSize=1; 25 | imperf=1; 26 | saveData=1; 27 | saveFig=1; 28 | saveMov=1; 29 | 30 | %material constants 31 | E=1.0; 32 | v=0.499; 33 | muVar=E/(2.0*(1.0+v)); 34 | K=E/(3.0*(1.0-2.0*v)); 35 | %muVar=1.08e6; 36 | %K=2.0e9; 37 | rho=1.05e3; 38 | 39 | if or(routine==3,routine==4) 40 | cd('./ConstFiles'); 41 | load(['ConstPeriodic_',num2str(phi*100)],'c1m','c2m','e22c') 42 | cd('../'); 43 | e22ct=interp2(c1m,c2m,e22c',c(1),c(2)); 44 | else 45 | e22ct=0; 46 | end 47 | if routine==4 48 | cd('./ConstFiles'); 49 | load(['eContact_',num2str(wMin*100),'_',num2str(phi*100)],'c1m','c2m','eContact') 50 | cd('../'); 51 | eContactt=interp2(c1m,c2m,eContact,c(1),c(2)); 52 | else 53 | eContactt=0; 54 | end 55 | 56 | if routine==1 %Per 57 | numModes=1; 58 | numHolesX=1; 59 | numHolesY=1; 60 | stepSize=0.01; 61 | saveData=0; 62 | elseif routine==2 %Ell 63 | numHolesX=1; 64 | numHolesY=1; 65 | stepSize=0.01; 66 | saveData=0; 67 | elseif routine==3 %Pois 68 | numHolesX=2; 69 | numHolesY=2; 70 | stepSize=-e22ct+0.3; 71 | imperf=0.1; 72 | saveData=1; 73 | saveFig=0; 74 | saveMov=0; 75 | elseif routine==4 %Band 76 | numModes=140; %if different then 60, change MainBruteBand 77 | numHolesX=2; 78 | numHolesY=2; 79 | stepSize=0; 80 | saveData=0; 81 | imperf=0.00; 82 | elseif routine==5 %KInit 83 | numHolesX=1; 84 | numHolesY=1; 85 | saveData=0; 86 | end 87 | 88 | -------------------------------------------------------------------------------- /Kernel Scripts/Python Example Script/AbaqusFiles/Pois-Eval.py: -------------------------------------------------------------------------------- 1 | #Made by J.T.B. Overvelde on 9 may 2011 2 | 3 | rep=0 4 | while os.path.exists(tDr+'/'+jobName2+'.lck')==True: 5 | time.sleep(1) 6 | rep=rep+1 7 | if rep>30: 8 | break 9 | 10 | odb = openOdb(path=tDr+'/'+jobName2+'.odb') 11 | 12 | #calculate poisson ratio 13 | text_file = open("Output-PoisAll.txt", "w") 14 | nFrames=len(odb.steps[stepName2].frames) 15 | for i in range(1,nFrames): 16 | lastFrame = odb.steps[stepName2].frames[i] 17 | displacement=lastFrame.fieldOutputs['U'] 18 | RForce=lastFrame.fieldOutputs['RF'] 19 | regS1 = odb.rootAssembly.instances[instRefName1].nodeSets['VIRTUAL1'] 20 | regS2 = odb.rootAssembly.instances[instRefName2].nodeSets['VIRTUAL2'] 21 | eps11 = displacement.getSubset(region=regS1).values[0].data[0]/(GridSpaceX*numHolesX) 22 | eps22 = displacement.getSubset(region=regS2).values[0].data[1]/(GridSpaceY*numHolesY) 23 | delta22 = displacement.getSubset(region=regS2).values[0].data[1] 24 | F22 = RForce.getSubset(region=regS2).values[0].data[1] 25 | v=-eps11/eps22 26 | #write to text file 27 | text_file.write('%1.10f %1.10f %1.10f %1.10f %1.10f %1.10f\n' % (v,-eps22+ec,-eps22,F22/(GridSpaceX*numHolesX),F22,delta22)) 28 | text_file.close() 29 | 30 | odb.close() 31 | 32 | #save eigenvalues 33 | odb = openOdb(path=tDr+'/'+jobName1+'.odb') 34 | nFrames=len(odb.steps[stepName1].frames) 35 | text_file = open("Output-PoisMode.txt", "w") 36 | for i in range(1,nFrames): 37 | lastFrame = odb.steps[stepName1].frames[i] 38 | n=len(lastFrame.description) 39 | for j in range(9,15): 40 | try: 41 | Val=float(lastFrame.description[n-j:n]) 42 | except: pass 43 | text_file.write('%1.5f\n' % (Val/(numHolesY*GridSpaceY))) 44 | text_file.close() 45 | odb.close() 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/RawDecode.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library. 3 | * $Id$ 4 | * 5 | * decoder for raw (uncompressed) image data 6 | * 7 | * history: 8 | * 96-03-07 fl rewritten 9 | * 10 | * Copyright (c) Fredrik Lundh 1996. 11 | * Copyright (c) Secret Labs AB 1997. 12 | * 13 | * See the README file for information on usage and redistribution. 14 | */ 15 | 16 | 17 | #include "Imaging.h" 18 | 19 | #include "Raw.h" 20 | 21 | 22 | int 23 | ImagingRawDecode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes) 24 | { 25 | enum { LINE = 1, SKIP }; 26 | RAWSTATE* rawstate = state->context; 27 | 28 | UINT8* ptr; 29 | 30 | if (state->state == 0) { 31 | 32 | /* Initialize context variables */ 33 | 34 | /* get size of image data and padding */ 35 | state->bytes = (state->xsize * state->bits + 7) / 8; 36 | rawstate->skip = (rawstate->stride) ? 37 | rawstate->stride - state->bytes : 0; 38 | 39 | /* check image orientation */ 40 | if (state->ystep < 0) { 41 | state->y = state->ysize-1; 42 | state->ystep = -1; 43 | } else 44 | state->ystep = 1; 45 | 46 | state->state = LINE; 47 | 48 | } 49 | 50 | ptr = buf; 51 | 52 | for (;;) { 53 | 54 | if (state->state == SKIP) { 55 | 56 | /* Skip padding between lines */ 57 | 58 | if (bytes < rawstate->skip) 59 | return ptr - buf; 60 | 61 | ptr += rawstate->skip; 62 | bytes -= rawstate->skip; 63 | 64 | state->state = LINE; 65 | 66 | } 67 | 68 | if (bytes < state->bytes) 69 | return ptr - buf; 70 | 71 | /* Unpack data */ 72 | state->shuffle((UINT8*) im->image[state->y + state->yoff] + 73 | state->xoff * im->pixelsize, ptr, state->xsize); 74 | 75 | ptr += state->bytes; 76 | bytes -= state->bytes; 77 | 78 | state->y += state->ystep; 79 | 80 | if (state->y < 0 || state->y >= state->ysize) { 81 | /* End of file (errcode = 0) */ 82 | return -1; 83 | } 84 | 85 | state->state = SKIP; 86 | 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/PIL/FitsStubImagePlugin.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library 3 | # $Id$ 4 | # 5 | # FITS stub adapter 6 | # 7 | # Copyright (c) 1998-2003 by Fredrik Lundh 8 | # 9 | # See the README file for information on usage and redistribution. 10 | # 11 | 12 | import Image, ImageFile 13 | 14 | _handler = None 15 | 16 | ## 17 | # Install application-specific FITS image handler. 18 | # 19 | # @param handler Handler object. 20 | 21 | def register_handler(handler): 22 | global _handler 23 | _handler = handler 24 | 25 | # -------------------------------------------------------------------- 26 | # Image adapter 27 | 28 | def _accept(prefix): 29 | return prefix[:6] == "SIMPLE" 30 | 31 | class FITSStubImageFile(ImageFile.StubImageFile): 32 | 33 | format = "FITS" 34 | format_description = "FITS" 35 | 36 | def _open(self): 37 | 38 | offset = self.fp.tell() 39 | 40 | if not _accept(self.fp.read(6)): 41 | raise SyntaxError("Not a FITS file") 42 | 43 | # FIXME: add more sanity checks here; mandatory header items 44 | # include SIMPLE, BITPIX, NAXIS, etc. 45 | 46 | self.fp.seek(offset) 47 | 48 | # make something up 49 | self.mode = "F" 50 | self.size = 1, 1 51 | 52 | loader = self._load() 53 | if loader: 54 | loader.open(self) 55 | 56 | def _load(self): 57 | return _handler 58 | 59 | 60 | def _save(im, fp, filename): 61 | if _handler is None or not hasattr("_handler", "save"): 62 | raise IOError("FITS save handler not installed") 63 | _handler.save(im, fp, filename) 64 | 65 | 66 | # -------------------------------------------------------------------- 67 | # Registry 68 | 69 | Image.register_open(FITSStubImageFile.format, FITSStubImageFile, _accept) 70 | Image.register_save(FITSStubImageFile.format, _save) 71 | 72 | Image.register_extension(FITSStubImageFile.format, ".fit") 73 | Image.register_extension(FITSStubImageFile.format, ".fits") 74 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Scripts/thresholder.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library 3 | # $Id$ 4 | # 5 | # this demo script illustrates how a 1-bit BitmapImage can be used 6 | # as a dynamically updated overlay 7 | # 8 | 9 | from Tkinter import * 10 | from PIL import Image, ImageTk 11 | import sys 12 | 13 | # 14 | # an image viewer 15 | 16 | class UI(Frame): 17 | def __init__(self, master, im, value = 128): 18 | Frame.__init__(self, master) 19 | 20 | self.image = im 21 | self.value = value 22 | 23 | self.canvas = Canvas(self, width=im.size[0], height=im.size[1]) 24 | self.backdrop = ImageTk.PhotoImage(im) 25 | self.canvas.create_image(0, 0, image=self.backdrop, anchor=NW) 26 | self.canvas.pack() 27 | 28 | scale = Scale(self, orient=HORIZONTAL, from_=0, to=255, 29 | resolution=1, command=self.update, length=256) 30 | scale.set(value) 31 | scale.bind("", self.redraw) 32 | scale.pack() 33 | 34 | # uncomment the following line for instant feedback (might 35 | # be too slow on some platforms) 36 | # self.redraw() 37 | 38 | def update(self, value): 39 | self.value = eval(value) 40 | 41 | self.redraw() 42 | 43 | def redraw(self, event = None): 44 | 45 | # create overlay (note the explicit conversion to mode "1") 46 | im = self.image.point(lambda v,t=self.value: v>=t, "1") 47 | self.overlay = ImageTk.BitmapImage(im, foreground="green") 48 | 49 | # update canvas 50 | self.canvas.delete("overlay") 51 | self.canvas.create_image(0, 0, image=self.overlay, anchor=NW, 52 | tags="overlay") 53 | 54 | # -------------------------------------------------------------------- 55 | # main 56 | 57 | root = Tk() 58 | 59 | im = Image.open(sys.argv[1]) 60 | 61 | if im.mode != "L": 62 | im = im.convert("L") 63 | 64 | # im.thumbnail((320,200)) 65 | 66 | UI(root, im).pack() 67 | 68 | root.mainloop() 69 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/PIL/PixarImagePlugin.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library. 3 | # $Id$ 4 | # 5 | # PIXAR raster support for PIL 6 | # 7 | # history: 8 | # 97-01-29 fl Created 9 | # 10 | # notes: 11 | # This is incomplete; it is based on a few samples created with 12 | # Photoshop 2.5 and 3.0, and a summary description provided by 13 | # Greg Coats . Hopefully, "L" and 14 | # "RGBA" support will be added in future versions. 15 | # 16 | # Copyright (c) Secret Labs AB 1997. 17 | # Copyright (c) Fredrik Lundh 1997. 18 | # 19 | # See the README file for information on usage and redistribution. 20 | # 21 | 22 | __version__ = "0.1" 23 | 24 | import Image, ImageFile 25 | 26 | # 27 | # helpers 28 | 29 | def i16(c): 30 | return ord(c[0]) + (ord(c[1])<<8) 31 | 32 | def i32(c): 33 | return ord(c[0]) + (ord(c[1])<<8) + (ord(c[2])<<16) + (ord(c[3])<<24) 34 | 35 | ## 36 | # Image plugin for PIXAR raster images. 37 | 38 | class PixarImageFile(ImageFile.ImageFile): 39 | 40 | format = "PIXAR" 41 | format_description = "PIXAR raster image" 42 | 43 | def _open(self): 44 | 45 | # assuming a 4-byte magic label (FIXME: add "_accept" hook) 46 | s = self.fp.read(4) 47 | if s != "\200\350\000\000": 48 | raise SyntaxError, "not a PIXAR file" 49 | 50 | # read rest of header 51 | s = s + self.fp.read(508) 52 | 53 | self.size = i16(s[418:420]), i16(s[416:418]) 54 | 55 | # get channel/depth descriptions 56 | mode = i16(s[424:426]), i16(s[426:428]) 57 | 58 | if mode == (14, 2): 59 | self.mode = "RGB" 60 | # FIXME: to be continued... 61 | 62 | # create tile descriptor (assuming "dumped") 63 | self.tile = [("raw", (0,0)+self.size, 1024, (self.mode, 0, 1))] 64 | 65 | # 66 | # -------------------------------------------------------------------- 67 | 68 | Image.register_open("PIXAR", PixarImageFile) 69 | 70 | # 71 | # FIXME: what's the standard extension? 72 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/Matrix.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library 3 | * $Id$ 4 | * 5 | * colour and luminance matrix transforms 6 | * 7 | * history: 8 | * 1996-05-18 fl: created (brute force implementation) 9 | * 10 | * Copyright (c) Fredrik Lundh 1996. 11 | * Copyright (c) Secret Labs AB 1997. 12 | * 13 | * See the README file for information on usage and redistribution. 14 | */ 15 | 16 | 17 | #include "Imaging.h" 18 | 19 | 20 | #define CLIPF(v) ((v <= 0.0) ? 0 : (v >= 255.0F) ? 255 : (UINT8) v) 21 | 22 | 23 | Imaging 24 | ImagingConvertMatrix(Imaging im, const char *mode, float m[]) 25 | { 26 | Imaging imOut; 27 | int x, y; 28 | 29 | /* Assume there's enough data in the buffer */ 30 | if (!im) 31 | return (Imaging) ImagingError_ModeError(); 32 | 33 | if (strcmp(mode, "L") == 0 && im->bands == 3) { 34 | 35 | imOut = ImagingNew("L", im->xsize, im->ysize); 36 | if (!imOut) 37 | return NULL; 38 | 39 | for (y = 0; y < im->ysize; y++) { 40 | UINT8* in = (UINT8*) im->image[y]; 41 | UINT8* out = (UINT8*) imOut->image[y]; 42 | 43 | for (x = 0; x < im->xsize; x++) { 44 | float v = m[0]*in[0] + m[1]*in[1] + m[2]*in[2] + m[3] + 0.5; 45 | out[x] = CLIPF(v); 46 | in += 4; 47 | } 48 | } 49 | 50 | } else if (strlen(mode) == 3 && im->bands == 3) { 51 | 52 | imOut = ImagingNew(mode, im->xsize, im->ysize); 53 | if (!imOut) 54 | return NULL; 55 | 56 | for (y = 0; y < im->ysize; y++) { 57 | UINT8* in = (UINT8*) im->image[y]; 58 | UINT8* out = (UINT8*) imOut->image[y]; 59 | 60 | for (x = 0; x < im->xsize; x++) { 61 | float v0 = m[0]*in[0] + m[1]*in[1] + m[2]*in[2] + m[3] + 0.5; 62 | float v1 = m[4]*in[0] + m[5]*in[1] + m[6]*in[2] + m[7] + 0.5; 63 | float v2 = m[8]*in[0] + m[9]*in[1] + m[10]*in[2] + m[11] + 0.5; 64 | out[0] = CLIPF(v0); 65 | out[1] = CLIPF(v1); 66 | out[2] = CLIPF(v2); 67 | in += 4; out += 4; 68 | } 69 | } 70 | } else 71 | return (Imaging) ImagingError_ModeError(); 72 | 73 | return imOut; 74 | } 75 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/PIL/McIdasImagePlugin.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library. 3 | # $Id$ 4 | # 5 | # Basic McIdas support for PIL 6 | # 7 | # History: 8 | # 1997-05-05 fl Created (8-bit images only) 9 | # 2009-03-08 fl Added 16/32-bit support. 10 | # 11 | # Thanks to Richard Jones and Craig Swank for specs and samples. 12 | # 13 | # Copyright (c) Secret Labs AB 1997. 14 | # Copyright (c) Fredrik Lundh 1997. 15 | # 16 | # See the README file for information on usage and redistribution. 17 | # 18 | 19 | __version__ = "0.2" 20 | 21 | import struct 22 | import Image, ImageFile 23 | 24 | def _accept(s): 25 | return s[:8] == "\x00\x00\x00\x00\x00\x00\x00\x04" 26 | 27 | ## 28 | # Image plugin for McIdas area images. 29 | 30 | class McIdasImageFile(ImageFile.ImageFile): 31 | 32 | format = "MCIDAS" 33 | format_description = "McIdas area file" 34 | 35 | def _open(self): 36 | 37 | # parse area file directory 38 | s = self.fp.read(256) 39 | if not _accept(s) or len(s) != 256: 40 | raise SyntaxError("not an McIdas area file") 41 | 42 | self.area_descriptor_raw = s 43 | self.area_descriptor = w = [0] + list(struct.unpack("!64i", s)) 44 | 45 | # get mode 46 | if w[11] == 1: 47 | mode = rawmode = "L" 48 | elif w[11] == 2: 49 | # FIXME: add memory map support 50 | mode = "I"; rawmode = "I;16B" 51 | elif w[11] == 4: 52 | # FIXME: add memory map support 53 | mode = "I"; rawmode = "I;32B" 54 | else: 55 | raise SyntaxError("unsupported McIdas format") 56 | 57 | self.mode = mode 58 | self.size = w[10], w[9] 59 | 60 | offset = w[34] + w[15] 61 | stride = w[15] + w[10]*w[11]*w[14] 62 | 63 | self.tile = [("raw", (0, 0) + self.size, offset, (rawmode, stride, 1))] 64 | 65 | # -------------------------------------------------------------------- 66 | # registry 67 | 68 | Image.register_open("MCIDAS", McIdasImageFile, _accept) 69 | 70 | # no default extension 71 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/ImPlatform.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library 3 | * $Id$ 4 | * 5 | * platform declarations for the imaging core library 6 | * 7 | * Copyright (c) Fredrik Lundh 1995-2003. 8 | */ 9 | 10 | #include "Python.h" 11 | 12 | /* Check that we have an ANSI compliant compiler */ 13 | #ifndef HAVE_PROTOTYPES 14 | #error Sorry, this library requires support for ANSI prototypes. 15 | #endif 16 | #ifndef STDC_HEADERS 17 | #error Sorry, this library requires ANSI header files. 18 | #endif 19 | 20 | #if defined(_MSC_VER) 21 | #ifndef WIN32 22 | #define WIN32 23 | #endif 24 | /* VC++ 4.0 is a bit annoying when it comes to precision issues (like 25 | claiming that "float a = 0.0;" would lead to loss of precision). I 26 | don't like to see warnings from my code, but since I still want to 27 | keep it readable, I simply switch off a few warnings instead of adding 28 | the tons of casts that VC++ seem to require. This code is compiled 29 | with numerous other compilers as well, so any real errors are likely 30 | to be catched anyway. */ 31 | #pragma warning(disable: 4244) /* conversion from 'float' to 'int' */ 32 | #endif 33 | 34 | #if defined(_MSC_VER) 35 | #define inline __inline 36 | #elif !defined(USE_INLINE) 37 | #define inline 38 | #endif 39 | 40 | #if SIZEOF_SHORT == 2 41 | #define INT16 short 42 | #elif SIZEOF_INT == 2 43 | #define INT16 int 44 | #else 45 | #define INT16 short /* most things works just fine anyway... */ 46 | #endif 47 | 48 | #if SIZEOF_SHORT == 4 49 | #define INT32 short 50 | #elif SIZEOF_INT == 4 51 | #define INT32 int 52 | #elif SIZEOF_LONG == 4 53 | #define INT32 long 54 | #else 55 | #error Cannot find required 32-bit integer type 56 | #endif 57 | 58 | #if SIZEOF_LONG == 8 59 | #define INT64 long 60 | #elif SIZEOF_LONG_LONG == 8 61 | #define INT64 long 62 | #endif 63 | 64 | /* assume IEEE; tweak if necessary (patches are welcome) */ 65 | #define FLOAT32 float 66 | #define FLOAT64 double 67 | 68 | #define INT8 signed char 69 | #define UINT8 unsigned char 70 | 71 | #define UINT16 unsigned INT16 72 | #define UINT32 unsigned INT32 73 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/PIL/PcdImagePlugin.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library. 3 | # $Id$ 4 | # 5 | # PCD file handling 6 | # 7 | # History: 8 | # 96-05-10 fl Created 9 | # 96-05-27 fl Added draft mode (128x192, 256x384) 10 | # 11 | # Copyright (c) Secret Labs AB 1997. 12 | # Copyright (c) Fredrik Lundh 1996. 13 | # 14 | # See the README file for information on usage and redistribution. 15 | # 16 | 17 | 18 | __version__ = "0.1" 19 | 20 | 21 | import Image, ImageFile 22 | 23 | ## 24 | # Image plugin for PhotoCD images. This plugin only reads the 768x512 25 | # image from the file; higher resolutions are encoded in a proprietary 26 | # encoding. 27 | 28 | class PcdImageFile(ImageFile.ImageFile): 29 | 30 | format = "PCD" 31 | format_description = "Kodak PhotoCD" 32 | 33 | def _open(self): 34 | 35 | # rough 36 | self.fp.seek(2048) 37 | s = self.fp.read(2048) 38 | 39 | if s[:4] != "PCD_": 40 | raise SyntaxError, "not a PCD file" 41 | 42 | orientation = ord(s[1538]) & 3 43 | if orientation == 1: 44 | self.tile_post_rotate = 90 # hack 45 | elif orientation == 3: 46 | self.tile_post_rotate = -90 47 | 48 | self.mode = "RGB" 49 | self.size = 768, 512 # FIXME: not correct for rotated images! 50 | self.tile = [("pcd", (0,0)+self.size, 96*2048, None)] 51 | 52 | def draft(self, mode, size): 53 | 54 | if len(self.tile) != 1: 55 | return 56 | 57 | d, e, o, a = self.tile[0] 58 | 59 | if size: 60 | scale = max(self.size[0] / size[0], self.size[1] / size[1]) 61 | for s, o in [(4,0*2048), (2,0*2048), (1,96*2048)]: 62 | if scale >= s: 63 | break 64 | # e = e[0], e[1], (e[2]-e[0]+s-1)/s+e[0], (e[3]-e[1]+s-1)/s+e[1] 65 | # self.size = ((self.size[0]+s-1)/s, (self.size[1]+s-1)/s) 66 | 67 | self.tile = [(d, e, o, a)] 68 | 69 | return self 70 | 71 | # 72 | # registry 73 | 74 | Image.register_open("PCD", PcdImageFile) 75 | 76 | Image.register_extension("PCD", ".pcd") 77 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/PIL/XVThumbImagePlugin.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library. 3 | # $Id$ 4 | # 5 | # XV Thumbnail file handler by Charles E. "Gene" Cash 6 | # (gcash@magicnet.net) 7 | # 8 | # see xvcolor.c and xvbrowse.c in the sources to John Bradley's XV, 9 | # available from ftp://ftp.cis.upenn.edu/pub/xv/ 10 | # 11 | # history: 12 | # 98-08-15 cec created (b/w only) 13 | # 98-12-09 cec added color palette 14 | # 98-12-28 fl added to PIL (with only a few very minor modifications) 15 | # 16 | # To do: 17 | # FIXME: make save work (this requires quantization support) 18 | # 19 | 20 | __version__ = "0.1" 21 | 22 | import string 23 | import Image, ImageFile, ImagePalette 24 | 25 | # standard color palette for thumbnails (RGB332) 26 | PALETTE = "" 27 | for r in range(8): 28 | for g in range(8): 29 | for b in range(4): 30 | PALETTE = PALETTE + (chr((r*255)/7)+chr((g*255)/7)+chr((b*255)/3)) 31 | 32 | ## 33 | # Image plugin for XV thumbnail images. 34 | 35 | class XVThumbImageFile(ImageFile.ImageFile): 36 | 37 | format = "XVThumb" 38 | format_description = "XV thumbnail image" 39 | 40 | def _open(self): 41 | 42 | # check magic 43 | s = self.fp.read(6) 44 | if s != "P7 332": 45 | raise SyntaxError, "not an XV thumbnail file" 46 | 47 | # Skip to beginning of next line 48 | self.fp.readline() 49 | 50 | # skip info comments 51 | while 1: 52 | s = self.fp.readline() 53 | if not s: 54 | raise SyntaxError, "Unexpected EOF reading XV thumbnail file" 55 | if s[0] != '#': 56 | break 57 | 58 | # parse header line (already read) 59 | s = string.split(s.strip()) 60 | 61 | self.mode = "P" 62 | self.size = int(s[0]), int(s[1]) 63 | 64 | self.palette = ImagePalette.raw("RGB", PALETTE) 65 | 66 | self.tile = [ 67 | ("raw", (0, 0)+self.size, 68 | self.fp.tell(), (self.mode, 0, 1) 69 | )] 70 | 71 | # -------------------------------------------------------------------- 72 | 73 | Image.register_open("XVThumb", XVThumbImageFile) 74 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.OleFileIO.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.OleFileIO Module 6 | 7 | 8 | 9 |

The PIL.OleFileIO Module

10 |
11 |
OleFileIO(filename=None) (class) [#]
12 |
13 |

This class encapsulates the interface to an OLE 2 structured 14 | storage file.

15 |

For more information about this class, see The OleFileIO Class.

16 |
17 |
18 |

The OleFileIO Class

19 |
20 |
OleFileIO(filename=None) (class) [#]
21 |
22 |

This class encapsulates the interface to an OLE 2 structured 23 | storage file. Use the listdir and openstream 24 | methods to access the contents of this file. 25 |

26 |
getproperties(filename) [#]
27 |
28 |
29 |
listdir() [#]
30 |
31 |
32 |
open(filename) [#]
33 |
34 |
35 |
openstream(filename) [#]
36 |
37 |
38 |
39 | 40 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/PIL/MpegImagePlugin.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library. 3 | # $Id$ 4 | # 5 | # MPEG file handling 6 | # 7 | # History: 8 | # 95-09-09 fl Created 9 | # 10 | # Copyright (c) Secret Labs AB 1997. 11 | # Copyright (c) Fredrik Lundh 1995. 12 | # 13 | # See the README file for information on usage and redistribution. 14 | # 15 | 16 | __version__ = "0.1" 17 | 18 | import Image, ImageFile 19 | 20 | # 21 | # Bitstream parser 22 | 23 | class BitStream: 24 | 25 | def __init__(self, fp): 26 | self.fp = fp 27 | self.bits = 0 28 | self.bitbuffer = 0 29 | 30 | def next(self): 31 | return ord(self.fp.read(1)) 32 | 33 | def peek(self, bits): 34 | while self.bits < bits: 35 | c = self.next() 36 | if c < 0: 37 | self.bits = 0 38 | continue 39 | self.bitbuffer = (self.bitbuffer << 8) + c 40 | self.bits = self.bits + 8 41 | return self.bitbuffer >> (self.bits - bits) & (1L << bits) - 1 42 | 43 | def skip(self, bits): 44 | while self.bits < bits: 45 | self.bitbuffer = (self.bitbuffer << 8) + ord(self.fp.read(1)) 46 | self.bits = self.bits + 8 47 | self.bits = self.bits - bits 48 | 49 | def read(self, bits): 50 | v = self.peek(bits) 51 | self.bits = self.bits - bits 52 | return v 53 | 54 | ## 55 | # Image plugin for MPEG streams. This plugin can identify a stream, 56 | # but it cannot read it. 57 | 58 | class MpegImageFile(ImageFile.ImageFile): 59 | 60 | format = "MPEG" 61 | format_description = "MPEG" 62 | 63 | def _open(self): 64 | 65 | s = BitStream(self.fp) 66 | 67 | if s.read(32) != 0x1B3: 68 | raise SyntaxError, "not an MPEG file" 69 | 70 | self.mode = "RGB" 71 | self.size = s.read(12), s.read(12) 72 | 73 | 74 | # -------------------------------------------------------------------- 75 | # Registry stuff 76 | 77 | Image.register_open("MPEG", MpegImageFile) 78 | 79 | Image.register_extension("MPEG", ".mpg") 80 | Image.register_extension("MPEG", ".mpeg") 81 | 82 | Image.register_mime("MPEG", "video/mpeg") 83 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/PIL/ImageGrab.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library 3 | # $Id$ 4 | # 5 | # screen grabber (windows only) 6 | # 7 | # History: 8 | # 2001-04-26 fl created 9 | # 2001-09-17 fl use builtin driver, if present 10 | # 2002-11-19 fl added grabclipboard support 11 | # 12 | # Copyright (c) 2001-2002 by Secret Labs AB 13 | # Copyright (c) 2001-2002 by Fredrik Lundh 14 | # 15 | # See the README file for information on usage and redistribution. 16 | # 17 | 18 | import Image 19 | 20 | ## 21 | # (New in 1.1.3) The ImageGrab module can be used to copy 22 | # the contents of the screen to a PIL image memory. 23 | #

24 | # The current version works on Windows only.

25 | # 26 | # @since 1.1.3 27 | ## 28 | 29 | try: 30 | # built-in driver (1.1.3 and later) 31 | grabber = Image.core.grabscreen 32 | except AttributeError: 33 | # stand-alone driver (pil plus) 34 | import _grabscreen 35 | grabber = _grabscreen.grab 36 | 37 | ## 38 | # (New in 1.1.3) Take a snapshot of the screen. The pixels inside the 39 | # bounding box are returned as an "RGB" image. If the bounding box is 40 | # omitted, the entire screen is copied. 41 | # 42 | # @param bbox What region to copy. Default is the entire screen. 43 | # @return An image 44 | # @since 1.1.3 45 | 46 | def grab(bbox=None): 47 | size, data = grabber() 48 | im = Image.fromstring( 49 | "RGB", size, data, 50 | # RGB, 32-bit line padding, origo in lower left corner 51 | "raw", "BGR", (size[0]*3 + 3) & -4, -1 52 | ) 53 | if bbox: 54 | im = im.crop(bbox) 55 | return im 56 | 57 | ## 58 | # (New in 1.1.4) Take a snapshot of the clipboard image, if any. 59 | # 60 | # @return An image, a list of filenames, or None if the clipboard does 61 | # not contain image data or filenames. Note that if a list is 62 | # returned, the filenames may not represent image files. 63 | # @since 1.1.4 64 | 65 | def grabclipboard(): 66 | debug = 0 # temporary interface 67 | data = Image.core.grabclipboard(debug) 68 | if Image.isStringType(data): 69 | import BmpImagePlugin, StringIO 70 | return BmpImagePlugin.DibImageFile(StringIO.StringIO(data)) 71 | return data 72 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/PIL/DcxImagePlugin.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library. 3 | # $Id$ 4 | # 5 | # DCX file handling 6 | # 7 | # DCX is a container file format defined by Intel, commonly used 8 | # for fax applications. Each DCX file consists of a directory 9 | # (a list of file offsets) followed by a set of (usually 1-bit) 10 | # PCX files. 11 | # 12 | # History: 13 | # 1995-09-09 fl Created 14 | # 1996-03-20 fl Properly derived from PcxImageFile. 15 | # 1998-07-15 fl Renamed offset attribute to avoid name clash 16 | # 2002-07-30 fl Fixed file handling 17 | # 18 | # Copyright (c) 1997-98 by Secret Labs AB. 19 | # Copyright (c) 1995-96 by Fredrik Lundh. 20 | # 21 | # See the README file for information on usage and redistribution. 22 | # 23 | 24 | __version__ = "0.2" 25 | 26 | import Image 27 | 28 | from PcxImagePlugin import PcxImageFile 29 | 30 | MAGIC = 0x3ADE68B1 # QUIZ: what's this value, then? 31 | 32 | def i32(c): 33 | return ord(c[0]) + (ord(c[1])<<8) + (ord(c[2])<<16) + (ord(c[3])<<24) 34 | 35 | def _accept(prefix): 36 | return i32(prefix) == MAGIC 37 | 38 | ## 39 | # Image plugin for the Intel DCX format. 40 | 41 | class DcxImageFile(PcxImageFile): 42 | 43 | format = "DCX" 44 | format_description = "Intel DCX" 45 | 46 | def _open(self): 47 | 48 | # Header 49 | s = self.fp.read(4) 50 | if i32(s) != MAGIC: 51 | raise SyntaxError, "not a DCX file" 52 | 53 | # Component directory 54 | self._offset = [] 55 | for i in range(1024): 56 | offset = i32(self.fp.read(4)) 57 | if not offset: 58 | break 59 | self._offset.append(offset) 60 | 61 | self.__fp = self.fp 62 | self.seek(0) 63 | 64 | def seek(self, frame): 65 | if frame >= len(self._offset): 66 | raise EOFError("attempt to seek outside DCX directory") 67 | self.frame = frame 68 | self.fp = self.__fp 69 | self.fp.seek(self._offset[frame]) 70 | PcxImageFile._open(self) 71 | 72 | def tell(self): 73 | return self.frame 74 | 75 | 76 | Image.register_open("DCX", DcxImageFile, _accept) 77 | 78 | Image.register_extension("DCX", ".dcx") 79 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Docs/pythondoc-PIL.ImagePath.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The PIL.ImagePath Module 6 | 7 | 8 | 9 |

The PIL.ImagePath Module

10 |
11 |
Path(xy) (class) [#]
12 |
13 |

Path wrapper.

14 |

For more information about this class, see The Path Class.

15 |
16 |
17 |

The Path Class

18 |
19 |
Path(xy) (class) [#]
20 |
21 |
22 |
__init__(xy) [#]
23 |
24 |
25 |
xy
26 |
27 |
28 |

29 |
30 |
compact(distance=2) [#]
31 |
32 |
33 |
getbbox() [#]
34 |
35 |
36 |
map(function) [#]
37 |
38 |
39 |
tolist(flat=0) [#]
40 |
41 |
42 |
flat
43 |
44 |
45 |
Returns:
46 |
47 |
48 |

49 |
50 |
transform(matrix) [#]
51 |
52 |
53 |
54 | 55 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/Scripts/painter.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library 3 | # $Id$ 4 | # 5 | # this demo script illustrates pasting into an already displayed 6 | # photoimage. note that the current version of Tk updates the whole 7 | # image everytime we paste, so to get decent performance, we split 8 | # the image into a set of tiles. 9 | # 10 | 11 | from Tkinter import * 12 | from PIL import Image, ImageTk 13 | import sys 14 | 15 | # 16 | # painter widget 17 | 18 | class PaintCanvas(Canvas): 19 | def __init__(self, master, image): 20 | Canvas.__init__(self, master, width=image.size[0], height=image.size[1]) 21 | 22 | # fill the canvas 23 | self.tile = {} 24 | self.tilesize = tilesize = 32 25 | xsize, ysize = image.size 26 | for x in range(0, xsize, tilesize): 27 | for y in range(0, ysize, tilesize): 28 | box = x, y, min(xsize, x+tilesize), min(ysize, y+tilesize) 29 | tile = ImageTk.PhotoImage(image.crop(box)) 30 | self.create_image(x, y, image=tile, anchor=NW) 31 | self.tile[(x,y)] = box, tile 32 | 33 | self.image = image 34 | 35 | self.bind("", self.paint) 36 | 37 | def paint(self, event): 38 | xy = event.x - 10, event.y - 10, event.x + 10, event.y + 10 39 | im = self.image.crop(xy) 40 | 41 | # process the image in some fashion 42 | im = im.convert("L") 43 | 44 | self.image.paste(im, xy) 45 | self.repair(xy) 46 | 47 | def repair(self, box): 48 | # update canvas 49 | dx = box[0] % self.tilesize 50 | dy = box[1] % self.tilesize 51 | for x in range(box[0]-dx, box[2]+1, self.tilesize): 52 | for y in range(box[1]-dy, box[3]+1, self.tilesize): 53 | try: 54 | xy, tile = self.tile[(x, y)] 55 | tile.paste(self.image.crop(xy)) 56 | except KeyError: 57 | pass # outside the image 58 | self.update_idletasks() 59 | 60 | # 61 | # main 62 | 63 | root = Tk() 64 | 65 | im = Image.open(sys.argv[1]) 66 | 67 | if im.mode != "RGB": 68 | im = im.convert("RGB") 69 | 70 | PaintCanvas(root, im).pack() 71 | 72 | root.mainloop() 73 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/RawEncode.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library. 3 | * $Id$ 4 | * 5 | * coder for raw data 6 | * 7 | * FIXME: This encoder will fail if the buffer is not large enough to 8 | * hold one full line of data. There's a workaround for this problem 9 | * in ImageFile.py, but it should be solved here instead. 10 | * 11 | * history: 12 | * 96-04-30 fl created 13 | * 97-01-03 fl fixed padding 14 | * 15 | * Copyright (c) Fredrik Lundh 1996-97. 16 | * Copyright (c) Secret Labs AB 1997. 17 | * 18 | * See the README file for information on usage and redistribution. */ 19 | 20 | 21 | #include "Imaging.h" 22 | 23 | int 24 | ImagingRawEncode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes) 25 | { 26 | UINT8* ptr; 27 | 28 | if (!state->state) { 29 | 30 | /* The "count" field holds the stride, if specified. Fix 31 | things up so "bytes" is the full size, and "count" the 32 | packed size */ 33 | 34 | if (state->count > 0) { 35 | int bytes = state->count; 36 | 37 | /* stride must not be less than real size */ 38 | if (state->count < state->bytes) { 39 | state->errcode = IMAGING_CODEC_CONFIG; 40 | return -1; 41 | } 42 | state->count = state->bytes; 43 | state->bytes = bytes; 44 | } else 45 | state->count = state->bytes; 46 | 47 | /* The "ystep" field specifies the orientation */ 48 | 49 | if (state->ystep < 0) { 50 | state->y = state->ysize-1; 51 | state->ystep = -1; 52 | } else 53 | state->ystep = 1; 54 | 55 | state->state = 1; 56 | 57 | } 58 | 59 | if (bytes < state->bytes) { 60 | state->errcode = IMAGING_CODEC_CONFIG; 61 | return 0; 62 | } 63 | 64 | ptr = buf; 65 | 66 | while (bytes >= state->bytes) { 67 | 68 | state->shuffle(ptr, (UINT8*) im->image[state->y + state->yoff] + 69 | state->xoff * im->pixelsize, state->xsize); 70 | 71 | if (state->bytes > state->count) 72 | /* zero-pad the buffer, if necessary */ 73 | memset(ptr + state->count, 0, state->bytes - state->count); 74 | 75 | ptr += state->bytes; 76 | bytes -= state->bytes; 77 | 78 | state->y += state->ystep; 79 | 80 | if (state->y < 0 || state->y >= state->ysize) { 81 | state->errcode = IMAGING_CODEC_END; 82 | break; 83 | } 84 | 85 | } 86 | 87 | return ptr - buf; 88 | 89 | } 90 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/Blend.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library 3 | * $Id$ 4 | * 5 | * interpolate between two existing images 6 | * 7 | * history: 8 | * 96-03-20 fl Created 9 | * 96-05-18 fl Simplified blend expression 10 | * 96-10-05 fl Fixed expression bug, special case for interpolation 11 | * 12 | * Copyright (c) Fredrik Lundh 1996. 13 | * Copyright (c) Secret Labs AB 1997. 14 | * 15 | * See the README file for details on usage and redistribution. 16 | */ 17 | 18 | 19 | #include "Imaging.h" 20 | 21 | 22 | Imaging 23 | ImagingBlend(Imaging imIn1, Imaging imIn2, float alpha) 24 | { 25 | Imaging imOut; 26 | int x, y; 27 | 28 | /* Check arguments */ 29 | if (!imIn1 || !imIn2 || imIn1->type != IMAGING_TYPE_UINT8) 30 | return ImagingError_ModeError(); 31 | if (imIn1->type != imIn2->type || 32 | imIn1->bands != imIn2->bands || 33 | imIn1->xsize != imIn2->xsize || 34 | imIn1->ysize != imIn2->ysize) 35 | return ImagingError_Mismatch(); 36 | 37 | /* Shortcuts */ 38 | if (alpha == 0.0) 39 | return ImagingCopy(imIn1); 40 | else if (alpha == 1.0) 41 | return ImagingCopy(imIn2); 42 | 43 | imOut = ImagingNew(imIn1->mode, imIn1->xsize, imIn1->ysize); 44 | if (!imOut) 45 | return NULL; 46 | 47 | ImagingCopyInfo(imOut, imIn1); 48 | 49 | if (alpha >= 0 && alpha <= 1.0) { 50 | /* Interpolate between bands */ 51 | for (y = 0; y < imIn1->ysize; y++) { 52 | UINT8* in1 = (UINT8*) imIn1->image[y]; 53 | UINT8* in2 = (UINT8*) imIn2->image[y]; 54 | UINT8* out = (UINT8*) imOut->image[y]; 55 | for (x = 0; x < imIn1->linesize; x++) 56 | out[x] = (UINT8) 57 | ((int) in1[x] + alpha * ((int) in2[x] - (int) in1[x])); 58 | } 59 | } else { 60 | /* Extrapolation; must make sure to clip resulting values */ 61 | for (y = 0; y < imIn1->ysize; y++) { 62 | UINT8* in1 = (UINT8*) imIn1->image[y]; 63 | UINT8* in2 = (UINT8*) imIn2->image[y]; 64 | UINT8* out = (UINT8*) imOut->image[y]; 65 | for (x = 0; x < imIn1->linesize; x++) { 66 | float temp = (float) 67 | ((int) in1[x] + alpha * ((int) in2[x] - (int) in1[x])); 68 | if (temp <= 0.0) 69 | out[x] = 0; 70 | else if (temp >= 255.0) 71 | out[x] = 255; 72 | else 73 | out[x] = (UINT8) temp; 74 | } 75 | } 76 | } 77 | 78 | return imOut; 79 | } 80 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/XbmEncode.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The Python Imaging Library. 3 | * $Id$ 4 | * 5 | * encoder for Xbm data 6 | * 7 | * history: 8 | * 96-11-01 fl created 9 | * 10 | * Copyright (c) Fredrik Lundh 1996. 11 | * Copyright (c) Secret Labs AB 1997. 12 | * 13 | * See the README file for information on usage and redistribution. 14 | */ 15 | 16 | 17 | #include "Imaging.h" 18 | 19 | 20 | int 21 | ImagingXbmEncode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes) 22 | { 23 | const char *hex = "0123456789abcdef"; 24 | 25 | UINT8* ptr = buf; 26 | int i, n; 27 | 28 | if (!state->state) { 29 | 30 | /* 8 pixels are stored in no more than 6 bytes */ 31 | state->bytes = 6*(state->xsize+7)/8; 32 | 33 | state->state = 1; 34 | 35 | } 36 | 37 | if (bytes < state->bytes) { 38 | state->errcode = IMAGING_CODEC_MEMORY; 39 | return 0; 40 | } 41 | 42 | ptr = buf; 43 | 44 | while (bytes >= state->bytes) { 45 | 46 | state->shuffle(state->buffer, 47 | (UINT8*) im->image[state->y + state->yoff] + 48 | state->xoff * im->pixelsize, state->xsize); 49 | 50 | if (state->y < state->ysize-1) { 51 | 52 | /* any line but the last */ 53 | for (n = 0; n < state->xsize; n += 8) { 54 | 55 | i = state->buffer[n/8]; 56 | 57 | *ptr++ = '0'; 58 | *ptr++ = 'x'; 59 | *ptr++ = hex[(i>>4)&15]; 60 | *ptr++ = hex[i&15]; 61 | *ptr++ = ','; 62 | bytes -= 5; 63 | 64 | if (++state->count >= 79/5) { 65 | *ptr++ = '\n'; 66 | bytes--; 67 | state->count = 0; 68 | } 69 | 70 | } 71 | 72 | state->y++; 73 | 74 | } else { 75 | 76 | /* last line */ 77 | for (n = 0; n < state->xsize; n += 8) { 78 | 79 | i = state->buffer[n/8]; 80 | 81 | *ptr++ = '0'; 82 | *ptr++ = 'x'; 83 | *ptr++ = hex[(i>>4)&15]; 84 | *ptr++ = hex[i&15]; 85 | 86 | if (n < state->xsize-8) { 87 | *ptr++ = ','; 88 | if (++state->count >= 79/5) { 89 | *ptr++ = '\n'; 90 | bytes--; 91 | state->count = 0; 92 | } 93 | } else 94 | *ptr++ = '\n'; 95 | 96 | bytes -= 5; 97 | 98 | } 99 | 100 | state->errcode = IMAGING_CODEC_END; 101 | break; 102 | } 103 | } 104 | 105 | return ptr - buf; 106 | } 107 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/PIL/IcoImagePlugin.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library. 3 | # $Id$ 4 | # 5 | # Windows Icon support for PIL 6 | # 7 | # Notes: 8 | # uses BmpImagePlugin.py to read the bitmap data. 9 | # 10 | # History: 11 | # 96-05-27 fl Created 12 | # 13 | # Copyright (c) Secret Labs AB 1997. 14 | # Copyright (c) Fredrik Lundh 1996. 15 | # 16 | # See the README file for information on usage and redistribution. 17 | # 18 | 19 | 20 | __version__ = "0.1" 21 | 22 | import Image, BmpImagePlugin 23 | 24 | 25 | # 26 | # -------------------------------------------------------------------- 27 | 28 | def i16(c): 29 | return ord(c[0]) + (ord(c[1])<<8) 30 | 31 | def i32(c): 32 | return ord(c[0]) + (ord(c[1])<<8) + (ord(c[2])<<16) + (ord(c[3])<<24) 33 | 34 | 35 | def _accept(prefix): 36 | return prefix[:4] == "\0\0\1\0" 37 | 38 | ## 39 | # Image plugin for Windows Icon files. 40 | 41 | class IcoImageFile(BmpImagePlugin.BmpImageFile): 42 | 43 | format = "ICO" 44 | format_description = "Windows Icon" 45 | 46 | def _open(self): 47 | 48 | # check magic 49 | s = self.fp.read(6) 50 | if not _accept(s): 51 | raise SyntaxError, "not an ICO file" 52 | 53 | # pick the largest icon in the file 54 | m = "" 55 | for i in range(i16(s[4:])): 56 | s = self.fp.read(16) 57 | if not m: 58 | m = s 59 | elif ord(s[0]) > ord(m[0]) and ord(s[1]) > ord(m[1]): 60 | m = s 61 | #print "width", ord(s[0]) 62 | #print "height", ord(s[1]) 63 | #print "colors", ord(s[2]) 64 | #print "reserved", ord(s[3]) 65 | #print "planes", i16(s[4:]) 66 | #print "bitcount", i16(s[6:]) 67 | #print "bytes", i32(s[8:]) 68 | #print "offset", i32(s[12:]) 69 | 70 | # load as bitmap 71 | self._bitmap(i32(m[12:])) 72 | 73 | # patch up the bitmap height 74 | self.size = self.size[0], self.size[1]/2 75 | d, e, o, a = self.tile[0] 76 | self.tile[0] = d, (0,0)+self.size, o, a 77 | 78 | return 79 | 80 | 81 | # 82 | # -------------------------------------------------------------------- 83 | 84 | Image.register_open("ICO", IcoImageFile, _accept) 85 | 86 | Image.register_extension("ICO", ".ico") 87 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/libImaging/SunRleDecode.c: -------------------------------------------------------------------------------- 1 | /* 2 | * THIS IS WORK IN PROGRESS 3 | * 4 | * The Python Imaging Library. 5 | * $Id$ 6 | * 7 | * decoder for SUN RLE data. 8 | * 9 | * history: 10 | * 97-01-04 fl Created 11 | * 12 | * Copyright (c) Fredrik Lundh 1997. 13 | * Copyright (c) Secret Labs AB 1997. 14 | * 15 | * See the README file for information on usage and redistribution. 16 | */ 17 | 18 | 19 | #include "Imaging.h" 20 | 21 | 22 | int 23 | ImagingSunRleDecode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes) 24 | { 25 | int n; 26 | UINT8* ptr; 27 | 28 | ptr = buf; 29 | 30 | for (;;) { 31 | 32 | if (bytes < 1) 33 | return ptr - buf; 34 | 35 | if (ptr[0] == 0x80) { 36 | 37 | if (bytes < 2) 38 | break; 39 | 40 | n = ptr[1]; 41 | 42 | if (n == 0) { 43 | 44 | /* Literal 0x80 (2 bytes) */ 45 | n = 1; 46 | 47 | state->buffer[state->x] = 0x80; 48 | 49 | ptr += 2; 50 | bytes -= 2; 51 | 52 | } else { 53 | 54 | /* Run (3 bytes) */ 55 | if (bytes < 3) 56 | break; 57 | 58 | if (state->x + n > state->bytes) { 59 | /* FIXME: is this correct? */ 60 | state->errcode = IMAGING_CODEC_OVERRUN; 61 | return -1; 62 | } 63 | 64 | memset(state->buffer + state->x, ptr[2], n); 65 | 66 | ptr += 3; 67 | bytes -= 3; 68 | 69 | } 70 | 71 | } else { 72 | 73 | /* Literal (1+n bytes block) */ 74 | n = ptr[0]; 75 | 76 | if (bytes < 1 + n) 77 | break; 78 | 79 | if (state->x + n > state->bytes) { 80 | /* FIXME: is this correct? */ 81 | state->errcode = IMAGING_CODEC_OVERRUN; 82 | return -1; 83 | } 84 | 85 | memcpy(state->buffer + state->x, ptr + 1, n); 86 | 87 | ptr += 1 + n; 88 | bytes -= 1 + n; 89 | 90 | } 91 | 92 | state->x += n; 93 | 94 | if (state->x >= state->bytes) { 95 | 96 | /* Got a full line, unpack it */ 97 | state->shuffle((UINT8*) im->image[state->y + state->yoff] + 98 | state->xoff * im->pixelsize, state->buffer, 99 | state->xsize); 100 | 101 | state->x = 0; 102 | 103 | if (++state->y >= state->ysize) { 104 | /* End of file (errcode = 0) */ 105 | return -1; 106 | } 107 | } 108 | 109 | } 110 | 111 | return ptr - buf; 112 | } 113 | -------------------------------------------------------------------------------- /Libraries/Imaging-1.1.7/PIL/CurImagePlugin.py: -------------------------------------------------------------------------------- 1 | # 2 | # The Python Imaging Library. 3 | # $Id$ 4 | # 5 | # Windows Cursor support for PIL 6 | # 7 | # notes: 8 | # uses BmpImagePlugin.py to read the bitmap data. 9 | # 10 | # history: 11 | # 96-05-27 fl Created 12 | # 13 | # Copyright (c) Secret Labs AB 1997. 14 | # Copyright (c) Fredrik Lundh 1996. 15 | # 16 | # See the README file for information on usage and redistribution. 17 | # 18 | 19 | 20 | __version__ = "0.1" 21 | 22 | import Image, BmpImagePlugin 23 | 24 | 25 | # 26 | # -------------------------------------------------------------------- 27 | 28 | def i16(c): 29 | return ord(c[0]) + (ord(c[1])<<8) 30 | 31 | def i32(c): 32 | return ord(c[0]) + (ord(c[1])<<8) + (ord(c[2])<<16) + (ord(c[3])<<24) 33 | 34 | 35 | def _accept(prefix): 36 | return prefix[:4] == "\0\0\2\0" 37 | 38 | ## 39 | # Image plugin for Windows Cursor files. 40 | 41 | class CurImageFile(BmpImagePlugin.BmpImageFile): 42 | 43 | format = "CUR" 44 | format_description = "Windows Cursor" 45 | 46 | def _open(self): 47 | 48 | offset = self.fp.tell() 49 | 50 | # check magic 51 | s = self.fp.read(6) 52 | if not _accept(s): 53 | raise SyntaxError, "not an CUR file" 54 | 55 | # pick the largest cursor in the file 56 | m = "" 57 | for i in range(i16(s[4:])): 58 | s = self.fp.read(16) 59 | if not m: 60 | m = s 61 | elif ord(s[0]) > ord(m[0]) and ord(s[1]) > ord(m[1]): 62 | m = s 63 | #print "width", ord(s[0]) 64 | #print "height", ord(s[1]) 65 | #print "colors", ord(s[2]) 66 | #print "reserved", ord(s[3]) 67 | #print "hotspot x", i16(s[4:]) 68 | #print "hotspot y", i16(s[6:]) 69 | #print "bytes", i32(s[8:]) 70 | #print "offset", i32(s[12:]) 71 | 72 | # load as bitmap 73 | self._bitmap(i32(m[12:]) + offset) 74 | 75 | # patch up the bitmap height 76 | self.size = self.size[0], self.size[1]/2 77 | d, e, o, a = self.tile[0] 78 | self.tile[0] = d, (0,0)+self.size, o, a 79 | 80 | return 81 | 82 | 83 | # 84 | # -------------------------------------------------------------------- 85 | 86 | Image.register_open("CUR", CurImageFile, _accept) 87 | 88 | Image.register_extension("CUR", ".cur") 89 | --------------------------------------------------------------------------------