00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef PNMWRITER_H
00016 #define PNMWRITER_H
00017
00018 #include "pandabase.h"
00019
00020 #include "pnmImageHeader.h"
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 class EXPCL_PANDA_PNMIMAGE PNMWriter : public PNMImageHeader {
00031 protected:
00032 INLINE PNMWriter(PNMFileType *type, ostream *file, bool owns_file);
00033
00034 public:
00035
00036
00037
00038
00039 virtual ~PNMWriter();
00040
00041 INLINE PNMFileType *get_type() const;
00042
00043 INLINE void set_color_type(ColorType type);
00044 INLINE void set_num_channels(int num_channels);
00045 INLINE void set_maxval(xelval maxval);
00046 INLINE void set_x_size(int x_size);
00047 INLINE void set_y_size(int y_size);
00048
00049 INLINE void copy_header_from(const PNMImageHeader &header);
00050
00051 virtual int write_data(xel *array, xelval *alpha);
00052 virtual bool supports_write_row() const;
00053 virtual bool supports_grayscale() const;
00054 virtual bool write_header();
00055 virtual bool write_row(xel *array, xelval *alpha);
00056
00057 virtual bool supports_stream_write() const;
00058
00059 INLINE bool is_valid() const;
00060
00061 protected:
00062 PNMFileType *_type;
00063 bool _owns_file;
00064 ostream *_file;
00065 bool _is_valid;
00066 };
00067
00068 #include "pnmWriter.I"
00069
00070 #endif