mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
expose consider_rescale()
This commit is contained in:
parent
f4ed61f659
commit
c9114fb40d
@ -1643,6 +1643,42 @@ down_to_power_2(int value) {
|
||||
return (1 << bit);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: Texture::consider_rescale
|
||||
// Access: Published
|
||||
// Description: Asks the PNMImage to change its scale when it reads
|
||||
// the image, according to the whims of the Config.prc
|
||||
// file.
|
||||
//
|
||||
// This method should be called after
|
||||
// pnmimage.read_header() has been called, but before
|
||||
// pnmimage.read().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void Texture::
|
||||
consider_rescale(PNMImage &pnmimage) {
|
||||
consider_rescale(pnmimage, get_name());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: Texture::consider_rescale
|
||||
// Access: Published, Static
|
||||
// Description: Asks the PNMImage to change its scale when it reads
|
||||
// the image, according to the whims of the Config.prc
|
||||
// file.
|
||||
//
|
||||
// This method should be called after
|
||||
// pnmimage.read_header() has been called, but before
|
||||
// pnmimage.read().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void Texture::
|
||||
consider_rescale(PNMImage &pnmimage, const string &name) {
|
||||
int new_x_size = pnmimage.get_x_size();
|
||||
int new_y_size = pnmimage.get_y_size();
|
||||
if (adjust_size(new_x_size, new_y_size, name)) {
|
||||
pnmimage.set_read_size(new_x_size, new_y_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: Texture::texture_uploaded
|
||||
@ -5294,26 +5330,6 @@ clear_prepared(PreparedGraphicsObjects *prepared_objects) {
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: Texture::consider_rescale
|
||||
// Access: Private, Static
|
||||
// Description: Asks the PNMImage to change its scale when it reads
|
||||
// the image, according to the whims of the Config.prc
|
||||
// file.
|
||||
//
|
||||
// This method should be called after
|
||||
// pnmimage.read_header() has been called, but before
|
||||
// pnmimage.read().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void Texture::
|
||||
consider_rescale(PNMImage &pnmimage, const string &name) {
|
||||
int new_x_size = pnmimage.get_x_size();
|
||||
int new_y_size = pnmimage.get_y_size();
|
||||
if (adjust_size(new_x_size, new_y_size, name)) {
|
||||
pnmimage.set_read_size(new_x_size, new_y_size);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: Texture::consider_downgrade
|
||||
// Access: Private, Static
|
||||
|
@ -438,6 +438,9 @@ PUBLISHED:
|
||||
static int up_to_power_2(int value);
|
||||
static int down_to_power_2(int value);
|
||||
|
||||
void consider_rescale(PNMImage &pnmimage);
|
||||
static void consider_rescale(PNMImage &pnmimage, const string &name);
|
||||
|
||||
public:
|
||||
void texture_uploaded();
|
||||
|
||||
@ -600,7 +603,6 @@ private:
|
||||
|
||||
void clear_prepared(PreparedGraphicsObjects *prepared_objects);
|
||||
|
||||
static void consider_rescale(PNMImage &pnmimage, const string &name);
|
||||
static void consider_downgrade(PNMImage &pnmimage, int num_channels, const string &name);
|
||||
|
||||
static bool compare_images(const PNMImage &a, const PNMImage &b);
|
||||
|
Loading…
x
Reference in New Issue
Block a user