Package pyffi :: Package formats :: Package tga :: Class TgaFormat :: Class Data
[hide private]
[frames] | no frames]

Class Data

source code

            object --+            
                     |            
utils.graph.DetailNode --+        
                         |        
    utils.graph.GlobalNode --+    
                             |    
 object_models.FileFormat.Data --+
                                 |
                                TgaFormat.Data

Base class for representing data in a particular format. Override this class to implement reading and writing.
Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
inspect(self, stream)
Quick heuristic check if stream contains Targa data, by looking at the first 18 bytes.
source code
 
read(self, stream)
Read a tga file.
source code
 
write(self, stream)
Write a tga file.
source code
 
get_global_child_nodes(self, edge_filter=(True, True))
Generator which yields all children of this item in the global view, of given edge type (default is edges of type 0).
source code
 
get_global_child_names(self, edge_filter=(True, True)) source code

Inherited from utils.graph.GlobalNode: get_global_child_edge_types, get_global_display, get_global_iterator

Inherited from utils.graph.DetailNode: get_detail_child_edge_types, get_detail_child_names, get_detail_child_nodes, get_detail_display, get_detail_iterator, replace_global_node

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from object_models.FileFormat.Data: user_version, version

Inherited from object_models.FileFormat.Data (private): _byte_order

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)

inspect(self, stream)

source code 
Quick heuristic check if stream contains Targa data, by looking at the first 18 bytes.
Parameters:
  • stream (file) - The stream to inspect.
Returns:
True if stream is of particular format, False otherwise.
Overrides: object_models.FileFormat.Data.inspect

read(self, stream)

source code 
Read a tga file.
Parameters:
  • stream (file) - The stream from which to read.
Overrides: object_models.FileFormat.Data.read

write(self, stream)

source code 
Write a tga file.
Parameters:
  • stream (file) - The stream to write to.
Overrides: object_models.FileFormat.Data.write

get_global_child_nodes(self, edge_filter=(True, True))

source code 

Generator which yields all children of this item in the global view, of given edge type (default is edges of type 0).

Override this method.

Returns:
Generator for global node children.
Overrides: utils.graph.GlobalNode.get_global_child_nodes
(inherited documentation)