Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

TextureImage Class Reference

#include <textureImage.h>

Inheritance diagram for TextureImage:

ImageFile Namable TypedWritable TypedObject List of all members.

Public Member Functions

 TextureImage ()
void note_egg_file (EggFile *egg_file)
void assign_groups ()
const PaletteGroupsget_groups () const
TexturePlacementget_placement (PaletteGroup *group) const
void force_replace ()
void mark_eggs_stale ()
void pre_txa_file ()
void post_txa_file ()
bool got_txa_file () const
void determine_placement_size ()
bool get_omit () const
double get_coverage_threshold () const
int get_margin () const
bool is_surprise () const
bool is_used () const
EggRenderMode::AlphaMode get_alpha_mode () const
SourceTextureImageget_source (const Filename &filename, const Filename &alpha_filename, int alpha_file_channel)
SourceTextureImageget_preferred_source ()
void clear_source_basic_properties ()
void copy_unplaced (bool redo_all)
const PNMImageread_source_image ()
void read_header ()
bool is_newer_than (const Filename &reference_filename)
void write_source_pathnames (ostream &out, int indent_level=0) const
void write_scale_info (ostream &out, int indent_level=0)
virtual void write_datagram (BamWriter *writer, Datagram &datagram)
virtual int complete_pointers (TypedWritable **p_list, BamReader *manager)
virtual TypeHandle get_type () const

Static Public Member Functions

void register_with_read_factory ()
TypeHandle get_class_type ()
void init_type ()

Protected Member Functions

void fillin (DatagramIterator &scan, BamReader *manager)

Static Protected Member Functions

TypedWritablemake_TextureImage (const FactoryParams &params)

Private Types

typedef pset< EggFile * > EggFiles
typedef pvector< EggFile * > WorkingEggs
typedef pmap< string, SourceTextureImage * > Sources
typedef pmap< string, DestTextureImage * > Dests
typedef pmap< PaletteGroup *,
TexturePlacement * > 
Placement
enum  AlphaBits { AB_one = 0x01, AB_mid = 0x02, AB_zero = 0x04, AB_all = 0x07 }

Private Member Functions

void assign_to_groups (const PaletteGroups &groups)
void consider_grayscale ()
void consider_alpha ()
void remove_old_dests (const Dests &a, const Dests &b)
void copy_new_dests (const Dests &a, const Dests &b)
string get_source_key (const Filename &filename, const Filename &alpha_filename, int alpha_file_channel)

Static Private Member Functions

int compute_egg_count (PaletteGroup *group, const WorkingEggs &egg_files)

Private Attributes

TextureRequest _request
TextureProperties _pre_txa_properties
EggRenderMode::AlphaMode _pre_txa_alpha_mode
SourceTextureImage_preferred_source
bool _is_surprise
bool _ever_read_image
bool _forced_grayscale
int _alpha_bits
EggRenderMode::AlphaMode _alpha_mode
PaletteGroups _explicitly_assigned_groups
PaletteGroups _actual_assigned_groups
EggFiles _egg_files
Placement _placement
Sources _sources
Dests _dests
bool _read_source_image
PNMImage _source_image
bool _got_txa_file
int _num_placement
int _num_sources
int _num_dests

Static Private Attributes

TypeHandle _type_handle

Friends

class TxaLine

Member Typedef Documentation

typedef pmap<string, DestTextureImage *> TextureImage::Dests [private]
 

Definition at line 99 of file textureImage.h.

typedef pset<EggFile *> TextureImage::EggFiles [private]
 

Definition at line 96 of file textureImage.h.

typedef pmap<PaletteGroup *, TexturePlacement *> TextureImage::Placement [private]
 

Definition at line 141 of file textureImage.h.

typedef pmap<string, SourceTextureImage *> TextureImage::Sources [private]
 

Definition at line 98 of file textureImage.h.

typedef pvector<EggFile *> TextureImage::WorkingEggs [private]
 

Definition at line 97 of file textureImage.h.


Member Enumeration Documentation

enum TextureImage::AlphaBits [private]
 

Enumeration values:
AB_one 
AB_mid 
AB_zero 
AB_all 

Definition at line 125 of file textureImage.h.


Constructor & Destructor Documentation

TextureImage::TextureImage  ) 
 

Definition at line 45 of file textureImage.cxx.

References _alpha_bits, _alpha_mode, _ever_read_image, _forced_grayscale, _got_txa_file, _is_surprise, _preferred_source, _read_source_image, EggRenderMode::AM_unspecified, and NULL.


Member Function Documentation

void TextureImage::assign_groups  ) 
 

Definition at line 79 of file textureImage.cxx.

References _egg_files, _explicitly_assigned_groups, assign_to_groups(), PaletteGroups::begin(), compute_egg_count(), PaletteGroups::empty(), PaletteGroups::end(), PaletteGroups::insert(), PaletteGroup::is_preferred_over(), PaletteGroups::iterator, PaletteGroups::make_intersection(), PaletteGroups::make_union(), and nassertv.

void TextureImage::assign_to_groups const PaletteGroups groups  )  [private]
 

Definition at line 959 of file textureImage.cxx.

References _actual_assigned_groups, _placement, a, b, PaletteGroups::begin(), PaletteGroups::const_iterator, and PaletteGroups::end().

Referenced by assign_groups().

void TextureImage::clear_source_basic_properties  ) 
 

Definition at line 628 of file textureImage.cxx.

References _sources, and ImageFile::clear_basic_properties().

int TextureImage::complete_pointers TypedWritable **  p_list,
BamReader manager
[virtual]
 

Reimplemented from ImageFile.

Definition at line 1305 of file textureImage.cxx.

References _actual_assigned_groups, _dests, _num_dests, _num_placement, _num_sources, _placement, _sources, PaletteGroups::complete_pointers(), ImageFile::complete_pointers(), DCAST_INTO_R, ImageFile::get_alpha_file_channel(), ImageFile::get_alpha_filename(), ImageFile::get_filename(), get_source_key(), and nout.

int TextureImage::compute_egg_count PaletteGroup group,
const WorkingEggs egg_files
[static, private]
 

Definition at line 934 of file textureImage.cxx.

References count.

Referenced by assign_groups().

void TextureImage::consider_alpha  )  [private]
 

Definition at line 1068 of file textureImage.cxx.

References _alpha_bits, _alpha_mode, _ever_read_image, ImageFile::_properties, _read_source_image, AB_all, AB_mid, AB_one, AB_zero, EggRenderMode::AM_binary, EggRenderMode::AM_blend, EggRenderMode::AM_dual, EggRenderMode::AM_unspecified, TextureProperties::force_nonalpha(), PNMImage::get_alpha_val(), PNMImageHeader::get_maxval(), PNMImageHeader::get_x_size(), PNMImageHeader::get_y_size(), PNMImageHeader::has_alpha(), PNMImage::is_valid(), nout, read_source_image(), x, xelval, and y.

Referenced by post_txa_file().

void TextureImage::consider_grayscale  )  [private]
 

Definition at line 1026 of file textureImage.cxx.

References _ever_read_image, _forced_grayscale, ImageFile::_properties, _read_source_image, TextureProperties::force_grayscale(), PNMImageHeader::get_x_size(), PNMImage::get_xel_val(), PNMImageHeader::get_y_size(), PNMImage::is_valid(), PPM_GETB, PPM_GETG, PPM_GETR, read_source_image(), v, x, xel, and y.

Referenced by post_txa_file().

void TextureImage::copy_new_dests const Dests a,
const Dests b
[private]
 

Definition at line 1182 of file textureImage.cxx.

References a, and b.

Referenced by copy_unplaced().

void TextureImage::copy_unplaced bool  redo_all  ) 
 

Definition at line 649 of file textureImage.cxx.

References _dests, _placement, copy_new_dests(), ImageFile::get_filename(), TexturePlacement::get_omit_reason(), Filename::make_canonical(), NULL, OR_none, OR_unknown, remove_old_dests(), and TexturePlacement::set_dest().

void TextureImage::determine_placement_size  ) 
 

Definition at line 407 of file textureImage.cxx.

References _placement, and TexturePlacement::determine_size().

void TextureImage::fillin DatagramIterator scan,
BamReader manager
[protected]
 

Reimplemented from ImageFile.

Definition at line 1373 of file textureImage.cxx.

References _actual_assigned_groups, _alpha_bits, _alpha_mode, _ever_read_image, _forced_grayscale, _is_surprise, _num_dests, _num_placement, _num_sources, PaletteGroups::fillin(), ImageFile::fillin(), DatagramIterator::get_bool(), DatagramIterator::get_int16(), DatagramIterator::get_string(), DatagramIterator::get_uint32(), DatagramIterator::get_uint8(), BamReader::read_pointers(), and Namable::set_name().

Referenced by make_TextureImage().

void TextureImage::force_replace  ) 
 

Definition at line 227 of file textureImage.cxx.

References _placement.

Referenced by post_txa_file().

EggRenderMode::AlphaMode TextureImage::get_alpha_mode  )  const
 

Definition at line 494 of file textureImage.cxx.

References _alpha_mode.

TypeHandle TextureImage::get_class_type void   )  [inline, static]
 

Reimplemented from Namable.

Definition at line 171 of file textureImage.h.

References _type_handle.

Referenced by get_type(), and register_with_read_factory().

double TextureImage::get_coverage_threshold  )  const
 

Definition at line 438 of file textureImage.cxx.

References TextureRequest::_coverage_threshold, and _request.

Referenced by TexturePlacement::determine_size().

const PaletteGroups & TextureImage::get_groups  )  const
 

Definition at line 195 of file textureImage.cxx.

References _actual_assigned_groups.

int TextureImage::get_margin  )  const
 

Definition at line 451 of file textureImage.cxx.

References TextureRequest::_margin, and _request.

Referenced by TexturePlacement::compute_size_from_uvs().

bool TextureImage::get_omit  )  const
 

Definition at line 423 of file textureImage.cxx.

References TextureRequest::_omit, and _request.

Referenced by TexturePlacement::determine_size().

TexturePlacement * TextureImage::get_placement PaletteGroup group  )  const
 

Definition at line 208 of file textureImage.cxx.

References _placement, and NULL.

SourceTextureImage * TextureImage::get_preferred_source  ) 
 

Definition at line 539 of file textureImage.cxx.

References _preferred_source, _sources, Filename::compare_timestamps(), ImageFile::exists(), SourceTextureImage::get_egg_count(), ImageFile::get_filename(), SourceTextureImage::get_size(), ImageFile::get_x_size(), ImageFile::get_y_size(), and NULL.

Referenced by is_newer_than(), post_txa_file(), pre_txa_file(), read_header(), read_source_image(), PaletteImage::update_image(), and write_scale_info().

SourceTextureImage * TextureImage::get_source const Filename filename,
const Filename alpha_filename,
int  alpha_file_channel
 

Definition at line 509 of file textureImage.cxx.

References _preferred_source, _read_source_image, _sources, get_source_key(), and NULL.

string TextureImage::get_source_key const Filename filename,
const Filename alpha_filename,
int  alpha_file_channel
[private]
 

Definition at line 1221 of file textureImage.cxx.

References a, format_string(), Filename::get_fullpath(), and FilenameUnifier::make_bam_filename().

Referenced by complete_pointers(), and get_source().

virtual TypeHandle TextureImage::get_type void   )  const [inline, virtual]
 

Reimplemented from ImageFile.

Definition at line 181 of file textureImage.h.

References get_class_type().

bool TextureImage::got_txa_file  )  const
 

Definition at line 394 of file textureImage.cxx.

References _got_txa_file.

void TextureImage::init_type void   )  [inline, static]
 

Reimplemented from Namable.

Definition at line 174 of file textureImage.h.

References _type_handle, Namable::get_class_type(), ImageFile::get_class_type(), Namable::init_type(), ImageFile::init_type(), and register_type().

Referenced by ConfigureFn().

bool TextureImage::is_newer_than const Filename reference_filename  ) 
 

Definition at line 751 of file textureImage.cxx.

References _read_source_image, Filename::compare_timestamps(), ImageFile::get_filename(), get_preferred_source(), and NULL.

bool TextureImage::is_surprise  )  const
 

Definition at line 463 of file textureImage.cxx.

References _is_surprise, and _placement.

bool TextureImage::is_used  )  const
 

Definition at line 481 of file textureImage.cxx.

References _placement.

TypedWritable * TextureImage::make_TextureImage const FactoryParams params  )  [static, protected]
 

Definition at line 1355 of file textureImage.cxx.

References fillin(), params, and parse_params().

Referenced by register_with_read_factory().

void TextureImage::mark_eggs_stale  ) 
 

Definition at line 244 of file textureImage.cxx.

References _placement.

Referenced by post_txa_file().

void TextureImage::note_egg_file EggFile egg_file  ) 
 

Definition at line 65 of file textureImage.cxx.

References _egg_files, PaletteGroups::empty(), EggFile::get_complete_groups(), and nassertv.

void TextureImage::post_txa_file  ) 
 

Definition at line 286 of file textureImage.cxx.

References _alpha_mode, TextureRequest::_alpha_mode, TextureProperties::_alpha_type, TextureRequest::_anisotropic_degree, TextureProperties::_anisotropic_degree, TextureProperties::_color_type, TextureRequest::_force_format, TextureProperties::_force_format, TextureProperties::_format, TextureRequest::_format, TextureRequest::_generic_format, TextureProperties::_generic_format, TextureRequest::_got_num_channels, TextureRequest::_got_size, _got_txa_file, TextureProperties::_magfilter, TextureRequest::_magfilter, TextureProperties::_minfilter, TextureRequest::_minfilter, TextureRequest::_num_channels, _pre_txa_alpha_mode, _pre_txa_properties, TextureRequest::_properties, ImageFile::_properties, _request, ImageFile::_size_known, TextureRequest::_x_size, ImageFile::_x_size, TextureRequest::_y_size, ImageFile::_y_size, EggRenderMode::AM_unspecified, consider_alpha(), consider_grayscale(), TextureProperties::egg_properties_match(), EggTexture::F_unspecified, force_replace(), EggTexture::FT_unspecified, TextureProperties::fully_define(), TextureProperties::get_num_channels(), ImageFile::get_num_channels(), get_preferred_source(), SourceTextureImage::get_size(), ImageFile::get_x_size(), ImageFile::get_y_size(), TextureProperties::has_num_channels(), mark_eggs_stale(), NULL, and TextureProperties::set_num_channels().

void TextureImage::pre_txa_file  ) 
 

Definition at line 258 of file textureImage.cxx.

References _alpha_mode, _is_surprise, _pre_txa_alpha_mode, _pre_txa_properties, ImageFile::_properties, _request, EggRenderMode::AM_unspecified, get_preferred_source(), ImageFile::get_properties(), NULL, and TextureRequest::pre_txa_file().

void TextureImage::read_header  ) 
 

Definition at line 734 of file textureImage.cxx.

References _read_source_image, get_preferred_source(), NULL, and SourceTextureImage::read_header().

const PNMImage & TextureImage::read_source_image  ) 
 

Definition at line 713 of file textureImage.cxx.

References _ever_read_image, _read_source_image, _source_image, get_preferred_source(), NULL, and ImageFile::read().

Referenced by consider_alpha(), consider_grayscale(), and TexturePlacement::fill_image().

void TextureImage::register_with_read_factory  )  [static]
 

Definition at line 1237 of file textureImage.cxx.

References get_class_type(), BamReader::get_factory(), and make_TextureImage().

Referenced by ConfigureFn().

void TextureImage::remove_old_dests const Dests a,
const Dests b
[private]
 

Definition at line 1139 of file textureImage.cxx.

References a, and b.

Referenced by copy_unplaced().

void TextureImage::write_datagram BamWriter writer,
Datagram datagram
[virtual]
 

Reimplemented from ImageFile.

Definition at line 1250 of file textureImage.cxx.

References _actual_assigned_groups, _alpha_bits, _alpha_mode, _dests, _ever_read_image, _forced_grayscale, _is_surprise, _placement, _sources, Datagram::add_bool(), Datagram::add_int16(), Datagram::add_string(), Datagram::add_uint32(), Datagram::add_uint8(), Namable::get_name(), PaletteGroups::write_datagram(), ImageFile::write_datagram(), and writer().

void TextureImage::write_scale_info ostream &  out,
int  indent_level = 0
 

Definition at line 843 of file textureImage.cxx.

References _placement, TexturePlacement::get_dest(), TexturePlacement::get_image(), Namable::get_name(), ImageFile::get_num_channels(), TexturePlacement::get_omit_reason(), get_preferred_source(), ImageFile::get_x_size(), ImageFile::get_y_size(), image, indent(), ImageFile::is_size_known(), FilenameUnifier::make_user_filename(), nassertv, NULL, OR_none, OR_unknown, and scale.

void TextureImage::write_source_pathnames ostream &  out,
int  indent_level = 0
const
 

Definition at line 771 of file textureImage.cxx.

References _actual_assigned_groups, _egg_files, _explicitly_assigned_groups, _placement, _sources, PaletteGroups::empty(), EggFile::get_default_group(), SourceTextureImage::get_egg_count(), EggFile::get_explicit_groups(), Namable::get_name(), TextureProperties::get_num_channels(), ImageFile::get_properties(), ImageFile::get_x_size(), ImageFile::get_y_size(), TextureProperties::has_num_channels(), indent(), ImageFile::is_size_known(), and ImageFile::output_filename().


Friends And Related Function Documentation

friend class TxaLine [friend]
 

Definition at line 188 of file textureImage.h.


Member Data Documentation

PaletteGroups TextureImage::_actual_assigned_groups [private]
 

Definition at line 137 of file textureImage.h.

Referenced by assign_to_groups(), complete_pointers(), fillin(), get_groups(), write_datagram(), and write_source_pathnames().

int TextureImage::_alpha_bits [private]
 

Definition at line 133 of file textureImage.h.

Referenced by consider_alpha(), fillin(), TextureImage(), and write_datagram().

EggRenderMode::AlphaMode TextureImage::_alpha_mode [private]
 

Definition at line 134 of file textureImage.h.

Referenced by consider_alpha(), fillin(), get_alpha_mode(), post_txa_file(), pre_txa_file(), TextureImage(), and write_datagram().

Dests TextureImage::_dests [private]
 

Definition at line 145 of file textureImage.h.

Referenced by complete_pointers(), copy_unplaced(), and write_datagram().

EggFiles TextureImage::_egg_files [private]
 

Definition at line 139 of file textureImage.h.

Referenced by assign_groups(), note_egg_file(), and write_source_pathnames().

bool TextureImage::_ever_read_image [private]
 

Definition at line 122 of file textureImage.h.

Referenced by consider_alpha(), consider_grayscale(), fillin(), read_source_image(), TextureImage(), and write_datagram().

PaletteGroups TextureImage::_explicitly_assigned_groups [private]
 

Definition at line 136 of file textureImage.h.

Referenced by assign_groups(), and write_source_pathnames().

bool TextureImage::_forced_grayscale [private]
 

Definition at line 123 of file textureImage.h.

Referenced by consider_grayscale(), fillin(), TextureImage(), and write_datagram().

bool TextureImage::_got_txa_file [private]
 

Definition at line 149 of file textureImage.h.

Referenced by got_txa_file(), post_txa_file(), and TextureImage().

bool TextureImage::_is_surprise [private]
 

Definition at line 120 of file textureImage.h.

Referenced by fillin(), is_surprise(), pre_txa_file(), TextureImage(), and write_datagram().

int TextureImage::_num_dests [private]
 

Definition at line 168 of file textureImage.h.

Referenced by complete_pointers(), and fillin().

int TextureImage::_num_placement [private]
 

Definition at line 166 of file textureImage.h.

Referenced by complete_pointers(), and fillin().

int TextureImage::_num_sources [private]
 

Definition at line 167 of file textureImage.h.

Referenced by complete_pointers(), and fillin().

Placement TextureImage::_placement [private]
 

Definition at line 142 of file textureImage.h.

Referenced by assign_to_groups(), complete_pointers(), copy_unplaced(), determine_placement_size(), force_replace(), get_placement(), is_surprise(), is_used(), mark_eggs_stale(), write_datagram(), write_scale_info(), and write_source_pathnames().

EggRenderMode::AlphaMode TextureImage::_pre_txa_alpha_mode [private]
 

Definition at line 118 of file textureImage.h.

Referenced by post_txa_file(), and pre_txa_file().

TextureProperties TextureImage::_pre_txa_properties [private]
 

Definition at line 117 of file textureImage.h.

Referenced by post_txa_file(), and pre_txa_file().

SourceTextureImage* TextureImage::_preferred_source [private]
 

Definition at line 119 of file textureImage.h.

Referenced by get_preferred_source(), get_source(), and TextureImage().

bool TextureImage::_read_source_image [private]
 

Definition at line 147 of file textureImage.h.

Referenced by consider_alpha(), consider_grayscale(), get_source(), is_newer_than(), read_header(), read_source_image(), and TextureImage().

TextureRequest TextureImage::_request [private]
 

Definition at line 116 of file textureImage.h.

Referenced by get_coverage_threshold(), get_margin(), get_omit(), post_txa_file(), and pre_txa_file().

PNMImage TextureImage::_source_image [private]
 

Definition at line 148 of file textureImage.h.

Referenced by read_source_image().

Sources TextureImage::_sources [private]
 

Definition at line 144 of file textureImage.h.

Referenced by clear_source_basic_properties(), complete_pointers(), get_preferred_source(), get_source(), write_datagram(), and write_source_pathnames().

TypeHandle TextureImage::_type_handle [static, private]
 

Reimplemented from Namable.

Definition at line 37 of file textureImage.cxx.

Referenced by get_class_type(), and init_type().


The documentation for this class was generated from the following files:
Generated on Fri Apr 18 01:01:28 2003 for Panda-Tool by doxygen1.3