Panda3D
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
PNMFileTypeRegistry Class Reference

This class maintains the set of all known PNMFileTypes in the universe. More...

Public Member Functions

 __init__ (const PNMFileTypeRegistry)
 
int getNumTypes ()
 Returns the total number of types registered. More...
 
PNMFileType getType (int n)
 Returns the nth type registered. More...
 
PNMFileType getTypeByHandle (TypeHandle handle)
 Returns the PNMFileType instance stored in the registry for the given TypeHandle, e.g. More...
 
PNMFileType getTypeFromExtension (str filename)
 Tries to determine what the PNMFileType is likely to be for a particular image file based on its extension. More...
 
PNMFileType getTypeFromMagicNumber (str magic_number)
 Tries to determine what the PNMFileType is likely to be for a particular image file based on its magic number, the first two bytes read from the file. More...
 
list getTypes ()
 
 write (Ostream out, int indent_level)
 Writes a list of supported image file types to the indicated output stream, one per line. More...
 

Static Public Member Functions

static PNMFileTypeRegistry getGlobalPtr ()
 Returns a pointer to the global PNMFileTypeRegistry object. More...
 

Public Attributes

PNMFileType types []
 

Detailed Description

This class maintains the set of all known PNMFileTypes in the universe.

Member Function Documentation

◆ __init__()

__init__ ( const  PNMFileTypeRegistry)

◆ getGlobalPtr()

static PNMFileTypeRegistry getGlobalPtr ( )
static

Returns a pointer to the global PNMFileTypeRegistry object.

◆ getNumTypes()

int getNumTypes ( )

Returns the total number of types registered.

◆ getType()

PNMFileType getType ( int  n)

Returns the nth type registered.

◆ getTypeByHandle()

PNMFileType getTypeByHandle ( TypeHandle  handle)

Returns the PNMFileType instance stored in the registry for the given TypeHandle, e.g.

as retrieved by a previous call to get_type() on the type instance.

◆ getTypeFromExtension()

PNMFileType getTypeFromExtension ( str  filename)

Tries to determine what the PNMFileType is likely to be for a particular image file based on its extension.

Returns a suitable PNMFileType pointer, or NULL if no type can be determined.

◆ getTypeFromMagicNumber()

PNMFileType getTypeFromMagicNumber ( str  magic_number)

Tries to determine what the PNMFileType is likely to be for a particular image file based on its magic number, the first two bytes read from the file.

Returns a suitable PNMFileType pointer, or NULL if no type can be determined.

◆ getTypes()

list getTypes ( )

◆ write()

write ( Ostream  out,
int  indent_level 
)

Writes a list of supported image file types to the indicated output stream, one per line.

Member Data Documentation

◆ types

PNMFileType types[]