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