Panda3D
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
FltTexture Class Reference

Represents a single texture in the texture palette. More...

#include "fltTexture.h"

Inheritance diagram for FltTexture:
FltRecord TypedReferenceCount TypedObject ReferenceCount MemoryBase MemoryBase

Classes

struct  GeospecificControlPoint
 
struct  LODScale
 
struct  SubtextureDef
 

Public Types

enum  EarthModel {
  EM_wgs84 = 0, EM_wgs72 = 1, EM_bessel = 2, EM_clarke_1866 = 3,
  EM_nad27 = 4
}
 
enum  EnvironmentType { ET_modulate = 0, ET_blend = 1, ET_decal = 2, ET_color = 3 }
 
enum  ExternalFormat { EF_default = 0, EF_pack_8 = 1, EF_pack_16 = 2 }
 
enum  FileFormat {
  FF_none = -1, FF_att_8_pattern = 0, FF_att_8_template = 1, FF_sgi_i = 2,
  FF_sgi_ia = 3, FF_sgi_rgb = 4, FF_sgi_rgba = 5
}
 
typedef pvector< GeospecificControlPointGeospecificControlPoints
 
enum  Hemisphere { H_southern = 0, H_northern = 1 }
 
enum  ImageOrigin { IO_lower_left = 0, IO_upper_left = 1 }
 
enum  InternalFormat {
  IF_default = 0, IF_i_12a_4 = 1, IF_ia_8 = 2, IF_rgb_5 = 3,
  IF_rgba_4 = 4, IF_ia_12 = 5, IF_rgba_8 = 6, IF_rgba_12 = 7,
  IF_i_16 = 8, IF_rgb_12 = 9
}
 
enum  Magnification {
  MG_point = 0, MG_bilinear = 1, MG_bicubic = 3, MG_sharpen = 4,
  MG_add_detail = 5, MG_modulate_detail = 6, MG_bilinear_gequal = 7, MG_bilinear_lequal = 8,
  MG_bicubic_gequal = 9, MG_bicubic_lequal = 10
}
 
enum  Minification {
  MN_point = 0, MN_bilinear = 1, MN_OB_mipmap = 2, MN_mipmap_point = 3,
  MN_mipmap_linear = 4, MN_mipmap_bilinear = 5, MN_mipmap_trilinear = 6, MN_bicubic = 8,
  MN_bilinear_gequal = 9, MN_bilinear_lequal = 10, MN_bicubic_gequal = 11, MN_bicubic_lequal = 12
}
 
enum  PointsUnits { PU_degrees = 0, PU_meters = 1, PU_pixels = 2 }
 
enum  ProjectionType { PT_flat_earth = 0, PT_lambert = 3, PT_utm = 4, PT_undefined = 7 }
 
enum  RepeatType { RT_repeat = 0, RT_clamp = 1 }
 
typedef pvector< SubtextureDefSubtextureDefs
 

Public Member Functions

 FltTexture (FltHeader *header)
 
virtual void apply_converted_filenames ()
 Walks the hierarchy at this record and below and copies the _converted_filename record into the _orig_filename record, so the flt file will be written out with the converted filename instead of what was originally read in. More...
 
virtual TypeHandle force_init_type ()
 
Filename get_attr_filename () const
 Returns the name of the texture's associated .attr file. More...
 
Filename get_texture_filename () const
 Returns the name of the texture image file. More...
 
virtual TypeHandle get_type () const
 
FltError read_attr_data ()
 Opens up the texture's .attr file and reads its data into the extra FltTexture fields. More...
 
void set_texture_filename (const Filename &filename)
 Changes the name of the texture image file. More...
 
FltError write_attr_data () const
 Writes the texture's .attr file. More...
 
FltError write_attr_data (Filename attr_filename) const
 Writes the texture's .attr file to the named file. More...
 
- Public Member Functions inherited from FltRecord
 FltRecord (FltHeader *header)
 
void add_ancillary (FltRecord *ancillary)
 Adds a new unsupported ancillary record to the end of the list of ancillary records for this record. More...
 
void add_child (FltRecord *child)
 Adds a new child to the end of the list of children for this record. More...
 
void add_extension (FltRecord *extension)
 Adds a new extension to the end of the list of extensions for this record. More...
 
void add_subface (FltRecord *subface)
 Adds a new subface to the end of the list of subfaces for this record. More...
 
void check_remaining_size (const DatagramIterator &di, const std::string &name=std::string()) const
 Checks that the iterator has no bytes left, as it should at the end of a successfully read record. More...
 
void clear_ancillary ()
 Removes all unsupported ancillary records from this record. More...
 
void clear_children ()
 Removes all children from this record. More...
 
void clear_comment ()
 Removes the comment for this record. More...
 
void clear_extensions ()
 Removes all extensions from this record. More...
 
void clear_subfaces ()
 Removes all subfaces from this record. More...
 
FltRecordget_ancillary (int n) const
 Returns the nth unsupported ancillary record of this record. More...
 
FltRecordget_child (int n) const
 Returns the nth child of this record. More...
 
const std::string & get_comment () const
 Retrieves the comment for this record, or empty string if the record has no comment. More...
 
FltRecordget_extension (int n) const
 Returns the nth extension of this record. More...
 
int get_num_ancillary () const
 Returns the number of unsupported ancillary records of this record. More...
 
int get_num_children () const
 Returns the number of child records of this record. More...
 
int get_num_extensions () const
 Returns the number of extension attribute records for this object. More...
 
int get_num_subfaces () const
 Returns the number of subface records of this record. More...
 
FltRecordget_subface (int n) const
 Returns the nth subface of this record. More...
 
bool has_comment () const
 Returns true if this record has a nonempty comment, false otherwise. More...
 
virtual void output (std::ostream &out) const
 Writes a quick one-line description of the record, but not its children. More...
 
void set_comment (const std::string &comment)
 Changes the comment for this record. More...
 
virtual void write (std::ostream &out, int indent_level=0) const
 Writes a multiple-line description of the record and all of its children. More...
 
- Public Member Functions inherited from TypedReferenceCount
 TypedReferenceCount (const TypedReferenceCount &copy)
 
void operator= (const TypedReferenceCount &copy)
 
- Public Member Functions inherited from TypedObject
 TypedObject (const TypedObject &copy)=default
 
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
const TypedObjectas_typed_object () const
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
int get_best_parent_from_Set (const std::set< int > &) const
 
int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More...
 
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly. More...
 
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type. More...
 
TypedObjectoperator= (const TypedObject &copy)=default
 
- Public Member Functions inherited from ReferenceCount
int get_ref_count () const
 
WeakReferenceListget_weak_list () const
 Returns the WeakReferenceList associated with this ReferenceCount object. More...
 
bool has_weak_list () const
 Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More...
 
void local_object ()
 This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More...
 
void ref () const
 Explicitly increments the reference count. More...
 
bool ref_if_nonzero () const
 Atomically increases the reference count of this object if it is not zero. More...
 
bool test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus. More...
 
bool test_ref_count_nonzero () const
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More...
 
virtual bool unref () const
 Explicitly decrements the reference count. More...
 
WeakReferenceListweak_ref ()
 Adds the indicated PointerToVoid as a weak reference to this object. More...
 
void weak_unref ()
 Removes the indicated PointerToVoid as a weak reference to this object. More...
 

Static Public Member Functions

static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from FltRecord
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedObject
static TypeHandle get_class_type ()
 
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96. More...
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 

Public Attributes

PN_stdfloat _clamp
 
std::string _comment
 
Filename _converted_filename
 
int _detail_j
 
int _detail_k
 
int _detail_m
 
int _detail_n
 
int _detail_scramble
 
EarthModel _earth_model
 
EnvironmentType _env_type
 
ExternalFormat _external_format
 
FileFormat _file_format
 
int _file_version
 
double _float_real_world_size_u
 
double _float_real_world_size_v
 
GeospecificControlPoints _geospecific_control_points
 
Hemisphere _geospecific_hemisphere
 
PointsUnits _geospecific_points_units
 
ImageOrigin _image_origin
 
int _imported_origin_code
 
bool _intensity_is_alpha
 
InternalFormat _internal_format
 
int _kernel_version
 
double _lambert_conic_central_meridian
 
double _lambert_conic_lower_latitude
 
double _lambert_conic_upper_latitude
 
LODScale _lod_scale [8]
 
Magnification _mag_filter
 
Magnification _mag_filter_alpha
 
Magnification _mag_filter_color
 
Minification _min_filter
 
PN_stdfloat _mipmap_kernel [8]
 
int _modify_flag
 
int _num_texels_u
 
int _num_texels_v
 
std::string _orig_filename
 
int _pattern_index
 
ProjectionType _projection
 
int _real_world_size_u
 
int _real_world_size_v
 
RepeatType _repeat
 
RepeatType _repeat_u
 
RepeatType _repeat_v
 
SubtextureDefs _subtexture_defs
 
PN_stdfloat _tile_lower_left_u
 
PN_stdfloat _tile_lower_left_v
 
PN_stdfloat _tile_upper_right_u
 
PN_stdfloat _tile_upper_right_v
 
int _up_vector_x
 
int _up_vector_y
 
bool _use_detail
 
bool _use_lod_scale
 
bool _use_mipmap_kernel
 
bool _use_tile
 
int _utm_zone
 
int _x_location
 
int _x_pivot_point
 
int _y_location
 
int _y_pivot_point
 
- Public Attributes inherited from TypedObject
 get_type
 
- Public Attributes inherited from ReferenceCount
 get_ref_count
 Returns the current reference count. More...
 

Friends

class FltHeader
 

Detailed Description

Represents a single texture in the texture palette.

Definition at line 27 of file fltTexture.h.

Member Function Documentation

◆ apply_converted_filenames()

void FltTexture::apply_converted_filenames ( )
virtual

Walks the hierarchy at this record and below and copies the _converted_filename record into the _orig_filename record, so the flt file will be written out with the converted filename instead of what was originally read in.

Reimplemented from FltRecord.

Definition at line 92 of file fltTexture.cxx.

References FltRecord::apply_converted_filenames(), and Filename::to_os_generic().

Referenced by FltHeader::apply_converted_filenames().

◆ get_attr_filename()

Filename FltTexture::get_attr_filename ( ) const

Returns the name of the texture's associated .attr file.

This contains some additional MultiGen information about the texture parameters. This is, of course, just the name of the texture with .attr appended.

Normally, it won't be necessary to access this file directly; you can call read_attr_data() or write_attr_data() to get at the data stored in this file. (And read_attr_data() is called automatically when the Flt file is read in.)

Definition at line 125 of file fltTexture.cxx.

References get_texture_filename().

Referenced by read_attr_data(), and write_attr_data().

◆ get_texture_filename()

Filename FltTexture::get_texture_filename ( ) const

Returns the name of the texture image file.

Definition at line 101 of file fltTexture.cxx.

Referenced by get_attr_filename().

◆ read_attr_data()

FltError FltTexture::read_attr_data ( )

Opens up the texture's .attr file and reads its data into the extra FltTexture fields.

This is normally performed automatically when the Flt file is read from disk.

Definition at line 136 of file fltTexture.cxx.

References get_attr_filename(), and Filename::open_read().

◆ set_texture_filename()

void FltTexture::set_texture_filename ( const Filename filename)

Changes the name of the texture image file.

Definition at line 109 of file fltTexture.cxx.

References Filename::to_os_generic().

◆ write_attr_data() [1/2]

FltError FltTexture::write_attr_data ( ) const

Writes the texture's .attr file.

This may or may not be performed automatically, according to the setting of FltHeader::set_auto_attr_update().

Definition at line 171 of file fltTexture.cxx.

References get_attr_filename().

◆ write_attr_data() [2/2]

FltError FltTexture::write_attr_data ( Filename  attr_filename) const

Writes the texture's .attr file to the named file.

Definition at line 179 of file fltTexture.cxx.


The documentation for this class was generated from the following files: