Panda3D
|
Represents a single texture in the texture palette. More...
#include "fltTexture.h"
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 < GeospecificControlPoint > | GeospecificControlPoints |
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< SubtextureDef > | SubtextureDefs |
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. | |
Static Public Member Functions | |
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. | |
Public Attributes | |
PN_stdfloat | _clamp |
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 |
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 |
Protected Member Functions | |
virtual bool | build_record (FltRecordWriter &writer) const |
Fills up the current record on the FltRecordWriter with data for this record, but does not advance the writer. | |
virtual bool | extract_record (FltRecordReader &reader) |
Fills in the information in this record based on the information given in the indicated datagram, whose opcode has already been read. | |
Friends | |
class | FltHeader |
Represents a single texture in the texture palette.
Definition at line 29 of file fltTexture.h.
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 98 of file fltTexture.cxx.
Referenced by FltHeader::apply_converted_filenames().
bool FltTexture::build_record | ( | FltRecordWriter & | writer | ) | const [protected, virtual] |
Fills up the current record on the FltRecordWriter with data for this record, but does not advance the writer.
Returns true on success, false if there is some error.
Reimplemented from FltRecord.
Definition at line 267 of file fltTexture.cxx.
References Datagram::add_be_int32(), Datagram::add_fixed_string(), FltRecord::build_record(), get_attr_filename(), FltHeader::get_auto_attr_update(), FltRecordWriter::set_opcode(), FltRecordWriter::update_datagram(), and write_attr_data().
bool FltTexture::extract_record | ( | FltRecordReader & | reader | ) | [protected, virtual] |
Fills in the information in this record based on the information given in the indicated datagram, whose opcode has already been read.
Returns true on success, false if the datagram is invalid.
Reimplemented from FltRecord.
Definition at line 232 of file fltTexture.cxx.
References FltRecord::check_remaining_size(), FltHeader::convert_path(), FltRecord::extract_record(), Filename::from_os_specific(), get_attr_filename(), FltHeader::get_flt_version(), FltRecordReader::get_iterator(), FltRecordReader::get_opcode(), and read_attr_data().
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 140 of file fltTexture.cxx.
References get_texture_filename().
Referenced by build_record(), extract_record(), read_attr_data(), and write_attr_data().
Filename FltTexture::get_texture_filename | ( | ) | const |
Returns the name of the texture image file.
Definition at line 109 of file fltTexture.cxx.
Referenced by get_attr_filename().
static void FltTexture::init_type | ( | ) | [inline, static] |
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from FltRecord.
Definition at line 242 of file fltTexture.h.
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 154 of file fltTexture.cxx.
References get_attr_filename(), and Filename::open_read().
Referenced by extract_record().
void FltTexture::set_texture_filename | ( | const Filename & | filename | ) |
Changes the name of the texture image file.
Definition at line 119 of file fltTexture.cxx.
FltError FltTexture::write_attr_data | ( | Filename | attr_filename | ) | const |
Writes the texture's .attr file to the named file.
Definition at line 203 of file fltTexture.cxx.
References Datagram::get_data(), Datagram::get_length(), Filename::open_write(), and Filename::set_binary().
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 192 of file fltTexture.cxx.
References get_attr_filename().
Referenced by build_record().