14#ifndef PNMFILETYPEPFM_H
15#define PNMFILETYPEPFM_H
28class EXPCL_PANDA_PNMIMAGETYPES PNMFileTypePfm :
public PNMFileType {
32 virtual std::string
get_name()
const;
42 const std::string &magic_number = std::string());
46 class Reader :
public PNMReader {
48 Reader(PNMFileType *type, std::istream *file,
bool owns_file, std::string magic_number);
57 class Writer :
public PNMWriter {
59 Writer(PNMFileType *type, std::ostream *file,
bool owns_file);
72 static TypedWritable *make_PNMFileTypePfm(
const FactoryParams ¶ms);
78 static void init_type() {
79 PNMFileType::init_type();
81 PNMFileType::get_class_type());
83 virtual TypeHandle get_type()
const {
84 return get_class_type();
86 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
89 static TypeHandle _type_handle;
An instance of this class is passed to the Factory when requesting it to do its business and construc...
virtual bool is_floating_point()
Returns true if this PNMFileType represents a floating-point image type, false if it is a normal,...
virtual bool read_pfm(PfmFile &pfm)
Reads floating-point data directly into the indicated PfmFile.
virtual bool supports_integer()
Returns true if this PNMFileType can accept an integer image type, false if it can only accept a floa...
virtual bool supports_floating_point()
Returns true if this PNMFileType can accept a floating-point image type, false if it can only accept ...
virtual bool write_pfm(const PfmFile &pfm)
Writes floating-point data from the indicated PfmFile.
static void register_with_read_factory()
Registers the current object as something that can be read from a Bam file.
virtual std::string get_name() const
Returns a few words describing the file type.
virtual bool has_magic_number() const
Returns true if this particular file type uses a magic number to identify it, false otherwise.
get_suggested_extension
Returns a suitable filename extension (without a leading dot) to suggest for files of this type,...
virtual PNMReader * make_reader(std::istream *file, bool owns_file=true, const std::string &magic_number=std::string())
Allocates and returns a new PNMReader suitable for reading from this file type, if possible.
get_num_extensions
Returns the number of different possible filename extensions associated with this particular file typ...
virtual PNMWriter * make_writer(std::ostream *file, bool owns_file=true)
Allocates and returns a new PNMWriter suitable for reading from this file type, if possible.
get_extension
Returns the nth possible filename extension associated with this particular file type,...
virtual bool matches_magic_number(const std::string &magic_number) const
Returns true if the indicated "magic number" byte stream (the initial few bytes read from the file) m...
This is an abstract base class that defines the interface for reading image files of various types.
This is an abstract base class that defines the interface for writing image files of various types.
Defines a pfm file, a 2-d table of floating-point numbers, either 3-component or 1-component,...
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.
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(),...