Open3D (C++ API)  0.18.0+252c867
Data Structures | Public Types | Public Member Functions
open3d::core::Scalar Class Reference

#include <Scalar.h>

Public Types

enum class  ScalarType { Double , Int64 , Bool }
 

Public Member Functions

 Scalar (float v)
 
 Scalar (double v)
 
 Scalar (int8_t v)
 
 Scalar (int16_t v)
 
 Scalar (int32_t v)
 
 Scalar (int64_t v)
 
template<typename T = int64_t>
 Scalar (long v, typename std::enable_if<!std::is_same< T, long >::value >::type *=0)
 
 Scalar (uint8_t v)
 
 Scalar (uint16_t v)
 
 Scalar (uint32_t v)
 
 Scalar (uint64_t v)
 
 Scalar (bool v)
 
bool IsDouble () const
 
bool IsInt64 () const
 
bool IsBool () const
 
double GetDouble () const
 
int64_t GetInt64 () const
 
bool GetBool () const
 
template<typename T >
To () const
 To<T>() does not check for scalar type and overflows. More...
 
void AssertSameScalarType (Scalar other, const std::string &error_msg) const
 
std::string ToString () const
 
template<typename T >
bool Equal (T value) const
 
bool Equal (bool value) const
 
bool Equal (Scalar other) const
 

Detailed Description

Scalar is a stores one of {double, int64, bool}. Typically Scalar is used to accept C++ scalar arguments of different types via implicit conversion constructor. Doing so can avoid the need for templates.

Member Enumeration Documentation

◆ ScalarType

Enumerator
Double 
Int64 
Bool 

Constructor & Destructor Documentation

◆ Scalar() [1/12]

open3d::core::Scalar::Scalar ( float  v)
inline

◆ Scalar() [2/12]

open3d::core::Scalar::Scalar ( double  v)
inline

◆ Scalar() [3/12]

open3d::core::Scalar::Scalar ( int8_t  v)
inline

◆ Scalar() [4/12]

open3d::core::Scalar::Scalar ( int16_t  v)
inline

◆ Scalar() [5/12]

open3d::core::Scalar::Scalar ( int32_t  v)
inline

◆ Scalar() [6/12]

open3d::core::Scalar::Scalar ( int64_t  v)
inline

◆ Scalar() [7/12]

template<typename T = int64_t>
open3d::core::Scalar::Scalar ( long  v,
typename std::enable_if<!std::is_same< T, long >::value >::type = 0 
)
inline

◆ Scalar() [8/12]

open3d::core::Scalar::Scalar ( uint8_t  v)
inline

◆ Scalar() [9/12]

open3d::core::Scalar::Scalar ( uint16_t  v)
inline

◆ Scalar() [10/12]

open3d::core::Scalar::Scalar ( uint32_t  v)
inline

◆ Scalar() [11/12]

open3d::core::Scalar::Scalar ( uint64_t  v)
inline

◆ Scalar() [12/12]

open3d::core::Scalar::Scalar ( bool  v)
inline

Member Function Documentation

◆ AssertSameScalarType()

void open3d::core::Scalar::AssertSameScalarType ( Scalar  other,
const std::string &  error_msg 
) const
inline

◆ Equal() [1/3]

bool open3d::core::Scalar::Equal ( bool  value) const
inline

◆ Equal() [2/3]

bool open3d::core::Scalar::Equal ( Scalar  other) const
inline

◆ Equal() [3/3]

template<typename T >
bool open3d::core::Scalar::Equal ( value) const
inline

◆ GetBool()

bool open3d::core::Scalar::GetBool ( ) const
inline

Returns bool value from Scalar. Only works when scalar_type_ is ScalarType::Bool.

◆ GetDouble()

double open3d::core::Scalar::GetDouble ( ) const
inline

Returns double value from Scalar. Only works when scalar_type_ is ScalarType::Double.

◆ GetInt64()

int64_t open3d::core::Scalar::GetInt64 ( ) const
inline

Returns int64 value from Scalar. Only works when scalar_type_ is ScalarType::Int64.

◆ IsBool()

bool open3d::core::Scalar::IsBool ( ) const
inline

◆ IsDouble()

bool open3d::core::Scalar::IsDouble ( ) const
inline

◆ IsInt64()

bool open3d::core::Scalar::IsInt64 ( ) const
inline

◆ To()

template<typename T >
T open3d::core::Scalar::To ( ) const
inline

To<T>() does not check for scalar type and overflows.

◆ ToString()

std::string open3d::core::Scalar::ToString ( ) const
inline

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