![]() |
v0.4.1
Fast, portable C library for geometry input/output
|
Provides API to handle output operations with the AMF file format. More...
Data Structures | |
struct | gmio_amf_metadata |
Addition information about an element(eg name, description, ... More... | |
struct | gmio_amf_color |
Red, green, blue and alpha channels as numbers or formulas in [0,1]. More... | |
struct | gmio_amf_material |
struct | gmio_amf_composite |
Proportion of the composition of another material. More... | |
struct | gmio_amf_vertex |
Vertex within a mesh. More... | |
struct | gmio_amf_edge |
Edge within a mesh, for curved triangles. More... | |
struct | gmio_amf_texmap |
struct | gmio_amf_triangle |
struct | gmio_amf_volume |
Closed volume of an object. More... | |
struct | gmio_amf_mesh |
Triangular mesh referencing a set of vertices. More... | |
struct | gmio_amf_object |
Volume or volumes of material. More... | |
struct | gmio_amf_constellation |
Combination of objects. More... | |
struct | gmio_amf_instance |
Position of an object in a constellation. More... | |
struct | gmio_amf_texture |
struct | gmio_amf_object_mesh_element_index |
Index of an element(vertex, edge or volume) within a mesh. More... | |
struct | gmio_amf_document |
Provides an interface for accessing the underlying(hidden) user AMF data. More... | |
struct | gmio_amf_write_options |
Options of function gmio_amf_write() More... | |
Enumerations | |
enum | gmio_amf_volume_type |
enum | gmio_amf_texture_type |
enum | gmio_amf_unit |
Units supported by AMF. More... | |
enum | gmio_amf_document_element |
The direct elements of an AMF document(ie inside <amf>...</amf> ) More... | |
enum | gmio_amf_mesh_element |
The direct elements of an AMF mesh(ie inside <mesh>...</mesh> ) More... | |
enum | |
GMIO_AMF_ERROR_TAG Byte-mask to tag(identify) AMF-specific error codes More... | |
enum | gmio_amf_error |
Specific error codes reported by AMF read/write functions. More... | |
Functions | |
int | gmio_amf_write (struct gmio_stream *stream, const struct gmio_amf_document *doc, const struct gmio_amf_write_options *opts) |
Writes AMF document to stream. More... | |
int | gmio_amf_write_file (const char *filepath, const struct gmio_amf_document *doc, const struct gmio_amf_write_options *opts) |
Writes AMF document to stream. More... | |
Provides API to handle output operations with the AMF file format.
In addition, the gmioAMF module has the following advatanges:
In this module, the name of all entities(structures, functions, ...) are prefixed with gmio_amf
Functions | Structures | |
---|---|---|
Write | gmio_amf_write() gmio_amf_write_file() | gmio_amf_document gmio_amf_write_options |
struct gmio_amf_metadata |
struct gmio_amf_color |
struct gmio_amf_material |
Data Fields | ||
---|---|---|
uint32_t | id | |
struct gmio_amf_color | color | |
uint32_t | composite_count | |
uint32_t | metadata_count |
struct gmio_amf_composite |
struct gmio_amf_vertex |
Vertex within a mesh.
Data Fields | ||
---|---|---|
struct gmio_vec3d | coords | |
bool | has_normal | |
struct gmio_vec3d | normal | |
bool | has_color | |
struct gmio_amf_color | color | |
uint32_t | metadata_count |
struct gmio_amf_edge |
Edge within a mesh, for curved triangles.
Data Fields | ||
---|---|---|
uint32_t | v1 | |
uint32_t | v2 | |
struct gmio_vec3d | d1 | |
struct gmio_vec3d | d2 |
struct gmio_amf_texmap |
Data Fields | ||
---|---|---|
uint32_t | rtexid | |
uint32_t | gtexid | |
uint32_t | btexid | |
uint32_t | atexid | |
struct gmio_vec3d | utex | |
struct gmio_vec3d | vtex | |
bool | has_wtex | |
struct gmio_vec3d | wtex |
struct gmio_amf_triangle |
Data Fields | ||
---|---|---|
uint32_t | v1 | |
uint32_t | v2 | |
uint32_t | v3 | |
bool | has_texmap | |
struct gmio_amf_texmap | texmap | |
bool | has_color | |
struct gmio_amf_color | color |
struct gmio_amf_volume |
Closed volume of an object.
Data Fields | ||
---|---|---|
uint32_t | materialid | |
enum gmio_amf_volume_type | type | |
uint32_t | triangle_count | Should be >= 4. |
uint32_t | metadata_count | |
bool | has_color | |
struct gmio_amf_color | color |
struct gmio_amf_mesh |
struct gmio_amf_object |
Volume or volumes of material.
Data Fields | ||
---|---|---|
uint32_t | id | |
uint32_t | mesh_count | |
uint32_t | metadata_count | |
bool | has_color | |
struct gmio_amf_color | color |
struct gmio_amf_constellation |
struct gmio_amf_instance |
Position of an object in a constellation.
Data Fields | ||
---|---|---|
uint32_t | objectid | |
struct gmio_vec3d | delta | |
struct gmio_vec3d | rot | Coordinates in degrees (-360 <= coord < 360) |
struct gmio_amf_texture |
Data Fields | ||
---|---|---|
uint32_t | id | |
uint32_t | width | |
uint32_t | height | |
uint32_t | depth | |
bool | tiled | |
enum gmio_amf_texture_type | type | |
struct gmio_memblock | binary_data | Will be converted to base64. |
struct gmio_amf_object_mesh_element_index |
Index of an element(vertex, edge or volume) within a mesh.
Data Fields | ||
---|---|---|
uint32_t | object_index | Index of the object that owns the mesh. |
uint32_t | mesh_index | Index of the mesh that owns element. |
uint32_t | value | Index of the inner element. |
enum gmio_amf_mesh_element | element_type | Type of the inner element. |
struct gmio_amf_write_options |
Options of function gmio_amf_write()
Initialising gmio_amf_write_options with {0}
(or {}
in C++) is the convenient way to set default values(passing NULL
to gmio_amf_write() has the same effect).
Data Fields | ||
---|---|---|
struct gmio_memblock | stream_memblock |
Used by the stream to bufferize I/O operations. If null, then a temporary memblock is created with the global default constructor function |
struct gmio_task_iface | task_iface | Optional interface by which the I/O operation can be controlled. |
enum gmio_float_text_format | float64_format |
The format used when writting double values as strings. Defaults to |
uint8_t | float64_prec |
The maximum number of significant digits when writting double values. Defaults to |
bool | create_zip_archive | Flag to write AMF document in ZIP archive containing one file entry. |
const char * | zip_entry_filename |
Filename of the single AMF entry within the ZIP archive. Applicable only if |
uint16_t | zip_entry_filename_len |
Filename length of the single AMF entry within the ZIP archive. Applicable only if |
bool | dont_use_zip64_extensions |
Flag to disable use of the Zip64 format extensions. Applicable only if |
struct gmio_zlib_compress_options | z_compress_options |
Options for the zlib(deflate) compression. Applicable only if |
enum gmio_amf_volume_type |
enum gmio_amf_unit |
anonymous enum |
enum gmio_amf_error |
Specific error codes reported by AMF read/write functions.
Enumerator | |
---|---|
GMIO_AMF_ERROR_NULL_DOCUMENT |
The input gmio_amf_document is |
GMIO_AMF_ERROR_NULL_FUNC_GET_DOCUMENT_ELEMENT |
Function pointer gmio_amf_document::func_get_document_element is |
GMIO_AMF_ERROR_NULL_FUNC_GET_CONSTELLATION_INSTANCE |
Function pointer gmio_amf_document::func_get_constellation_instance is |
GMIO_AMF_ERROR_NULL_FUNC_GET_OBJECT_MESH |
Function pointer gmio_amf_document::func_get_object_mesh is |
GMIO_AMF_ERROR_NULL_FUNC_GET_OBJECT_MESH_ELEMENT |
Function pointer gmio_amf_document::func_get_object_mesh_element is |
GMIO_AMF_ERROR_NULL_FUNC_GET_OBJECT_MESH_VOLUME_TRIANGLE |
Function pointer gmio_amf_document::func_get_object_mesh_volume_triangle is |
GMIO_AMF_ERROR_NULL_FUNC_GET_DOCUMENT_ELEMENT_METADATA |
Function pointer gmio_amf_document::func_get_document_element_metadata is |
GMIO_AMF_ERROR_NULL_FUNC_GET_MATERIAL_COMPOSITE |
Function pointer gmio_amf_document::func_get_material_composite is |
GMIO_AMF_ERROR_NULL_FUNC_GET_OBJECT_MESH_ELEMENT_METADATA |
Function pointer gmio_amf_document::func_get_object_mesh_element_metadata is |
int gmio_amf_write | ( | struct gmio_stream * | stream, |
const struct gmio_amf_document * | doc, | ||
const struct gmio_amf_write_options * | opts | ||
) |
Writes AMF document to stream.
When gmio_amf_write_options::create_zip_archive is ON
then a compressed ZIP archive is written on the fly. At the end it will contains a single file entry containing the AMF document.
In case of compression the first half of the memory pointed to by gmio_amf_write_options::stream_memblock is used internally as a stream buffer and the second half is employed as a compression buffer for zlib.
If specified, gmio_amf_write_options::task_iface::func_is_stop_requested is checked each time the gmio_amf_write_options::stream_memblock is about to be flushed to the stream.
stream != NULL
doc != NULL
options
may be NULL
in this case default values are used
int gmio_amf_write_file | ( | const char * | filepath, |
const struct gmio_amf_document * | doc, | ||
const struct gmio_amf_write_options * | opts | ||
) |
Writes AMF document to stream.
This is just a facility function over gmio_amf_write(). The internal stream object is created to read file at filepath
In case gmio_amf_write_options::create_zip_archive is ON
and zip_entry_filename
is NULL
or empty then the ZIP entry filename is automatically set to the basename of filepath
suffixed by .amf
filepath != NULL
fopen()
so filepath
shall follow the file name specifications of the running environment doc != NULL
Fougue © 2017 | Last Update: Fri Apr 14 2017 |