4 The python binding maps mostly to the C API with the 'GP_' prefix stripped.
6 Loaders adds support for loading and storing pixmaps into/from various image
10 -------------------------------------------------------------------------------
11 import gfxprim.loaders as loaders
13 img = loaders.Load(path, callback=None)
15 img = loaders.LoadBMP(path, callback=None)
16 img = loaders.LoadGIF(path, callback=None)
17 img = loaders.LoadJPG(path, callback=None)
18 img = loaders.LoadJP2(path, callback=None)
19 img = loaders.LoadPBM(path, callback=None)
20 img = loaders.LoadPGM(path, callback=None)
21 img = loaders.LoadPNG(path, callback=None)
22 img = loaders.LoadPNM(path, callback=None)
23 img = loaders.LoadPPM(path, callback=None)
24 img = loaders.LoadPCX(path, callback=None)
25 img = loaders.LoadPSP(path, callback=None)
26 img = loaders.LoadPSD(path, callback=None)
27 img = loaders.LoadTIFF(path, callback=None)
28 -------------------------------------------------------------------------------
30 Loads an image from a file.
32 First one is general purpose loader function that automatically detects the
33 file format. The format is detected from file extension first and if this
34 fails link:signatures.html[file signature] is used.
36 |===============================================================================
37 | May raise 'OSError' with errno set to 'EPERM', 'EISDIR', 'ENOENT' or any other
38 errno set by 'open(2)', 'read(2)', 'seek(2)'.
40 | May raise 'OSError' with errno set to 'ENOSYS' on unsupported or not recognized
41 format or if specific loader was disabled upon compilation.
43 | May raise 'OSError' with errno set to 'EIO' or 'EINVAL' when file is damaged.
45 | May raise 'OSError' with errno set to 'ECANCELED' when action was aborted from
46 callback. See link:core_python.html#Progress_Callback[progress callback] for
49 |===============================================================================
53 -------------------------------------------------------------------------------
54 import gfxprim.loaders as loaders
56 img.loaders.Save(path, callback=None)
58 img.loaders.SaveBMP(path, callback=None)
59 img.loaders.SaveJPG(path, callback=None)
60 img.loaders.SavePBM(path, callback=None)
61 img.loaders.SavePGM(path, callback=None)
62 img.loaders.SavePNG(path, callback=None)
63 img.loaders.SavePNM(path, callback=None)
64 img.loaders.SavePPM(path, callback=None)
65 img.loaders.SaveTIFF(path, callback=None)
66 -------------------------------------------------------------------------------
70 For the Save() method the file format is derived from the extension.
72 |===============================================================================
73 | May raise 'OSError' with errno set to 'EPERM', 'EISDIR', 'ENOENT', 'ENOSPC'
74 or any other errno set by 'open(2)', 'write(2)', 'seek(2)'.
75 | May raise 'OSError' with errno set to 'ENOSYS' if pixel type is not supported
76 by the format or if the save method is not implemented (possibly disabled upon
78 | May raise 'OSError' with errno set to 'ECANCELED' when action was interrupted
79 by callback. See link:core_python.html#Progress_Callback[progress callback]
81 |===============================================================================
84 -------------------------------------------------------------------------------
85 import gfxprim.loaders as loaders
89 -------------------------------------------------------------------------------
91 Prints all loaders and their capabilites into the stdout.