Browse Source

publish PNMImage

David Rose 21 years ago
parent
commit
e2c525d201

+ 26 - 26
panda/src/gobj/texture.cxx

@@ -333,6 +333,32 @@ write(const Filename &name) const {
   return true;
   return true;
 }
 }
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: Texture::load
+//       Access: Published
+//  Description: Creates the texture from the already-read PNMImage.
+////////////////////////////////////////////////////////////////////
+bool Texture::
+load(const PNMImage &pnmimage) {
+  if (!_pbuffer->load(pnmimage))
+    return false;
+
+  mark_dirty(DF_image);
+
+  return true;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: Texture::store
+//       Access: Published
+//  Description: Saves the texture to the indicated PNMImage, but does
+//               not write it to disk.
+////////////////////////////////////////////////////////////////////
+bool Texture::
+store(PNMImage &pnmimage) const {
+  return _pbuffer->store( pnmimage );
+}
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: Texture::set_wrapu
 //     Function: Texture::set_wrapu
 //       Access: Published
 //       Access: Published
@@ -455,32 +481,6 @@ prepare(PreparedGraphicsObjects *prepared_objects) {
   prepared_objects->enqueue_texture(this);
   prepared_objects->enqueue_texture(this);
 }
 }
 
 
-////////////////////////////////////////////////////////////////////
-//     Function: Texture::load
-//       Access: Public
-//  Description: Creates the texture from the already-read PNMImage.
-////////////////////////////////////////////////////////////////////
-bool Texture::
-load(const PNMImage &pnmimage) {
-  if (!_pbuffer->load(pnmimage))
-    return false;
-
-  mark_dirty(DF_image);
-
-  return true;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: Texture::store
-//       Access: Public
-//  Description: Saves the texture to the indicated PNMImage, but does
-//               not write it to disk.
-////////////////////////////////////////////////////////////////////
-bool Texture::
-store(PNMImage &pnmimage) const {
-  return _pbuffer->store( pnmimage );
-}
-
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: Texture::is_mipmap
 //     Function: Texture::is_mipmap
 //       Access: Public, Static
 //       Access: Public, Static

+ 3 - 3
panda/src/gobj/texture.h

@@ -85,6 +85,9 @@ PUBLISHED:
             int primary_file_num_channels = 0, int alpha_file_channel = 0);
             int primary_file_num_channels = 0, int alpha_file_channel = 0);
   bool write(const Filename &fullpath = "") const;
   bool write(const Filename &fullpath = "") const;
 
 
+  bool load(const PNMImage &pnmimage);
+  bool store(PNMImage &pnmimage) const;
+
   void set_wrapu(WrapMode wrap);
   void set_wrapu(WrapMode wrap);
   void set_wrapv(WrapMode wrap);
   void set_wrapv(WrapMode wrap);
   void set_minfilter(FilterType filter);
   void set_minfilter(FilterType filter);
@@ -105,9 +108,6 @@ PUBLISHED:
   void prepare(PreparedGraphicsObjects *prepared_objects);
   void prepare(PreparedGraphicsObjects *prepared_objects);
 
 
 public:
 public:
-  bool load(const PNMImage &pnmimage);
-  bool store(PNMImage &pnmimage) const;
-
   static bool is_mipmap(FilterType type);
   static bool is_mipmap(FilterType type);
 
 
   TextureContext *prepare_now(PreparedGraphicsObjects *prepared_objects, 
   TextureContext *prepare_now(PreparedGraphicsObjects *prepared_objects, 

+ 2 - 0
panda/src/pnmimage/Sources.pp

@@ -29,5 +29,7 @@
     pnmImage.h pnmImageHeader.I pnmImageHeader.h pnmReader.I \
     pnmImage.h pnmImageHeader.I pnmImageHeader.h pnmReader.I \
     pnmReader.h pnmWriter.I pnmWriter.h pnmimage_base.h
     pnmReader.h pnmWriter.I pnmWriter.h pnmimage_base.h
 
 
+  #define IGATESCAN all
+
 #end lib_target
 #end lib_target
 
 

+ 1 - 1
panda/src/pnmimage/pnmImage.h

@@ -57,7 +57,7 @@ class PNMFileType;
 //               pointer.  The filename "-" refers to stdin or stdout.
 //               pointer.  The filename "-" refers to stdin or stdout.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 class EXPCL_PANDA PNMImage : public PNMImageHeader {
 class EXPCL_PANDA PNMImage : public PNMImageHeader {
-public:
+PUBLISHED:
   INLINE PNMImage();
   INLINE PNMImage();
   INLINE PNMImage(const Filename &filename, PNMFileType *type = NULL);
   INLINE PNMImage(const Filename &filename, PNMFileType *type = NULL);
   INLINE PNMImage(int x_size, int y_size, int num_channels = 3,
   INLINE PNMImage(int x_size, int y_size, int num_channels = 3,

+ 1 - 1
panda/src/pnmimage/pnmImageHeader.h

@@ -41,7 +41,7 @@ class PNMWriter;
 //               image file's header.
 //               image file's header.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 class EXPCL_PANDA PNMImageHeader {
 class EXPCL_PANDA PNMImageHeader {
-public:
+PUBLISHED:
   INLINE PNMImageHeader();
   INLINE PNMImageHeader();
   INLINE PNMImageHeader(const PNMImageHeader &copy);
   INLINE PNMImageHeader(const PNMImageHeader &copy);
   INLINE void operator = (const PNMImageHeader &copy);
   INLINE void operator = (const PNMImageHeader &copy);