PNMFileTypeRegistry¶
from acron.core import PNMFileTypeRegistry
- class PNMFileTypeRegistry¶
Bases:
This class maintains the set of all known
PNMFileTypesin the universe.Inheritance diagram
digraph inheritance6b8bcc3376 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "PNMFileTypeRegistry" [URL="acron.core.PNMFileTypeRegistry.html#acron.core.PNMFileTypeRegistry",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "PNMFileTypeRegistry" [arrowsize=0.75,style=""]; }- __init__()¶
- static get_global_ptr()¶
Returns a pointer to the global
PNMFileTypeRegistryobject.
- get_num_types()¶
Returns the total number of types registered.
- get_type()¶
Returns the nth type registered.
- get_type_by_handle()¶
Returns the
PNMFileTypeinstance stored in the registry for the givenTypeHandle, e.g. as retrieved by a previous call toget_type()on the type instance.
- get_type_from_extension()¶
Tries to determine what the
PNMFileTypeis likely to be for a particular image file based on its extension. Returns a suitablePNMFileTypepointer, or NULL if no type can be determined.
- get_type_from_magic_number()¶
Tries to determine what the
PNMFileTypeis likely to be for a particular image file based on its magic number, the first two bytes read from the file. Returns a suitablePNMFileTypepointer, or NULL if no type can be determined.
- property types Sequence[PNMFileType]¶
Returns the nth type registered.
- write()¶
Writes a list of supported image file types to the indicated output stream, one per line.