15 #include "pnmFileTypeAndroid.h"
19 #include "config_pnmimagetypes.h"
21 #include "pnmFileTypeRegistry.h"
22 #include "bamReader.h"
24 static const char *
const extensions_android[] = {
25 "jpg",
"jpeg",
"gif",
"png",
27 static const int num_extensions_android =
sizeof(extensions_android) /
sizeof(
const char *);
37 PNMFileTypeAndroid() {
45 string PNMFileTypeAndroid::
47 return "Android Bitmap";
56 int PNMFileTypeAndroid::
57 get_num_extensions()
const {
58 return num_extensions_android;
68 string PNMFileTypeAndroid::
69 get_extension(
int n)
const {
70 nassertr(n >= 0 && n < num_extensions_android,
string());
71 return extensions_android[n];
80 bool PNMFileTypeAndroid::
81 has_magic_number()
const {
93 make_reader(istream *file,
bool owns_file,
const string &magic_number) {
95 return new Reader(
this, file, owns_file, magic_number);
104 void PNMFileTypeAndroid::
105 register_with_read_factory() {
107 register_factory(get_class_type(), make_PNMFileTypeAndroid);
PNMFileType * get_type_by_handle(TypeHandle handle) const
Returns the PNMFileType instance stored in the registry for the given TypeHandle, e...
Base class for objects that can be written to and read from Bam files.
static PNMFileTypeRegistry * get_global_ptr()
Returns a pointer to the global PNMFileTypeRegistry object.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
This is an abstract base class that defines the interface for reading image files of various types...
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
TypeHandle is the identifier used to differentiate C++ class types.