14#ifndef PNMFILETYPEREGISTRY_H
15#define PNMFILETYPEREGISTRY_H
28class EXPCL_PANDA_PNMIMAGE PNMFileTypeRegistry {
30 PNMFileTypeRegistry();
33 ~PNMFileTypeRegistry();
48 void write(std::ostream &out,
int indent_level = 0)
const;
53 void sort_preferences();
55 typedef pvector<PNMFileType *> Types;
58 typedef pmap<std::string, Types> Extensions;
59 Extensions _extensions;
61 typedef pmap<TypeHandle, PNMFileType *> Handles;
66 static PNMFileTypeRegistry *_global_ptr;
get_num_types
Returns the total number of types registered.
PNMFileType * get_type_from_magic_number(const std::string &magic_number) const
Tries to determine what the PNMFileType is likely to be for a particular image file based on its magi...
PNMFileType * get_type_by_handle(TypeHandle handle) const
Returns the PNMFileType instance stored in the registry for the given TypeHandle, e....
static PNMFileTypeRegistry * get_global_ptr()
Returns a pointer to the global PNMFileTypeRegistry object.
void write(std::ostream &out, int indent_level=0) const
Writes a list of supported image file types to the indicated output stream, one per line.
get_type
Returns the nth type registered.
void unregister_type(PNMFileType *type)
Removes a PNMFileType previously passed to register_type.
PNMFileType * get_type_from_extension(const std::string &filename) const
Tries to determine what the PNMFileType is likely to be for a particular image file based on its exte...
This is the base class of a family of classes that represent particular image file types that PNMImag...
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.