ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cloudViewer::t::io Namespace Reference

Classes

struct  PCLPointField
 
struct  PCDHeader
 
struct  ReadAttributePtr
 
struct  WriteAttributePtr
 
class  DepthNoiseSimulator
 
class  CharVector
 
class  NumpyArray
 
class  RealSenseSensor
 RealSense camera discovery, configuration, streaming and recording. More...
 
class  RealSenseSensorConfig
 
struct  RealSenseValidConfigs
 
class  RSBagReader
 
class  RGBDSensor
 Interface class for control of RGBD cameras. More...
 
class  RGBDVideoMetadata
 RGBD video metadata. More...
 
class  RGBDVideoReader
 

Enumerations

enum class  PCDDataType { ASCII = 0 , BINARY = 1 , BINARY_COMPRESSED = 2 }
 
enum class  SensorType { AZURE_KINECT = 0 , REAL_SENSE = 1 }
 

Functions

bool ReadTriangleMeshUsingASSIMP (const std::string &filename, geometry::TriangleMesh &mesh, const cloudViewer::io::ReadTriangleMeshOptions &params)
 
static void SetTextureMaterialProperty (aiMaterial *mat, aiScene *scene, int texture_idx, aiTextureType tt, t::geometry::Image &img)
 
bool WriteTriangleMeshUsingASSIMP (const std::string &filename, const geometry::TriangleMesh &mesh, const bool write_ascii, const bool compressed, const bool write_vertex_normals, const bool write_vertex_colors, const bool write_triangle_uvs, const bool print_progress)
 
bool ReadImageFromJPG (const std::string &filename, geometry::Image &image)
 
bool WriteImageToJPG (const std::string &filename, const geometry::Image &image, int quality)
 
static core::Dtype GetDtypeFromPCDHeaderField (char type, int size)
 
static bool InitializeHeader (PCDHeader &header)
 
static bool ReadPCDHeader (FILE *file, PCDHeader &header)
 
static void ReadASCIIPCDColorsFromField (ReadAttributePtr &attr, const PCLPointField &field, const char *data_ptr, const int index)
 
template<typename scalar_t >
static void UnpackASCIIPCDElement (scalar_t &data, const char *data_ptr)=delete
 
template<>
void UnpackASCIIPCDElement< float > (float &data, const char *data_ptr)
 
template<>
void UnpackASCIIPCDElement< double > (double &data, const char *data_ptr)
 
template<>
void UnpackASCIIPCDElement< std::int8_t > (std::int8_t &data, const char *data_ptr)
 
template<>
void UnpackASCIIPCDElement< std::int16_t > (std::int16_t &data, const char *data_ptr)
 
template<>
void UnpackASCIIPCDElement< std::int32_t > (std::int32_t &data, const char *data_ptr)
 
template<>
void UnpackASCIIPCDElement< std::int64_t > (std::int64_t &data, const char *data_ptr)
 
template<>
void UnpackASCIIPCDElement< std::uint8_t > (std::uint8_t &data, const char *data_ptr)
 
template<>
void UnpackASCIIPCDElement< std::uint16_t > (std::uint16_t &data, const char *data_ptr)
 
template<>
void UnpackASCIIPCDElement< std::uint32_t > (std::uint32_t &data, const char *data_ptr)
 
template<>
void UnpackASCIIPCDElement< std::uint64_t > (std::uint64_t &data, const char *data_ptr)
 
static void ReadASCIIPCDElementsFromField (ReadAttributePtr &attr, const PCLPointField &field, const char *data_ptr, const int index)
 
static void ReadBinaryPCDColorsFromField (ReadAttributePtr &attr, const PCLPointField &field, const void *data_ptr, const int index)
 
static void ReadBinaryPCDElementsFromField (ReadAttributePtr &attr, const PCLPointField &field, const void *data_ptr, const int index)
 
static bool ReadPCDData (FILE *file, PCDHeader &header, t::geometry::PointCloud &pointcloud, const ReadPointCloudOption &params)
 
static void SetPCDHeaderFieldTypeAndSizeFromDtype (const core::Dtype &dtype, PCLPointField &field)
 
static bool GenerateHeader (const t::geometry::PointCloud &pointcloud, const bool write_ascii, const bool compressed, PCDHeader &header)
 
static bool WritePCDHeader (FILE *file, const PCDHeader &header)
 
template<typename scalar_t >
static void ColorToUint8 (const scalar_t *input_color, std::uint8_t *output_color)
 
template<>
void ColorToUint8< float > (const float *input_color, std::uint8_t *output_color)
 
template<>
void ColorToUint8< double > (const double *input_color, std::uint8_t *output_color)
 
template<>
void ColorToUint8< std::uint8_t > (const std::uint8_t *input_color, std::uint8_t *output_color)
 
template<>
void ColorToUint8< std::uint16_t > (const std::uint16_t *input_color, std::uint8_t *output_color)
 
template<>
void ColorToUint8< std::uint32_t > (const std::uint32_t *input_color, std::uint8_t *output_color)
 
static core::Tensor PackColorsToFloat (const core::Tensor &colors_contiguous)
 
template<typename scalar_t >
static int WriteElementDataToFileASCII (const scalar_t &data, FILE *file)=delete
 
template<>
int WriteElementDataToFileASCII< float > (const float &data, FILE *file)
 
template<>
int WriteElementDataToFileASCII< double > (const double &data, FILE *file)
 
template<>
int WriteElementDataToFileASCII< std::int8_t > (const std::int8_t &data, FILE *file)
 
template<>
int WriteElementDataToFileASCII< std::int16_t > (const std::int16_t &data, FILE *file)
 
template<>
int WriteElementDataToFileASCII< std::int32_t > (const std::int32_t &data, FILE *file)
 
template<>
int WriteElementDataToFileASCII< std::int64_t > (const std::int64_t &data, FILE *file)
 
template<>
int WriteElementDataToFileASCII< std::uint8_t > (const std::uint8_t &data, FILE *file)
 
template<>
int WriteElementDataToFileASCII< std::uint16_t > (const std::uint16_t &data, FILE *file)
 
template<>
int WriteElementDataToFileASCII< std::uint32_t > (const std::uint32_t &data, FILE *file)
 
template<>
int WriteElementDataToFileASCII< std::uint64_t > (const std::uint64_t &data, FILE *file)
 
static bool WritePCDData (FILE *file, const PCDHeader &header, const geometry::PointCloud &pointcloud, const WritePointCloudOption &params)
 
bool ReadPointCloudFromPCD (const std::string &filename, t::geometry::PointCloud &pointcloud, const ReadPointCloudOption &params)
 
bool WritePointCloudToPCD (const std::string &filename, const geometry::PointCloud &pointcloud, const WritePointCloudOption &params)
 
bool ReadPointCloudFromPLY (const std::string &filename, geometry::PointCloud &pointcloud, const cloudViewer::io::ReadPointCloudOption &params)
 
bool WritePointCloudToPLY (const std::string &filename, const geometry::PointCloud &pointcloud, const cloudViewer::io::WritePointCloudOption &params)
 
static void SetPNGImageFromImage (const geometry::Image &image, int quality, png_image &pngimage)
 
bool ReadImageFromPNG (const std::string &filename, geometry::Image &image)
 
bool WriteImageToPNG (const std::string &filename, const geometry::Image &image, int quality)
 
bool WriteImageToPNGInMemory (std::vector< uint8_t > &buffer, const t::geometry::Image &image, int quality)
 
bool ReadPointCloudFromPTS (const std::string &filename, geometry::PointCloud &pointcloud, const ReadPointCloudOption &params)
 
core::Tensor ConvertColorTensorToUint8 (const core::Tensor &color_in)
 
bool WritePointCloudToPTS (const std::string &filename, const geometry::PointCloud &pointcloud, const WritePointCloudOption &params)
 
bool ReadPointCloudFromSPLAT (const std::string &filename, geometry::PointCloud &pointcloud, const cloudViewer::io::ReadPointCloudOption &params)
 
bool WritePointCloudToSPLAT (const std::string &filename, const geometry::PointCloud &pointcloud, const cloudViewer::io::WritePointCloudOption &params)
 
cloudViewer::io::FileGeometry ReadFileGeometryTypeTXT (const std::string &path)
 
bool ReadPointCloudFromTXT (const std::string &filename, geometry::PointCloud &pointcloud, const cloudViewer::io::ReadPointCloudOption &params)
 
bool WritePointCloudToTXT (const std::string &filename, const geometry::PointCloud &pointcloud, const cloudViewer::io::WritePointCloudOption &params)
 
cloudViewer::io::FileGeometry ReadFileGeometryTypeXYZI (const std::string &path)
 
bool ReadPointCloudFromXYZI (const std::string &filename, geometry::PointCloud &pointcloud, const cloudViewer::io::ReadPointCloudOption &params)
 
bool WritePointCloudToXYZI (const std::string &filename, const geometry::PointCloud &pointcloud, const cloudViewer::io::WritePointCloudOption &params)
 
void WriteHashMap (const std::string &file_name, const core::HashMap &hashmap)
 
core::HashMap ReadHashMap (const std::string &file_name)
 
std::shared_ptr< geometry::ImageCreateImageFromFile (const std::string &filename)
 
bool ReadImage (const std::string &filename, geometry::Image &image)
 
bool WriteImage (const std::string &filename, const geometry::Image &image, int quality)
 
static char BigEndianChar ()
 
static char DtypeToChar (const core::Dtype &dtype)
 
static CharVector CreateNumpyHeader (const core::SizeVector &shape, const core::Dtype &dtype)
 
static std::tuple< core::SizeVector, char, int64_t, bool > ParsePropertyDict (const std::string &header)
 
static size_t ParseNpyPreamble (const char *preamble)
 
static std::tuple< core::SizeVector, char, int64_t, bool > ParseNpyHeaderFromFile (FILE *fp)
 
static std::tuple< core::SizeVector, char, int64_t, bool > ParseNpyHeaderFromBuffer (const char *buffer)
 
static std::tuple< size_t, size_t, size_t > ParseZipFooter (FILE *fp)
 
static void WriteNpzOneTensor (const std::string &file_name, const std::string &tensor_name, const core::Tensor &tensor, bool append)
 
static void WriteNpzEmpty (const std::string &file_name)
 
static NumpyArray CreateNumpyArrayFromFile (FILE *fp)
 
static NumpyArray CreateNumpyArrayFromCompressedFile (FILE *fp, uint32_t num_compressed_bytes, uint32_t num_uncompressed_bytes)
 
core::Tensor ReadNpy (const std::string &file_name)
 
void WriteNpy (const std::string &file_name, const core::Tensor &tensor)
 
std::unordered_map< std::string, core::TensorReadNpz (const std::string &file_name)
 
void WriteNpz (const std::string &file_name, const std::unordered_map< std::string, core::Tensor > &tensor_map)
 
std::shared_ptr< geometry::PointCloudCreatePointCloudFromFile (const std::string &filename, const std::string &format, bool print_progress)
 
bool ReadPointCloud (const std::string &filename, geometry::PointCloud &pointcloud, const cloudViewer::io::ReadPointCloudOption &params)
 
bool ReadPointCloud (const std::string &filename, geometry::PointCloud &pointcloud, const std::string &file_format, bool remove_nan_points, bool remove_infinite_points, bool print_progress)
 
bool WritePointCloud (const std::string &filename, const geometry::PointCloud &pointcloud, const cloudViewer::io::WritePointCloudOption &params)
 
bool WritePointCloud (const std::string &filename, const geometry::PointCloud &pointcloud, bool write_ascii, bool compressed, bool print_progress)
 
bool ReadPointCloudFromNPZ (const std::string &filename, geometry::PointCloud &pointcloud, const ReadPointCloudOption &params)
 
bool WritePointCloudToNPZ (const std::string &filename, const geometry::PointCloud &pointcloud, const WritePointCloudOption &params)
 
 STRINGIFY_ENUM (rs2_stream, { {RS2_STREAM_ANY, "RS2_STREAM_ANY"}, {RS2_STREAM_DEPTH, "RS2_STREAM_DEPTH"}, {RS2_STREAM_COLOR, "RS2_STREAM_COLOR"}, {RS2_STREAM_INFRARED, "RS2_STREAM_INFRARED"}, {RS2_STREAM_FISHEYE, "RS2_STREAM_FISHEYE"}, {RS2_STREAM_GYRO, "RS2_STREAM_GYRO"}, {RS2_STREAM_ACCEL, "RS2_STREAM_ACCEL"}, {RS2_STREAM_GPIO, "RS2_STREAM_GPIO"}, {RS2_STREAM_POSE, "RS2_STREAM_POSE"}, {RS2_STREAM_CONFIDENCE, "RS2_STREAM_CONFIDENCE"} })
 RS2 stream types. More...
 
 STRINGIFY_ENUM (rs2_format, { {RS2_FORMAT_ANY, "RS2_FORMAT_ANY"}, {RS2_FORMAT_Z16, "RS2_FORMAT_Z16"}, {RS2_FORMAT_DISPARITY16, "RS2_FORMAT_DISPARITY16"}, {RS2_FORMAT_XYZ32F, "RS2_FORMAT_XYZ32F"}, {RS2_FORMAT_YUYV, "RS2_FORMAT_YUYV"}, {RS2_FORMAT_RGB8, "RS2_FORMAT_RGB8"}, {RS2_FORMAT_BGR8, "RS2_FORMAT_BGR8"}, {RS2_FORMAT_RGBA8, "RS2_FORMAT_RGBA8"}, {RS2_FORMAT_BGRA8, "RS2_FORMAT_BGRA8"}, {RS2_FORMAT_Y8, "RS2_FORMAT_Y8"}, {RS2_FORMAT_Y16, "RS2_FORMAT_Y16"}, {RS2_FORMAT_RAW10, "RS2_FORMAT_RAW10"}, {RS2_FORMAT_RAW16, "RS2_FORMAT_RAW16"}, {RS2_FORMAT_RAW8, "RS2_FORMAT_RAW8"}, {RS2_FORMAT_UYVY, "RS2_FORMAT_UYVY"}, {RS2_FORMAT_MOTION_RAW, "RS2_FORMAT_MOTION_RAW"}, {RS2_FORMAT_MOTION_XYZ32F, "RS2_FORMAT_MOTION_XYZ32F"}, {RS2_FORMAT_GPIO_RAW, "RS2_FORMAT_GPIO_RAW"}, {RS2_FORMAT_6DOF, "RS2_FORMAT_6DOF"}, {RS2_FORMAT_DISPARITY32, "RS2_FORMAT_DISPARITY32"}, {RS2_FORMAT_Y10BPACK, "RS2_FORMAT_Y10BPACK"}, {RS2_FORMAT_DISTANCE, "RS2_FORMAT_DISTANCE"}, {RS2_FORMAT_MJPEG, "RS2_FORMAT_MJPEG"}, {RS2_FORMAT_Y8I, "RS2_FORMAT_Y8I"}, {RS2_FORMAT_Y12I, "RS2_FORMAT_Y12I"}, {RS2_FORMAT_INZI, "RS2_FORMAT_INZI"}, {RS2_FORMAT_INVI, "RS2_FORMAT_INVI"}, {RS2_FORMAT_W10, "RS2_FORMAT_W10"}, {RS2_FORMAT_Z16H, "RS2_FORMAT_Z16H"} })
 RS2 pixel formats. More...
 
 STRINGIFY_ENUM (rs2_l500_visual_preset, { {RS2_L500_VISUAL_PRESET_DEFAULT, "RS2_L500_VISUAL_PRESET_DEFAULT"}, {RS2_L500_VISUAL_PRESET_CUSTOM, "RS2_L500_VISUAL_PRESET_CUSTOM"}, {RS2_L500_VISUAL_PRESET_NO_AMBIENT, "RS2_L500_VISUAL_PRESET_NO_AMBIENT"}, {RS2_L500_VISUAL_PRESET_LOW_AMBIENT, "RS2_L500_VISUAL_PRESET_LOW_AMBIENT"}, {RS2_L500_VISUAL_PRESET_MAX_RANGE, "RS2_L500_VISUAL_PRESET_MAX_RANGE"}, {RS2_L500_VISUAL_PRESET_SHORT_RANGE, "RS2_L500_VISUAL_PRESET_SHORT_RANGE"} })
 RS2 visual presets for L500 devices. More...
 
 STRINGIFY_ENUM (rs2_rs400_visual_preset, { {RS2_RS400_VISUAL_PRESET_DEFAULT, "RS2_RS400_VISUAL_PRESET_DEFAULT"}, {RS2_RS400_VISUAL_PRESET_CUSTOM, "RS2_RS400_VISUAL_PRESET_CUSTOM"}, {RS2_RS400_VISUAL_PRESET_HAND, "RS2_RS400_VISUAL_PRESET_HAND"}, {RS2_RS400_VISUAL_PRESET_HIGH_ACCURACY, "RS2_RS400_VISUAL_PRESET_HIGH_ACCURACY"}, {RS2_RS400_VISUAL_PRESET_HIGH_DENSITY, "RS2_RS400_VISUAL_PRESET_HIGH_DENSITY"}, {RS2_RS400_VISUAL_PRESET_MEDIUM_DENSITY, "RS2_RS400_VISUAL_PRESET_MEDIUM_DENSITY"}, {RS2_RS400_VISUAL_PRESET_REMOVE_IR_PATTERN, "RS2_RS400_VISUAL_PRESET_REMOVE_IR_PATTERN"} })
 RS2 visual presets for RS400 devices. More...
 
 STRINGIFY_ENUM (rs2_sr300_visual_preset, { {RS2_SR300_VISUAL_PRESET_DEFAULT, "RS2_SR300_VISUAL_PRESET_DEFAULT"}, {RS2_SR300_VISUAL_PRESET_SHORT_RANGE, "RS2_SR300_VISUAL_PRESET_SHORT_RANGE"}, {RS2_SR300_VISUAL_PRESET_LONG_RANGE, "RS2_SR300_VISUAL_PRESET_LONG_RANGE"}, {RS2_SR300_VISUAL_PRESET_BACKGROUND_SEGMENTATION, "RS2_SR300_VISUAL_PRESET_BACKGROUND_SEGMENTATION"}, {RS2_SR300_VISUAL_PRESET_GESTURE_RECOGNITION, "RS2_SR300_VISUAL_PRESET_GESTURE_RECOGNITION"}, {RS2_SR300_VISUAL_PRESET_OBJECT_SCANNING, "RS2_SR300_VISUAL_PRESET_OBJECT_SCANNING"}, {RS2_SR300_VISUAL_PRESET_FACE_ANALYTICS, "RS2_SR300_VISUAL_PRESET_FACE_ANALYTICS"}, {RS2_SR300_VISUAL_PRESET_FACE_LOGIN, "RS2_SR300_VISUAL_PRESET_FACE_LOGIN"}, {RS2_SR300_VISUAL_PRESET_GR_CURSOR, "RS2_SR300_VISUAL_PRESET_GR_CURSOR"}, {RS2_SR300_VISUAL_PRESET_MID_RANGE, "RS2_SR300_VISUAL_PRESET_MID_RANGE"}, {RS2_SR300_VISUAL_PRESET_IR_ONLY, "RS2_SR300_VISUAL_PRESET_IR_ONLY"} })
 
std::shared_ptr< geometry::TriangleMeshCreateMeshFromFile (const std::string &filename, bool print_progress)
 
bool ReadTriangleMesh (const std::string &filename, geometry::TriangleMesh &mesh, cloudViewer::io::ReadTriangleMeshOptions params)
 
bool WriteTriangleMesh (const std::string &filename, const geometry::TriangleMesh &mesh, bool write_ascii, bool compressed, bool write_vertex_normals, bool write_vertex_colors, bool write_triangle_uvs, bool print_progress)
 
bool ReadTriangleMeshFromNPZ (const std::string &filename, geometry::TriangleMesh &mesh, const cloudViewer::io::ReadTriangleMeshOptions &params)
 
bool WriteTriangleMeshToNPZ (const std::string &filename, const geometry::TriangleMesh &mesh, const bool write_ascii, const bool compressed, const bool write_vertex_normals, const bool write_vertex_colors, const bool write_triangle_uvs, const bool print_progress)
 
void pybind_class_io (py::module &m_io)
 
void pybind_io (py::module &m)
 
void pybind_sensor (py::module &m)
 

Variables

const unsigned int kPostProcessFlags_compulsory
 
const unsigned int kPostProcessFlags_fast
 
constexpr int kCloudViewerImageIODefaultQuality = -1
 
static const std::unordered_map< std::string, std::function< bool(const std::string &, geometry::PointCloud &, const cloudViewer::io::ReadPointCloudOption &)> > file_extension_to_pointcloud_read_function
 
static const std::unordered_map< std::string, std::function< bool(const std::string &, const geometry::PointCloud &, const cloudViewer::io::WritePointCloudOption &)> > file_extension_to_pointcloud_write_function
 
static std::unordered_map< std::string, std::string > standard_config
 
static const std::unordered_map< std::string, std::function< bool(const std::string &, geometry::TriangleMesh &, const cloudViewer::io::ReadTriangleMeshOptions &)> > file_extension_to_trianglemesh_read_function
 
static const std::unordered_map< std::string, std::function< bool(const std::string &, const geometry::TriangleMesh &, const bool, const bool, const bool, const bool, const bool, const bool)> > file_extension_to_trianglemesh_write_function
 
static const std::unordered_map< std::string, std::string > map_shared_argument_docstrings
 

Enumeration Type Documentation

◆ PCDDataType

Enumerator
ASCII 
BINARY 
BINARY_COMPRESSED 

Definition at line 34 of file FilePCD.cpp.

◆ SensorType

Enumerator
AZURE_KINECT 
REAL_SENSE 

Definition at line 24 of file RGBDVideoMetadata.h.

Function Documentation

◆ BigEndianChar()

static char cloudViewer::t::io::BigEndianChar ( )
static

Definition at line 127 of file NumpyIO.cpp.

Referenced by CreateNumpyHeader().

◆ ColorToUint8()

template<typename scalar_t >
static void cloudViewer::t::io::ColorToUint8 ( const scalar_t *  input_color,
std::uint8_t *  output_color 
)
static

Definition at line 837 of file FilePCD.cpp.

References LogError.

◆ ColorToUint8< double >()

template<>
void cloudViewer::t::io::ColorToUint8< double > ( const double *  input_color,
std::uint8_t *  output_color 
)

Definition at line 857 of file FilePCD.cpp.

References max(), and min().

◆ ColorToUint8< float >()

template<>
void cloudViewer::t::io::ColorToUint8< float > ( const float *  input_color,
std::uint8_t *  output_color 
)

Definition at line 845 of file FilePCD.cpp.

References max(), and min().

◆ ColorToUint8< std::uint16_t >()

template<>
void cloudViewer::t::io::ColorToUint8< std::uint16_t > ( const std::uint16_t *  input_color,
std::uint8_t *  output_color 
)

Definition at line 879 of file FilePCD.cpp.

References max().

◆ ColorToUint8< std::uint32_t >()

template<>
void cloudViewer::t::io::ColorToUint8< std::uint32_t > ( const std::uint32_t *  input_color,
std::uint8_t *  output_color 
)

Definition at line 892 of file FilePCD.cpp.

References max().

◆ ColorToUint8< std::uint8_t >()

template<>
void cloudViewer::t::io::ColorToUint8< std::uint8_t > ( const std::uint8_t *  input_color,
std::uint8_t *  output_color 
)

Definition at line 870 of file FilePCD.cpp.

◆ ConvertColorTensorToUint8()

◆ CreateImageFromFile()

std::shared_ptr< geometry::Image > cloudViewer::t::io::CreateImageFromFile ( const std::string &  filename)

Factory function to create an image from a file (ImageFactory.cpp) Return an empty image if fail to read the file.

Definition at line 48 of file ImageIO.cpp.

References filename, image, and ReadImage().

Referenced by cloudViewer::t::pipelines::odometry::ComputeOdometryResultPointToPlane(), and cloudViewer::t::pipelines::odometry::RGBDOdometryMultiScale().

◆ CreateMeshFromFile()

std::shared_ptr< geometry::TriangleMesh > cloudViewer::t::io::CreateMeshFromFile ( const std::string &  filename,
bool  print_progress = false 
)

Factory function to create a mesh from a file (TriangleMeshFactory.cpp) Return an empty mesh if fail to read the file.

Definition at line 52 of file TriangleMeshIO.cpp.

◆ CreateNumpyArrayFromCompressedFile()

static NumpyArray cloudViewer::t::io::CreateNumpyArrayFromCompressedFile ( FILE *  fp,
uint32_t  num_compressed_bytes,
uint32_t  num_uncompressed_bytes 
)
static

◆ CreateNumpyArrayFromFile()

static NumpyArray cloudViewer::t::io::CreateNumpyArrayFromFile ( FILE *  fp)
static

◆ CreateNumpyHeader()

◆ CreatePointCloudFromFile()

std::shared_ptr< geometry::PointCloud > cloudViewer::t::io::CreatePointCloudFromFile ( const std::string &  filename,
const std::string &  format = "auto",
bool  print_progress = false 
)

Factory function to create a pointcloud from a file Return an empty pointcloud if fail to read the file.

Definition at line 62 of file PointCloudIO.cpp.

Referenced by cloudViewer::t::pipelines::slac::PreprocessPointClouds().

◆ DtypeToChar()

◆ GenerateHeader()

◆ GetDtypeFromPCDHeaderField()

◆ InitializeHeader()

◆ PackColorsToFloat()

◆ ParseNpyHeaderFromBuffer()

static std::tuple<core::SizeVector, char, int64_t, bool> cloudViewer::t::io::ParseNpyHeaderFromBuffer ( const char *  buffer)
static

Definition at line 325 of file NumpyIO.cpp.

References ParseNpyPreamble(), and ParsePropertyDict().

Referenced by CreateNumpyArrayFromCompressedFile().

◆ ParseNpyHeaderFromFile()

static std::tuple<core::SizeVector, char, int64_t, bool> cloudViewer::t::io::ParseNpyHeaderFromFile ( FILE *  fp)
static

◆ ParseNpyPreamble()

static size_t cloudViewer::t::io::ParseNpyPreamble ( const char *  preamble)
static

Definition at line 281 of file NumpyIO.cpp.

References LogError.

Referenced by ParseNpyHeaderFromBuffer(), and ParseNpyHeaderFromFile().

◆ ParsePropertyDict()

static std::tuple<core::SizeVector, char, int64_t, bool> cloudViewer::t::io::ParsePropertyDict ( const std::string &  header)
static

◆ ParseZipFooter()

static std::tuple<size_t, size_t, size_t> cloudViewer::t::io::ParseZipFooter ( FILE *  fp)
static

Definition at line 331 of file NumpyIO.cpp.

References cloudViewer::t::io::CharVector::Data(), LogError, and SEEK_END.

Referenced by WriteNpzOneTensor().

◆ pybind_class_io()

void cloudViewer::t::io::pybind_class_io ( py::module &  m_io)

◆ pybind_io()

void cloudViewer::t::io::pybind_io ( py::module &  m)

Definition at line 16 of file io.cpp.

References pybind_class_io(), and pybind_sensor().

Referenced by cloudViewer::t::pybind_t().

◆ pybind_sensor()

void cloudViewer::t::io::pybind_sensor ( py::module &  m)

Definition at line 26 of file sensor.cpp.

References AZURE_KINECT, cloudViewer::t::io::RealSenseSensor::CaptureFrame(), cloudViewer::docstring::ClassMethodDocInject(), cloudViewer::t::io::RSBagReader::Close(), cloudViewer::t::io::RGBDVideoMetadata::color_channels_, cloudViewer::t::io::RGBDVideoMetadata::color_dt_, cloudViewer::t::io::RGBDVideoMetadata::color_format_, cloudViewer::t::io::RGBDVideoReader::Create(), cloudViewer::t::io::RSBagReader::DEFAULT_BUFFER_SIZE, cloudViewer::t::io::RGBDVideoMetadata::depth_dt_, cloudViewer::t::io::RGBDVideoMetadata::depth_format_, cloudViewer::t::io::RGBDVideoMetadata::depth_scale_, cloudViewer::t::io::RGBDVideoMetadata::device_name_, cloudViewer::t::io::RealSenseSensor::EnumerateDevices(), filename, cloudViewer::t::io::RGBDVideoMetadata::fps_, cloudViewer::t::io::RealSenseSensor::GetFilename(), cloudViewer::t::io::RealSenseSensor::GetMetadata(), cloudViewer::t::io::RSBagReader::GetMetadata(), cloudViewer::t::io::RealSenseSensor::GetTimestamp(), cloudViewer::t::io::RSBagReader::GetTimestamp(), cloudViewer::t::io::RGBDVideoMetadata::height_, cloudViewer::t::io::RealSenseSensor::InitSensor(), cloudViewer::t::io::RGBDVideoMetadata::intrinsics_, cloudViewer::t::io::RSBagReader::IsEOF(), cloudViewer::t::io::RSBagReader::IsOpened(), cloudViewer::t::io::RealSenseSensor::ListDevices(), map_shared_argument_docstrings, cloudViewer::t::io::RealSenseValidConfigs::name, cloudViewer::t::io::RSBagReader::NextFrame(), cloudViewer::t::io::RSBagReader::Open(), cloudViewer::t::geometry::path, cloudViewer::t::io::RealSenseSensor::PauseRecord(), REAL_SENSE, cloudViewer::t::io::RealSenseSensor::ResumeRecord(), cloudViewer::t::io::RGBDVideoReader::RGBDVideoReader(), cloudViewer::t::io::RSBagReader::SaveFrames(), cloudViewer::t::io::RGBDVideoReader::SaveFrames(), cloudViewer::t::io::RSBagReader::SeekTimestamp(), cloudViewer::t::io::RealSenseValidConfigs::serial, cloudViewer::t::io::RGBDVideoMetadata::serial_number_, cloudViewer::t::io::RealSenseSensor::StartCapture(), cloudViewer::t::io::RealSenseSensor::StopCapture(), cloudViewer::t::io::RGBDVideoMetadata::stream_length_usec_, cloudViewer::utility::IJsonConvertible::ToString(), cloudViewer::t::io::RealSenseSensor::ToString(), cloudViewer::t::io::RSBagReader::ToString(), cloudViewer::t::io::RGBDSensor::ToString(), cloudViewer::t::io::RGBDVideoReader::ToString(), cloudViewer::t::io::RealSenseValidConfigs::valid_configs, and cloudViewer::t::io::RGBDVideoMetadata::width_.

Referenced by pybind_io().

◆ ReadASCIIPCDColorsFromField()

static void cloudViewer::t::io::ReadASCIIPCDColorsFromField ( ReadAttributePtr attr,
const PCLPointField field,
const char *  data_ptr,
const int  index 
)
static

◆ ReadASCIIPCDElementsFromField()

static void cloudViewer::t::io::ReadASCIIPCDElementsFromField ( ReadAttributePtr attr,
const PCLPointField field,
const char *  data_ptr,
const int  index 
)
static

◆ ReadBinaryPCDColorsFromField()

static void cloudViewer::t::io::ReadBinaryPCDColorsFromField ( ReadAttributePtr attr,
const PCLPointField field,
const void *  data_ptr,
const int  index 
)
static

◆ ReadBinaryPCDElementsFromField()

static void cloudViewer::t::io::ReadBinaryPCDElementsFromField ( ReadAttributePtr attr,
const PCLPointField field,
const void *  data_ptr,
const int  index 
)
static

◆ ReadFileGeometryTypeTXT()

cloudViewer::io::FileGeometry cloudViewer::t::io::ReadFileGeometryTypeTXT ( const std::string &  path)

Definition at line 23 of file FileTXT.cpp.

References cloudViewer::io::CONTAINS_POINTS.

◆ ReadFileGeometryTypeXYZI()

cloudViewer::io::FileGeometry cloudViewer::t::io::ReadFileGeometryTypeXYZI ( const std::string &  path)

Definition at line 24 of file FileXYZI.cpp.

References cloudViewer::io::CONTAINS_POINTS.

◆ ReadHashMap()

core::HashMap cloudViewer::t::io::ReadHashMap ( const std::string &  filename)

Read a hash map's keys and values from a npz file at 'key' and 'value'. Return a hash map on CPU.

Parameters
filenameThe npz file name to read from.

Definition at line 48 of file HashMapIO.cpp.

References cloudViewer::core::SmallVectorTemplateCommon< T, typename >::begin(), cloudViewer::core::SmallVectorTemplateCommon< T, typename >::end(), format, cloudViewer::core::Tensor::GetDtype(), cloudViewer::core::Tensor::GetLength(), cloudViewer::core::Tensor::GetShape(), and ReadNpz().

Referenced by cloudViewer::core::HashMap::Load(), and cloudViewer::core::HashSet::Load().

◆ ReadImage()

bool cloudViewer::t::io::ReadImage ( const std::string &  filename,
geometry::Image image 
)

The general entrance for reading an Image from a file The function calls read functions based on the extension name of filename.

Parameters
filenameFull path to image. Supported file formats are png, jpg/jpeg.
imageAn object of type cloudViewer::t::geometry::Image.
Returns
return true if the read function is successful, false otherwise.

Definition at line 55 of file ImageIO.cpp.

References filename, image, and LogWarning.

Referenced by CreateImageFromFile(), and pybind_class_io().

◆ ReadImageFromJPG()

bool cloudViewer::t::io::ReadImageFromJPG ( const std::string &  filename,
geometry::Image image 
)

◆ ReadImageFromPNG()

bool cloudViewer::t::io::ReadImageFromPNG ( const std::string &  filename,
geometry::Image image 
)

◆ ReadNpy()

core::Tensor cloudViewer::t::io::ReadNpy ( const std::string &  file_name)

◆ ReadNpz()

◆ ReadPCDData()

static bool cloudViewer::t::io::ReadPCDData ( FILE *  file,
PCDHeader header,
t::geometry::PointCloud pointcloud,
const ReadPointCloudOption params 
)
static

◆ ReadPCDHeader()

◆ ReadPointCloud() [1/2]

bool cloudViewer::t::io::ReadPointCloud ( const std::string &  filename,
geometry::PointCloud pointcloud,
const ReadPointCloudOption params = {} 
)

◆ ReadPointCloud() [2/2]

bool cloudViewer::t::io::ReadPointCloud ( const std::string &  filename,
geometry::PointCloud pointcloud,
const std::string &  file_format,
bool  remove_nan_points,
bool  remove_infinite_points,
bool  print_progress 
)

Definition at line 112 of file PointCloudIO.cpp.

◆ ReadPointCloudFromNPZ()

bool cloudViewer::t::io::ReadPointCloudFromNPZ ( const std::string &  filename,
geometry::PointCloud pointcloud,
const ReadPointCloudOption params 
)

Definition at line 178 of file PointCloudIO.cpp.

References filename, and ReadNpz().

◆ ReadPointCloudFromPCD()

◆ ReadPointCloudFromPLY()

◆ ReadPointCloudFromPTS()

◆ ReadPointCloudFromSPLAT()

◆ ReadPointCloudFromTXT()

◆ ReadPointCloudFromXYZI()

◆ ReadTriangleMesh()

bool cloudViewer::t::io::ReadTriangleMesh ( const std::string &  filename,
geometry::TriangleMesh mesh,
cloudViewer::io::ReadTriangleMeshOptions  params = {} 
)

The general entrance for reading a TriangleMesh from a file. The function calls read functions based on the extension name of filename. Supported formats are obj,ply,stl,off,gltf,glb,fbx .

Parameters
filenamePath to the mesh file.
meshOutput parameter for the mesh.
paramsAdditional read options to enable post-processing or progress reporting.
Returns
return true if the read function is successful, false otherwise.

Definition at line 74 of file TriangleMeshIO.cpp.

References file_extension_to_trianglemesh_read_function, filename, cloudViewer::t::geometry::TriangleMesh::FromLegacy(), cloudViewer::utility::filesystem::GetFileExtensionInLowerCase(), cloudViewer::core::Tensor::GetLength(), cloudViewer::t::geometry::TriangleMesh::GetTriangleIndices(), cloudViewer::t::geometry::TriangleMesh::GetVertexPositions(), cloudViewer::t::geometry::TriangleMesh::HasTriangleIndices(), cloudViewer::t::geometry::TriangleMesh::HasVertexPositions(), LogDebug, LogWarning, params, and cloudViewer::io::ReadTriangleMesh().

Referenced by cloudViewer::t::geometry::IOReadTensorTriangleMesh().

◆ ReadTriangleMeshFromNPZ()

◆ ReadTriangleMeshUsingASSIMP()

◆ SetPCDHeaderFieldTypeAndSizeFromDtype()

◆ SetPNGImageFromImage()

static void cloudViewer::t::io::SetPNGImageFromImage ( const geometry::Image image,
int  quality,
png_image &  pngimage 
)
static

Definition at line 18 of file FilePNG.cpp.

References image, and cloudViewer::core::UInt16.

Referenced by WriteImageToPNG(), and WriteImageToPNGInMemory().

◆ SetTextureMaterialProperty()

static void cloudViewer::t::io::SetTextureMaterialProperty ( aiMaterial *  mat,
aiScene *  scene,
int  texture_idx,
aiTextureType  tt,
t::geometry::Image img 
)
static

Definition at line 180 of file FileASSIMP.cpp.

References patch::to_string(), and WriteImageToPNGInMemory().

◆ STRINGIFY_ENUM() [1/5]

cloudViewer::t::io::STRINGIFY_ENUM ( rs2_format  ,
{ {RS2_FORMAT_ANY, "RS2_FORMAT_ANY"}, {RS2_FORMAT_Z16, "RS2_FORMAT_Z16"}, {RS2_FORMAT_DISPARITY16, "RS2_FORMAT_DISPARITY16"}, {RS2_FORMAT_XYZ32F, "RS2_FORMAT_XYZ32F"}, {RS2_FORMAT_YUYV, "RS2_FORMAT_YUYV"}, {RS2_FORMAT_RGB8, "RS2_FORMAT_RGB8"}, {RS2_FORMAT_BGR8, "RS2_FORMAT_BGR8"}, {RS2_FORMAT_RGBA8, "RS2_FORMAT_RGBA8"}, {RS2_FORMAT_BGRA8, "RS2_FORMAT_BGRA8"}, {RS2_FORMAT_Y8, "RS2_FORMAT_Y8"}, {RS2_FORMAT_Y16, "RS2_FORMAT_Y16"}, {RS2_FORMAT_RAW10, "RS2_FORMAT_RAW10"}, {RS2_FORMAT_RAW16, "RS2_FORMAT_RAW16"}, {RS2_FORMAT_RAW8, "RS2_FORMAT_RAW8"}, {RS2_FORMAT_UYVY, "RS2_FORMAT_UYVY"}, {RS2_FORMAT_MOTION_RAW, "RS2_FORMAT_MOTION_RAW"}, {RS2_FORMAT_MOTION_XYZ32F, "RS2_FORMAT_MOTION_XYZ32F"}, {RS2_FORMAT_GPIO_RAW, "RS2_FORMAT_GPIO_RAW"}, {RS2_FORMAT_6DOF, "RS2_FORMAT_6DOF"}, {RS2_FORMAT_DISPARITY32, "RS2_FORMAT_DISPARITY32"}, {RS2_FORMAT_Y10BPACK, "RS2_FORMAT_Y10BPACK"}, {RS2_FORMAT_DISTANCE, "RS2_FORMAT_DISTANCE"}, {RS2_FORMAT_MJPEG, "RS2_FORMAT_MJPEG"}, {RS2_FORMAT_Y8I, "RS2_FORMAT_Y8I"}, {RS2_FORMAT_Y12I, "RS2_FORMAT_Y12I"}, {RS2_FORMAT_INZI, "RS2_FORMAT_INZI"}, {RS2_FORMAT_INVI, "RS2_FORMAT_INVI"}, {RS2_FORMAT_W10, "RS2_FORMAT_W10"}, {RS2_FORMAT_Z16H, "RS2_FORMAT_Z16H"} }   
)

RS2 pixel formats.

◆ STRINGIFY_ENUM() [2/5]

cloudViewer::t::io::STRINGIFY_ENUM ( rs2_l500_visual_preset  ,
{ {RS2_L500_VISUAL_PRESET_DEFAULT, "RS2_L500_VISUAL_PRESET_DEFAULT"}, {RS2_L500_VISUAL_PRESET_CUSTOM, "RS2_L500_VISUAL_PRESET_CUSTOM"}, {RS2_L500_VISUAL_PRESET_NO_AMBIENT, "RS2_L500_VISUAL_PRESET_NO_AMBIENT"}, {RS2_L500_VISUAL_PRESET_LOW_AMBIENT, "RS2_L500_VISUAL_PRESET_LOW_AMBIENT"}, {RS2_L500_VISUAL_PRESET_MAX_RANGE, "RS2_L500_VISUAL_PRESET_MAX_RANGE"}, {RS2_L500_VISUAL_PRESET_SHORT_RANGE, "RS2_L500_VISUAL_PRESET_SHORT_RANGE"} }   
)

RS2 visual presets for L500 devices.

◆ STRINGIFY_ENUM() [3/5]

cloudViewer::t::io::STRINGIFY_ENUM ( rs2_rs400_visual_preset  ,
{ {RS2_RS400_VISUAL_PRESET_DEFAULT, "RS2_RS400_VISUAL_PRESET_DEFAULT"}, {RS2_RS400_VISUAL_PRESET_CUSTOM, "RS2_RS400_VISUAL_PRESET_CUSTOM"}, {RS2_RS400_VISUAL_PRESET_HAND, "RS2_RS400_VISUAL_PRESET_HAND"}, {RS2_RS400_VISUAL_PRESET_HIGH_ACCURACY, "RS2_RS400_VISUAL_PRESET_HIGH_ACCURACY"}, {RS2_RS400_VISUAL_PRESET_HIGH_DENSITY, "RS2_RS400_VISUAL_PRESET_HIGH_DENSITY"}, {RS2_RS400_VISUAL_PRESET_MEDIUM_DENSITY, "RS2_RS400_VISUAL_PRESET_MEDIUM_DENSITY"}, {RS2_RS400_VISUAL_PRESET_REMOVE_IR_PATTERN, "RS2_RS400_VISUAL_PRESET_REMOVE_IR_PATTERN"} }   
)

RS2 visual presets for RS400 devices.

◆ STRINGIFY_ENUM() [4/5]

cloudViewer::t::io::STRINGIFY_ENUM ( rs2_sr300_visual_preset  ,
{ {RS2_SR300_VISUAL_PRESET_DEFAULT, "RS2_SR300_VISUAL_PRESET_DEFAULT"}, {RS2_SR300_VISUAL_PRESET_SHORT_RANGE, "RS2_SR300_VISUAL_PRESET_SHORT_RANGE"}, {RS2_SR300_VISUAL_PRESET_LONG_RANGE, "RS2_SR300_VISUAL_PRESET_LONG_RANGE"}, {RS2_SR300_VISUAL_PRESET_BACKGROUND_SEGMENTATION, "RS2_SR300_VISUAL_PRESET_BACKGROUND_SEGMENTATION"}, {RS2_SR300_VISUAL_PRESET_GESTURE_RECOGNITION, "RS2_SR300_VISUAL_PRESET_GESTURE_RECOGNITION"}, {RS2_SR300_VISUAL_PRESET_OBJECT_SCANNING, "RS2_SR300_VISUAL_PRESET_OBJECT_SCANNING"}, {RS2_SR300_VISUAL_PRESET_FACE_ANALYTICS, "RS2_SR300_VISUAL_PRESET_FACE_ANALYTICS"}, {RS2_SR300_VISUAL_PRESET_FACE_LOGIN, "RS2_SR300_VISUAL_PRESET_FACE_LOGIN"}, {RS2_SR300_VISUAL_PRESET_GR_CURSOR, "RS2_SR300_VISUAL_PRESET_GR_CURSOR"}, {RS2_SR300_VISUAL_PRESET_MID_RANGE, "RS2_SR300_VISUAL_PRESET_MID_RANGE"}, {RS2_SR300_VISUAL_PRESET_IR_ONLY, "RS2_SR300_VISUAL_PRESET_IR_ONLY"} }   
)

◆ STRINGIFY_ENUM() [5/5]

cloudViewer::t::io::STRINGIFY_ENUM ( rs2_stream  ,
{ {RS2_STREAM_ANY, "RS2_STREAM_ANY"}, {RS2_STREAM_DEPTH, "RS2_STREAM_DEPTH"}, {RS2_STREAM_COLOR, "RS2_STREAM_COLOR"}, {RS2_STREAM_INFRARED, "RS2_STREAM_INFRARED"}, {RS2_STREAM_FISHEYE, "RS2_STREAM_FISHEYE"}, {RS2_STREAM_GYRO, "RS2_STREAM_GYRO"}, {RS2_STREAM_ACCEL, "RS2_STREAM_ACCEL"}, {RS2_STREAM_GPIO, "RS2_STREAM_GPIO"}, {RS2_STREAM_POSE, "RS2_STREAM_POSE"}, {RS2_STREAM_CONFIDENCE, "RS2_STREAM_CONFIDENCE"} }   
)

RS2 stream types.

◆ UnpackASCIIPCDElement()

template<typename scalar_t >
static void cloudViewer::t::io::UnpackASCIIPCDElement ( scalar_t &  data,
const char *  data_ptr 
)
staticdelete

◆ UnpackASCIIPCDElement< double >()

template<>
void cloudViewer::t::io::UnpackASCIIPCDElement< double > ( double &  data,
const char *  data_ptr 
)

Definition at line 346 of file FilePCD.cpp.

◆ UnpackASCIIPCDElement< float >()

template<>
void cloudViewer::t::io::UnpackASCIIPCDElement< float > ( float &  data,
const char *  data_ptr 
)

Definition at line 340 of file FilePCD.cpp.

◆ UnpackASCIIPCDElement< std::int16_t >()

template<>
void cloudViewer::t::io::UnpackASCIIPCDElement< std::int16_t > ( std::int16_t &  data,
const char *  data_ptr 
)

Definition at line 359 of file FilePCD.cpp.

◆ UnpackASCIIPCDElement< std::int32_t >()

template<>
void cloudViewer::t::io::UnpackASCIIPCDElement< std::int32_t > ( std::int32_t &  data,
const char *  data_ptr 
)

Definition at line 366 of file FilePCD.cpp.

◆ UnpackASCIIPCDElement< std::int64_t >()

template<>
void cloudViewer::t::io::UnpackASCIIPCDElement< std::int64_t > ( std::int64_t &  data,
const char *  data_ptr 
)

Definition at line 373 of file FilePCD.cpp.

◆ UnpackASCIIPCDElement< std::int8_t >()

template<>
void cloudViewer::t::io::UnpackASCIIPCDElement< std::int8_t > ( std::int8_t &  data,
const char *  data_ptr 
)

Definition at line 352 of file FilePCD.cpp.

◆ UnpackASCIIPCDElement< std::uint16_t >()

template<>
void cloudViewer::t::io::UnpackASCIIPCDElement< std::uint16_t > ( std::uint16_t &  data,
const char *  data_ptr 
)

Definition at line 387 of file FilePCD.cpp.

◆ UnpackASCIIPCDElement< std::uint32_t >()

template<>
void cloudViewer::t::io::UnpackASCIIPCDElement< std::uint32_t > ( std::uint32_t &  data,
const char *  data_ptr 
)

Definition at line 394 of file FilePCD.cpp.

◆ UnpackASCIIPCDElement< std::uint64_t >()

template<>
void cloudViewer::t::io::UnpackASCIIPCDElement< std::uint64_t > ( std::uint64_t &  data,
const char *  data_ptr 
)

Definition at line 401 of file FilePCD.cpp.

◆ UnpackASCIIPCDElement< std::uint8_t >()

template<>
void cloudViewer::t::io::UnpackASCIIPCDElement< std::uint8_t > ( std::uint8_t &  data,
const char *  data_ptr 
)

Definition at line 380 of file FilePCD.cpp.

◆ WriteElementDataToFileASCII()

template<typename scalar_t >
static int cloudViewer::t::io::WriteElementDataToFileASCII ( const scalar_t &  data,
FILE *  file 
)
staticdelete

◆ WriteElementDataToFileASCII< double >()

template<>
int cloudViewer::t::io::WriteElementDataToFileASCII< double > ( const double &  data,
FILE *  file 
)

Definition at line 936 of file FilePCD.cpp.

◆ WriteElementDataToFileASCII< float >()

template<>
int cloudViewer::t::io::WriteElementDataToFileASCII< float > ( const float &  data,
FILE *  file 
)

Definition at line 931 of file FilePCD.cpp.

◆ WriteElementDataToFileASCII< std::int16_t >()

template<>
int cloudViewer::t::io::WriteElementDataToFileASCII< std::int16_t > ( const std::int16_t &  data,
FILE *  file 
)

Definition at line 947 of file FilePCD.cpp.

◆ WriteElementDataToFileASCII< std::int32_t >()

template<>
int cloudViewer::t::io::WriteElementDataToFileASCII< std::int32_t > ( const std::int32_t &  data,
FILE *  file 
)

Definition at line 953 of file FilePCD.cpp.

◆ WriteElementDataToFileASCII< std::int64_t >()

template<>
int cloudViewer::t::io::WriteElementDataToFileASCII< std::int64_t > ( const std::int64_t &  data,
FILE *  file 
)

Definition at line 959 of file FilePCD.cpp.

◆ WriteElementDataToFileASCII< std::int8_t >()

template<>
int cloudViewer::t::io::WriteElementDataToFileASCII< std::int8_t > ( const std::int8_t &  data,
FILE *  file 
)

Definition at line 941 of file FilePCD.cpp.

◆ WriteElementDataToFileASCII< std::uint16_t >()

template<>
int cloudViewer::t::io::WriteElementDataToFileASCII< std::uint16_t > ( const std::uint16_t &  data,
FILE *  file 
)

Definition at line 971 of file FilePCD.cpp.

◆ WriteElementDataToFileASCII< std::uint32_t >()

template<>
int cloudViewer::t::io::WriteElementDataToFileASCII< std::uint32_t > ( const std::uint32_t &  data,
FILE *  file 
)

Definition at line 977 of file FilePCD.cpp.

◆ WriteElementDataToFileASCII< std::uint64_t >()

template<>
int cloudViewer::t::io::WriteElementDataToFileASCII< std::uint64_t > ( const std::uint64_t &  data,
FILE *  file 
)

Definition at line 983 of file FilePCD.cpp.

◆ WriteElementDataToFileASCII< std::uint8_t >()

template<>
int cloudViewer::t::io::WriteElementDataToFileASCII< std::uint8_t > ( const std::uint8_t &  data,
FILE *  file 
)

Definition at line 965 of file FilePCD.cpp.

◆ WriteHashMap()

void cloudViewer::t::io::WriteHashMap ( const std::string &  filename,
const core::HashMap hashmap 
)

◆ WriteImage()

bool cloudViewer::t::io::WriteImage ( const std::string &  filename,
const geometry::Image image,
int  quality = kCloudViewerImageIODefaultQuality 
)

The general entrance for writing an Image to a file The function calls write functions based on the extension name of filename. If the write function supports quality, the parameter will be used. Otherwise it will be ignored.

Parameters
filenameFull path to image. Supported file formats are png, jpg/jpeg.
imageAn object of type cloudViewer::t::geometry::Image.
qualityPNG: [0-9] <=2 fast write for storing intermediate data >=3 (default) normal write for balanced speed and file size JPEG: [0-100] Typically in [70,95]. 90 is default (good quality).
Returns
return true if the write function is successful, false otherwise.

Supported file extensions are png, jpg/jpeg. Data type and number of channels depends on the file extension.

Definition at line 79 of file ImageIO.cpp.

References filename, cloudViewer::utility::filesystem::GetFileExtensionInLowerCase(), image, and LogWarning.

Referenced by pybind_class_io().

◆ WriteImageToJPG()

bool cloudViewer::t::io::WriteImageToJPG ( const std::string &  filename,
const geometry::Image image,
int  quality 
)

◆ WriteImageToPNG()

bool cloudViewer::t::io::WriteImageToPNG ( const std::string &  filename,
const geometry::Image image,
int  quality 
)

◆ WriteImageToPNGInMemory()

bool cloudViewer::t::io::WriteImageToPNGInMemory ( std::vector< uint8_t > &  buffer,
const t::geometry::Image image,
int  quality 
)

◆ WriteNpy()

void cloudViewer::t::io::WriteNpy ( const std::string &  file_name,
const core::Tensor tensor 
)

Save a tensor to a Numpy .npy file.

Parameters
file_nameThe file name to write to.
tensorThe tensor to save.

Definition at line 671 of file NumpyIO.cpp.

References cloudViewer::t::io::NumpyArray::Save().

Referenced by cloudViewer::core::Tensor::Save().

◆ WriteNpz()

void cloudViewer::t::io::WriteNpz ( const std::string &  file_name,
const std::unordered_map< std::string, core::Tensor > &  tensor_map 
)

Save a string to tensor map as Numpy .npz file.

Parameters
file_nameThe file name to write to.
tensor_mapThe tensor map to save.

Definition at line 759 of file NumpyIO.cpp.

References cloudViewer::core::Tensor::Contiguous(), cloudViewer::core::Tensor::To(), WriteNpzEmpty(), and WriteNpzOneTensor().

Referenced by cloudViewer::t::geometry::VoxelBlockGrid::Save(), WriteHashMap(), and WritePointCloudToNPZ().

◆ WriteNpzEmpty()

◆ WriteNpzOneTensor()

◆ WritePCDData()

◆ WritePCDHeader()

◆ WritePointCloud() [1/2]

bool cloudViewer::t::io::WritePointCloud ( const std::string &  filename,
const geometry::PointCloud pointcloud,
bool  write_ascii,
bool  compressed,
bool  print_progress 
)

Definition at line 158 of file PointCloudIO.cpp.

◆ WritePointCloud() [2/2]

bool cloudViewer::t::io::WritePointCloud ( const std::string &  filename,
const geometry::PointCloud pointcloud,
const WritePointCloudOption params = {} 
)

◆ WritePointCloudToNPZ()

bool cloudViewer::t::io::WritePointCloudToNPZ ( const std::string &  filename,
const geometry::PointCloud pointcloud,
const WritePointCloudOption params 
)

◆ WritePointCloudToPCD()

bool cloudViewer::t::io::WritePointCloudToPCD ( const std::string &  filename,
const geometry::PointCloud pointcloud,
const WritePointCloudOption params 
)

◆ WritePointCloudToPLY()

◆ WritePointCloudToPTS()

◆ WritePointCloudToSPLAT()

◆ WritePointCloudToTXT()

◆ WritePointCloudToXYZI()

◆ WriteTriangleMesh()

bool cloudViewer::t::io::WriteTriangleMesh ( const std::string &  filename,
const geometry::TriangleMesh mesh,
bool  write_ascii = false,
bool  compressed = false,
bool  write_vertex_normals = true,
bool  write_vertex_colors = true,
bool  write_triangle_uvs = true,
bool  print_progress = false 
)

The general entrance for writing a TriangleMesh to a file The function calls write functions based on the extension name of filename. If the write function supports binary encoding and compression, the later two parameters will be used. Otherwise they will be ignored. At current only .obj format supports uv coordinates (triangle_uvs) and textures.

Returns
return true if the write function is successful, false otherwise.

Definition at line 114 of file TriangleMeshIO.cpp.

◆ WriteTriangleMeshToNPZ()

bool cloudViewer::t::io::WriteTriangleMeshToNPZ ( const std::string &  filename,
const geometry::TriangleMesh mesh,
const bool  write_ascii,
const bool  compressed,
const bool  write_vertex_normals,
const bool  write_vertex_colors,
const bool  write_triangle_uvs,
const bool  print_progress 
)

Definition at line 216 of file TriangleMeshIO.cpp.

◆ WriteTriangleMeshUsingASSIMP()

bool cloudViewer::t::io::WriteTriangleMeshUsingASSIMP ( const std::string &  filename,
const geometry::TriangleMesh mesh,
const bool  write_ascii,
const bool  compressed,
const bool  write_vertex_normals,
const bool  write_vertex_colors,
const bool  write_triangle_uvs,
const bool  print_progress 
)

Definition at line 371 of file FileASSIMP.cpp.

Variable Documentation

◆ file_extension_to_pointcloud_read_function

const std::unordered_map< std::string, std::function<bool(const std::string &, geometry::PointCloud &, const cloudViewer::io::ReadPointCloudOption &)> > cloudViewer::t::io::file_extension_to_pointcloud_read_function
static
Initial value:
{
{"xyzrgb", ReadPointCloudFromTXT},
}
bool ReadPointCloudFromPLY(const std::string &filename, ccPointCloud &pointcloud, const ReadPointCloudOption &params)
bool ReadPointCloudFromPCD(const std::string &filename, ccPointCloud &pointcloud, const ReadPointCloudOption &params)
bool ReadPointCloudFromPTS(const std::string &filename, ccPointCloud &pointcloud, const ReadPointCloudOption &params)
bool ReadPointCloudFromTXT(const std::string &filename, geometry::PointCloud &pointcloud, const cloudViewer::io::ReadPointCloudOption &params)
Definition: FileTXT.cpp:27
bool ReadPointCloudFromSPLAT(const std::string &filename, geometry::PointCloud &pointcloud, const cloudViewer::io::ReadPointCloudOption &params)
Definition: FileSPLAT.cpp:84
bool ReadPointCloudFromNPZ(const std::string &filename, geometry::PointCloud &pointcloud, const ReadPointCloudOption &params)

Definition at line 31 of file PointCloudIO.cpp.

Referenced by ReadPointCloud().

◆ file_extension_to_pointcloud_write_function

const std::unordered_map< std::string, std::function<bool(const std::string &, const geometry::PointCloud &, const cloudViewer::io::WritePointCloudOption &)> > cloudViewer::t::io::file_extension_to_pointcloud_write_function
static
Initial value:
{
{"xyzrgb", WritePointCloudToTXT},
}
bool WritePointCloudToPCD(const std::string &filename, const ccPointCloud &pointcloud, const WritePointCloudOption &params)
bool WritePointCloudToPTS(const std::string &filename, const ccPointCloud &pointcloud, const WritePointCloudOption &params)
bool WritePointCloudToPLY(const std::string &filename, const ccPointCloud &pointcloud, const WritePointCloudOption &params)
bool WritePointCloudToTXT(const std::string &filename, const geometry::PointCloud &pointcloud, const cloudViewer::io::WritePointCloudOption &params)
Definition: FileTXT.cpp:132
bool WritePointCloudToSPLAT(const std::string &filename, const geometry::PointCloud &pointcloud, const cloudViewer::io::WritePointCloudOption &params)
Definition: FileSPLAT.cpp:207
bool WritePointCloudToNPZ(const std::string &filename, const geometry::PointCloud &pointcloud, const WritePointCloudOption &params)

Definition at line 49 of file PointCloudIO.cpp.

Referenced by WritePointCloud().

◆ file_extension_to_trianglemesh_read_function

const std::unordered_map< std::string, std::function<bool(const std::string &, geometry::TriangleMesh &, const cloudViewer::io::ReadTriangleMeshOptions &)> > cloudViewer::t::io::file_extension_to_trianglemesh_read_function
static
Initial value:
{
}
bool ReadTriangleMeshUsingASSIMP(const std::string &filename, ccMesh &mesh, const ReadTriangleMeshOptions &params)
Definition: FileASSIMP.cpp:163
bool ReadTriangleMeshFromNPZ(const std::string &filename, geometry::TriangleMesh &mesh, const cloudViewer::io::ReadTriangleMeshOptions &params)

Definition at line 27 of file TriangleMeshIO.cpp.

Referenced by cloudViewer::io::ReadTriangleMesh(), and ReadTriangleMesh().

◆ file_extension_to_trianglemesh_write_function

const std::unordered_map< std::string, std::function<bool(const std::string &, const geometry::TriangleMesh &, const bool, const bool, const bool, const bool, const bool, const bool)> > cloudViewer::t::io::file_extension_to_trianglemesh_write_function
static
Initial value:
{
}
bool WriteTriangleMeshToNPZ(const std::string &filename, const geometry::TriangleMesh &mesh, const bool write_ascii, const bool compressed, const bool write_vertex_normals, const bool write_vertex_colors, const bool write_triangle_uvs, const bool print_progress)
bool WriteTriangleMeshUsingASSIMP(const std::string &filename, const geometry::TriangleMesh &mesh, const bool write_ascii, const bool compressed, const bool write_vertex_normals, const bool write_vertex_colors, const bool write_triangle_uvs, const bool print_progress)
Definition: FileASSIMP.cpp:371

Definition at line 47 of file TriangleMeshIO.cpp.

◆ kCloudViewerImageIODefaultQuality

constexpr int cloudViewer::t::io::kCloudViewerImageIODefaultQuality = -1
constexpr

◆ kPostProcessFlags_compulsory

const unsigned int cloudViewer::t::io::kPostProcessFlags_compulsory
Initial value:
=
aiProcess_JoinIdenticalVertices | aiProcess_Triangulate |
aiProcess_SortByPType | aiProcess_PreTransformVertices

Definition at line 37 of file FileASSIMP.cpp.

Referenced by ReadTriangleMeshUsingASSIMP().

◆ kPostProcessFlags_fast

const unsigned int cloudViewer::t::io::kPostProcessFlags_fast
Initial value:
=
kPostProcessFlags_compulsory | aiProcess_GenNormals |
aiProcess_GenUVCoords | aiProcess_RemoveRedundantMaterials |
aiProcess_OptimizeMeshes
const unsigned int kPostProcessFlags_compulsory
Definition: FileASSIMP.cpp:37

Definition at line 41 of file FileASSIMP.cpp.

Referenced by ReadTriangleMeshUsingASSIMP().

◆ map_shared_argument_docstrings

const std::unordered_map<std::string, std::string> cloudViewer::t::io::map_shared_argument_docstrings
static

Definition at line 25 of file class_io.cpp.

Referenced by pybind_class_io(), and pybind_sensor().

◆ standard_config

std::unordered_map<std::string, std::string> cloudViewer::t::io::standard_config
static
Initial value:
{
{"serial", ""},
{"color_format", "RS2_FORMAT_ANY"},
{"color_resolution", "0,0"},
{"depth_format", "RS2_FORMAT_ANY"},
{"depth_resolution", "0,0"},
{"fps", "0"},
{"visual_preset", "VISUAL_PRESET_DEFAULT"}}

Definition at line 134 of file RealSenseSensorConfig.cpp.

Referenced by cloudViewer::t::io::RealSenseSensorConfig::RealSenseSensorConfig().