uvgVPCCenc 1.0.0
uvgVPCCenc is an open-source real-time V-PCC encoder library written in C++ from scratch.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
miniply::PLYReader Class Reference

#include <miniply.h>

Collaboration diagram for miniply::PLYReader:

Public Member Functions

 PLYReader (const char *filename)
 
 ~PLYReader ()
 
bool valid () const
 
bool has_element () const
 
const PLYElementelement () const
 
bool load_element ()
 
void next_element ()
 
PLYFileType file_type () const
 
int version_major () const
 
int version_minor () const
 
uint32_t num_elements () const
 
uint32_t find_element (const char *name) const
 
PLYElementget_element (uint32_t idx)
 
bool element_is (const char *name) const
 Check whether the current element has the given name.
 
uint32_t num_rows () const
 Number of rows in the current element.
 
uint32_t find_property (const char *name) const
 
bool find_properties (uint32_t propIdxs[], uint32_t numIdxs,...) const
 Equivalent to calling find_properties on the current element.
 
bool extract_properties (const uint32_t propIdxs[], uint32_t numProps, PLYPropertyType destType, void *dest) const
 
bool extract_properties_with_stride (const uint32_t propIdxs[], uint32_t numProps, PLYPropertyType destType, void *dest, uint32_t destStride) const
 
const uint32_t * get_list_counts (uint32_t propIdx) const
 
uint32_t sum_of_list_counts (uint32_t propIdx) const
 
const uint8_t * get_list_data (uint32_t propIdx) const
 
bool extract_list_property (uint32_t propIdx, PLYPropertyType destType, void *dest) const
 
uint32_t num_triangles (uint32_t propIdx) const
 
bool requires_triangulation (uint32_t propIdx) const
 
bool extract_triangles (uint32_t propIdx, const float pos[], uint32_t numVerts, PLYPropertyType destType, void *dest) const
 
bool find_pos (uint32_t propIdxs[3]) const
 
bool find_normal (uint32_t propIdxs[3]) const
 
bool find_texcoord (uint32_t propIdxs[2]) const
 
bool find_color (uint32_t propIdxs[3]) const
 
bool find_indices (uint32_t propIdxs[1]) const
 

Constructor & Destructor Documentation

◆ PLYReader()

miniply::PLYReader::PLYReader ( const char *  filename)

◆ ~PLYReader()

miniply::PLYReader::~PLYReader ( )

Member Function Documentation

◆ element()

const PLYElement * miniply::PLYReader::element ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ element_is()

bool miniply::PLYReader::element_is ( const char *  name) const

Check whether the current element has the given name.

Here is the call graph for this function:

◆ extract_list_property()

bool miniply::PLYReader::extract_list_property ( uint32_t  propIdx,
PLYPropertyType  destType,
void *  dest 
) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ extract_properties()

bool miniply::PLYReader::extract_properties ( const uint32_t  propIdxs[],
uint32_t  numProps,
PLYPropertyType  destType,
void *  dest 
) const

Copy the data for the specified properties into dest, which must be an array with at least enough space to hold all of the extracted column data. propIdxs is an array containing the indexes of the properties to copy; it has numProps elements.

destType specifies the data type for values stored in dest. All property values will be converted to this type if necessary.

This function does some checks up front to pick the most efficient code path for extracting the data. It considers: (a) whether any data conversion is required. (b) whether all property values to be extracted are in contiguous memory locations for any given item. (c) whether the data for all rows is contiguous in memory. In the best case it reduces to a single memcpy call. In the worst case we must iterate over all values to be copied, applying type conversions as we go.

Note that this function does not handle list-valued properties. Use extract_list_column() for those instead.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ extract_properties_with_stride()

bool miniply::PLYReader::extract_properties_with_stride ( const uint32_t  propIdxs[],
uint32_t  numProps,
PLYPropertyType  destType,
void *  dest,
uint32_t  destStride 
) const

The same as extract_properties, but does not require rows in the destination to be contiguous: destStride is the number of bytes between the start of one row and the start of the next row in the destination memory.

This is useful for when your destination is an array of structs where you cannot extract all of the properties with a single extract_properties call, e.g. when not all of the struct members have the same type, or when the data you're extracting is only a subset of the columns in each destination row.

This is a tiny bit slower than extract_properties. Wherever possible you should use extract_properties in preference to this method.

Here is the call graph for this function:

◆ extract_triangles()

bool miniply::PLYReader::extract_triangles ( uint32_t  propIdx,
const float  pos[],
uint32_t  numVerts,
PLYPropertyType  destType,
void *  dest 
) const
Here is the call graph for this function:

◆ file_type()

PLYFileType miniply::PLYReader::file_type ( ) const

◆ find_color()

bool miniply::PLYReader::find_color ( uint32_t  propIdxs[3]) const
Here is the call graph for this function:

◆ find_element()

uint32_t miniply::PLYReader::find_element ( const char *  name) const
Here is the call graph for this function:

◆ find_indices()

bool miniply::PLYReader::find_indices ( uint32_t  propIdxs[1]) const
Here is the call graph for this function:

◆ find_normal()

bool miniply::PLYReader::find_normal ( uint32_t  propIdxs[3]) const
Here is the call graph for this function:

◆ find_pos()

bool miniply::PLYReader::find_pos ( uint32_t  propIdxs[3]) const
Here is the call graph for this function:

◆ find_properties()

bool miniply::PLYReader::find_properties ( uint32_t  propIdxs[],
uint32_t  numIdxs,
  ... 
) const

Equivalent to calling find_properties on the current element.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_property()

uint32_t miniply::PLYReader::find_property ( const char *  name) const

Returns the index for the named property in the current element, or kInvalidIndex if it can't be found.

Here is the call graph for this function:

◆ find_texcoord()

bool miniply::PLYReader::find_texcoord ( uint32_t  propIdxs[2]) const
Here is the call graph for this function:

◆ get_element()

PLYElement * miniply::PLYReader::get_element ( uint32_t  idx)
Here is the call graph for this function:

◆ get_list_counts()

const uint32_t * miniply::PLYReader::get_list_counts ( uint32_t  propIdx) const

Get the array of item counts for a list property. Entry i in this array is the number of items in the ith list.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_list_data()

const uint8_t * miniply::PLYReader::get_list_data ( uint32_t  propIdx) const
Here is the call graph for this function:

◆ has_element()

bool miniply::PLYReader::has_element ( ) const
Here is the caller graph for this function:

◆ load_element()

bool miniply::PLYReader::load_element ( )
Here is the call graph for this function:

◆ next_element()

void miniply::PLYReader::next_element ( )
Here is the call graph for this function:

◆ num_elements()

uint32_t miniply::PLYReader::num_elements ( ) const
Here is the caller graph for this function:

◆ num_rows()

uint32_t miniply::PLYReader::num_rows ( ) const

Number of rows in the current element.

Here is the call graph for this function:

◆ num_triangles()

uint32_t miniply::PLYReader::num_triangles ( uint32_t  propIdx) const
Here is the call graph for this function:

◆ requires_triangulation()

bool miniply::PLYReader::requires_triangulation ( uint32_t  propIdx) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sum_of_list_counts()

uint32_t miniply::PLYReader::sum_of_list_counts ( uint32_t  propIdx) const

Get the sum of all item counts for a list property. This can be useful to determine how big a destination array you'll need for a call to extract_list_property. It's equivalent to summing up all the values in the array returned by get_list_counts, but faster.

Here is the call graph for this function:

◆ valid()

bool miniply::PLYReader::valid ( ) const

◆ version_major()

int miniply::PLYReader::version_major ( ) const

◆ version_minor()

int miniply::PLYReader::version_minor ( ) const

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