mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
publish PNMImage
This commit is contained in:
parent
67b9dc9367
commit
e2c525d201
@ -333,6 +333,32 @@ write(const Filename &name) const {
|
||||
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
|
||||
// Access: Published
|
||||
@ -455,32 +481,6 @@ prepare(PreparedGraphicsObjects *prepared_objects) {
|
||||
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
|
||||
// Access: Public, Static
|
||||
|
@ -85,6 +85,9 @@ PUBLISHED:
|
||||
int primary_file_num_channels = 0, int alpha_file_channel = 0);
|
||||
bool write(const Filename &fullpath = "") const;
|
||||
|
||||
bool load(const PNMImage &pnmimage);
|
||||
bool store(PNMImage &pnmimage) const;
|
||||
|
||||
void set_wrapu(WrapMode wrap);
|
||||
void set_wrapv(WrapMode wrap);
|
||||
void set_minfilter(FilterType filter);
|
||||
@ -105,9 +108,6 @@ PUBLISHED:
|
||||
void prepare(PreparedGraphicsObjects *prepared_objects);
|
||||
|
||||
public:
|
||||
bool load(const PNMImage &pnmimage);
|
||||
bool store(PNMImage &pnmimage) const;
|
||||
|
||||
static bool is_mipmap(FilterType type);
|
||||
|
||||
TextureContext *prepare_now(PreparedGraphicsObjects *prepared_objects,
|
||||
|
@ -29,5 +29,7 @@
|
||||
pnmImage.h pnmImageHeader.I pnmImageHeader.h pnmReader.I \
|
||||
pnmReader.h pnmWriter.I pnmWriter.h pnmimage_base.h
|
||||
|
||||
#define IGATESCAN all
|
||||
|
||||
#end lib_target
|
||||
|
||||
|
@ -57,7 +57,7 @@ class PNMFileType;
|
||||
// pointer. The filename "-" refers to stdin or stdout.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDA PNMImage : public PNMImageHeader {
|
||||
public:
|
||||
PUBLISHED:
|
||||
INLINE PNMImage();
|
||||
INLINE PNMImage(const Filename &filename, PNMFileType *type = NULL);
|
||||
INLINE PNMImage(int x_size, int y_size, int num_channels = 3,
|
||||
|
@ -41,7 +41,7 @@ class PNMWriter;
|
||||
// image file's header.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDA PNMImageHeader {
|
||||
public:
|
||||
PUBLISHED:
|
||||
INLINE PNMImageHeader();
|
||||
INLINE PNMImageHeader(const PNMImageHeader ©);
|
||||
INLINE void operator = (const PNMImageHeader ©);
|
||||
|
Loading…
x
Reference in New Issue
Block a user