Panda3D
Loading...
Searching...
No Matches
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.
 
virtual TypeHandle force_init_type ()
 
Filename get_attr_filename () const
 Returns the name of the texture's associated .attr file.
 
Filename get_texture_filename () const
 Returns the name of the texture image file.
 
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.
 
void set_texture_filename (const Filename &filename)
 Changes the name of the texture image file.
 
FltError write_attr_data () const
 Writes the texture's .attr file.
 
FltError write_attr_data (Filename attr_filename) const
 Writes the texture's .attr file to the named file.
 
- 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.
 
void add_child (FltRecord *child)
 Adds a new child to the end of the list of children for this record.
 
void add_extension (FltRecord *extension)
 Adds a new extension to the end of the list of extensions for this record.
 
void add_subface (FltRecord *subface)
 Adds a new subface to the end of the list of subfaces for this record.
 
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.
 
void clear_ancillary ()
 Removes all unsupported ancillary records from this record.
 
void clear_children ()
 Removes all children from this record.
 
void clear_comment ()
 Removes the comment for this record.
 
void clear_extensions ()
 Removes all extensions from this record.
 
void clear_subfaces ()
 Removes all subfaces from this record.
 
FltRecordget_ancillary (int n) const
 Returns the nth unsupported ancillary record of this record.
 
FltRecordget_child (int n) const
 Returns the nth child of this record.
 
const std::string & get_comment () const
 Retrieves the comment for this record, or empty string if the record has no comment.
 
FltRecordget_extension (int n) const
 Returns the nth extension of this record.
 
int get_num_ancillary () const
 Returns the number of unsupported ancillary records of this record.
 
int get_num_children () const
 Returns the number of child records of this record.
 
int get_num_extensions () const
 Returns the number of extension attribute records for this object.
 
int get_num_subfaces () const
 Returns the number of subface records of this record.
 
FltRecordget_subface (int n) const
 Returns the nth subface of this record.
 
bool has_comment () const
 Returns true if this record has a nonempty comment, false otherwise.
 
virtual void output (std::ostream &out) const
 Writes a quick one-line description of the record, but not its children.
 
void set_comment (const std::string &comment)
 Changes the comment for this record.
 
virtual void write (std::ostream &out, int indent_level=0) const
 Writes a multiple-line description of the record and all of its children.
 
- 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.
 
const TypedObjectas_typed_object () const
 Returns the object, upcast (if necessary) to a TypedObject pointer.
 
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.
 
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly.
 
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type.
 
TypedObjectoperator= (const TypedObject &copy)=default
 
- Public Member Functions inherited from MemoryBase
void operator delete (void *, void *)
 
void operator delete (void *ptr)
 
void operator delete[] (void *, void *)
 
void operator delete[] (void *ptr)
 
void * operator new (size_t size)
 
void * operator new (size_t size, void *ptr)
 
void * operator new[] (size_t size)
 
void * operator new[] (size_t size, void *ptr)
 
- Public Member Functions inherited from ReferenceCount
int get_ref_count () const
 
WeakReferenceListget_weak_list () const
 Returns the WeakReferenceList associated with this ReferenceCount object.
 
bool has_weak_list () const
 Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.
 
void local_object ()
 This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.
 
void ref () const
 Explicitly increments the reference count.
 
bool ref_if_nonzero () const
 Atomically increases the reference count of this object if it is not zero.
 
bool test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus.
 
bool test_ref_count_nonzero () const
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
 
virtual bool unref () const
 Explicitly decrements the reference count.
 
bool unref_if_one () const
 Atomically decreases the reference count of this object if it is one.
 
WeakReferenceListweak_ref ()
 Adds the indicated PointerToVoid as a weak reference to this object.
 
void weak_unref ()
 Removes the indicated PointerToVoid as a weak reference to this object.
 

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.
 
- 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.
 

Friends

class FltHeader
 

Detailed Description

Represents a single texture in the texture palette.

Definition at line 27 of file fltTexture.h.

Member Typedef Documentation

◆ GeospecificControlPoints

Definition at line 157 of file fltTexture.h.

◆ SubtextureDefs

Definition at line 166 of file fltTexture.h.

Member Enumeration Documentation

◆ EarthModel

enum FltTexture::EarthModel

Definition at line 123 of file fltTexture.h.

◆ EnvironmentType

enum FltTexture::EnvironmentType

Definition at line 90 of file fltTexture.h.

◆ ExternalFormat

enum FltTexture::ExternalFormat

Definition at line 110 of file fltTexture.h.

◆ FileFormat

enum FltTexture::FileFormat

Definition at line 47 of file fltTexture.h.

◆ Hemisphere

enum FltTexture::Hemisphere

Definition at line 142 of file fltTexture.h.

◆ ImageOrigin

enum FltTexture::ImageOrigin

Definition at line 131 of file fltTexture.h.

◆ InternalFormat

enum FltTexture::InternalFormat

Definition at line 97 of file fltTexture.h.

◆ Magnification

enum FltTexture::Magnification

Definition at line 72 of file fltTexture.h.

◆ Minification

enum FltTexture::Minification

Definition at line 57 of file fltTexture.h.

◆ PointsUnits

enum FltTexture::PointsUnits

Definition at line 136 of file fltTexture.h.

◆ ProjectionType

enum FltTexture::ProjectionType

Definition at line 116 of file fltTexture.h.

◆ RepeatType

enum FltTexture::RepeatType

Definition at line 85 of file fltTexture.h.

Constructor & Destructor Documentation

◆ FltTexture()

FltTexture::FltTexture ( FltHeader * header)

Definition at line 26 of file fltTexture.cxx.

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 91 of file fltTexture.cxx.

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

Referenced by FltHeader::apply_converted_filenames().

◆ force_init_type()

virtual TypeHandle FltTexture::force_init_type ( )
inlinevirtual

Reimplemented from FltRecord.

Definition at line 236 of file fltTexture.h.

◆ 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 124 of file fltTexture.cxx.

References get_texture_filename().

Referenced by read_attr_data(), and write_attr_data().

◆ get_class_type()

static TypeHandle FltTexture::get_class_type ( )
inlinestatic

Definition at line 237 of file fltTexture.h.

◆ get_texture_filename()

Filename FltTexture::get_texture_filename ( ) const

Returns the name of the texture image file.

Definition at line 100 of file fltTexture.cxx.

Referenced by get_attr_filename().

◆ get_type()

virtual TypeHandle FltTexture::get_type ( ) const
inlinevirtual

Reimplemented from FltRecord.

Definition at line 233 of file fltTexture.h.

◆ init_type()

static void FltTexture::init_type ( )
inlinestatic

Definition at line 240 of file fltTexture.h.

◆ 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 135 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 108 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 170 of file fltTexture.cxx.

References get_attr_filename(), and write_attr_data().

Referenced by write_attr_data().

◆ 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 178 of file fltTexture.cxx.

References Datagram::get_data(), Datagram::get_length(), Filename::open_write(), and Filename::set_binary().

Friends And Related Symbol Documentation

◆ FltHeader

friend class FltHeader
friend

Definition at line 249 of file fltTexture.h.

Member Data Documentation

◆ _clamp

PN_stdfloat FltTexture::_clamp

Definition at line 196 of file fltTexture.h.

◆ _comment

std::string FltTexture::_comment

Definition at line 219 of file fltTexture.h.

◆ _converted_filename

Filename FltTexture::_converted_filename

Definition at line 34 of file fltTexture.h.

◆ _detail_j

int FltTexture::_detail_j

Definition at line 203 of file fltTexture.h.

◆ _detail_k

int FltTexture::_detail_k

Definition at line 204 of file fltTexture.h.

◆ _detail_m

int FltTexture::_detail_m

Definition at line 205 of file fltTexture.h.

◆ _detail_n

int FltTexture::_detail_n

Definition at line 206 of file fltTexture.h.

◆ _detail_scramble

int FltTexture::_detail_scramble

Definition at line 207 of file fltTexture.h.

◆ _earth_model

EarthModel FltTexture::_earth_model

Definition at line 214 of file fltTexture.h.

◆ _env_type

EnvironmentType FltTexture::_env_type

Definition at line 183 of file fltTexture.h.

◆ _external_format

ExternalFormat FltTexture::_external_format

Definition at line 191 of file fltTexture.h.

◆ _file_format

FileFormat FltTexture::_file_format

Definition at line 174 of file fltTexture.h.

◆ _file_version

int FltTexture::_file_version

Definition at line 220 of file fltTexture.h.

◆ _float_real_world_size_u

double FltTexture::_float_real_world_size_u

Definition at line 186 of file fltTexture.h.

◆ _float_real_world_size_v

double FltTexture::_float_real_world_size_v

Definition at line 187 of file fltTexture.h.

◆ _geospecific_control_points

GeospecificControlPoints FltTexture::_geospecific_control_points

Definition at line 221 of file fltTexture.h.

◆ _geospecific_hemisphere

Hemisphere FltTexture::_geospecific_hemisphere

Definition at line 218 of file fltTexture.h.

◆ _geospecific_points_units

PointsUnits FltTexture::_geospecific_points_units

Definition at line 217 of file fltTexture.h.

◆ _image_origin

ImageOrigin FltTexture::_image_origin

Definition at line 216 of file fltTexture.h.

◆ _imported_origin_code

int FltTexture::_imported_origin_code

Definition at line 188 of file fltTexture.h.

◆ _intensity_is_alpha

bool FltTexture::_intensity_is_alpha

Definition at line 184 of file fltTexture.h.

◆ _internal_format

InternalFormat FltTexture::_internal_format

Definition at line 190 of file fltTexture.h.

◆ _kernel_version

int FltTexture::_kernel_version

Definition at line 189 of file fltTexture.h.

◆ _lambert_conic_central_meridian

double FltTexture::_lambert_conic_central_meridian

Definition at line 199 of file fltTexture.h.

◆ _lambert_conic_lower_latitude

double FltTexture::_lambert_conic_lower_latitude

Definition at line 201 of file fltTexture.h.

◆ _lambert_conic_upper_latitude

double FltTexture::_lambert_conic_upper_latitude

Definition at line 200 of file fltTexture.h.

◆ _lod_scale

LODScale FltTexture::_lod_scale[8]

Definition at line 195 of file fltTexture.h.

◆ _mag_filter

Magnification FltTexture::_mag_filter

Definition at line 176 of file fltTexture.h.

◆ _mag_filter_alpha

Magnification FltTexture::_mag_filter_alpha

Definition at line 197 of file fltTexture.h.

◆ _mag_filter_color

Magnification FltTexture::_mag_filter_color

Definition at line 198 of file fltTexture.h.

◆ _min_filter

Minification FltTexture::_min_filter

Definition at line 175 of file fltTexture.h.

◆ _mipmap_kernel

PN_stdfloat FltTexture::_mipmap_kernel[8]

Definition at line 193 of file fltTexture.h.

◆ _modify_flag

int FltTexture::_modify_flag

Definition at line 180 of file fltTexture.h.

◆ _num_texels_u

int FltTexture::_num_texels_u

Definition at line 168 of file fltTexture.h.

◆ _num_texels_v

int FltTexture::_num_texels_v

Definition at line 169 of file fltTexture.h.

◆ _orig_filename

std::string FltTexture::_orig_filename

Definition at line 33 of file fltTexture.h.

◆ _pattern_index

int FltTexture::_pattern_index

Definition at line 35 of file fltTexture.h.

◆ _projection

ProjectionType FltTexture::_projection

Definition at line 213 of file fltTexture.h.

◆ _real_world_size_u

int FltTexture::_real_world_size_u

Definition at line 170 of file fltTexture.h.

◆ _real_world_size_v

int FltTexture::_real_world_size_v

Definition at line 171 of file fltTexture.h.

◆ _repeat

RepeatType FltTexture::_repeat

Definition at line 177 of file fltTexture.h.

◆ _repeat_u

RepeatType FltTexture::_repeat_u

Definition at line 178 of file fltTexture.h.

◆ _repeat_v

RepeatType FltTexture::_repeat_v

Definition at line 179 of file fltTexture.h.

◆ _subtexture_defs

SubtextureDefs FltTexture::_subtexture_defs

Definition at line 222 of file fltTexture.h.

◆ _tile_lower_left_u

PN_stdfloat FltTexture::_tile_lower_left_u

Definition at line 209 of file fltTexture.h.

◆ _tile_lower_left_v

PN_stdfloat FltTexture::_tile_lower_left_v

Definition at line 210 of file fltTexture.h.

◆ _tile_upper_right_u

PN_stdfloat FltTexture::_tile_upper_right_u

Definition at line 211 of file fltTexture.h.

◆ _tile_upper_right_v

PN_stdfloat FltTexture::_tile_upper_right_v

Definition at line 212 of file fltTexture.h.

◆ _up_vector_x

int FltTexture::_up_vector_x

Definition at line 172 of file fltTexture.h.

◆ _up_vector_y

int FltTexture::_up_vector_y

Definition at line 173 of file fltTexture.h.

◆ _use_detail

bool FltTexture::_use_detail

Definition at line 202 of file fltTexture.h.

◆ _use_lod_scale

bool FltTexture::_use_lod_scale

Definition at line 194 of file fltTexture.h.

◆ _use_mipmap_kernel

bool FltTexture::_use_mipmap_kernel

Definition at line 192 of file fltTexture.h.

◆ _use_tile

bool FltTexture::_use_tile

Definition at line 208 of file fltTexture.h.

◆ _utm_zone

int FltTexture::_utm_zone

Definition at line 215 of file fltTexture.h.

◆ _x_location

int FltTexture::_x_location

Definition at line 36 of file fltTexture.h.

◆ _x_pivot_point

int FltTexture::_x_pivot_point

Definition at line 181 of file fltTexture.h.

◆ _y_location

int FltTexture::_y_location

Definition at line 37 of file fltTexture.h.

◆ _y_pivot_point

int FltTexture::_y_pivot_point

Definition at line 182 of file fltTexture.h.


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