Open3D (C++ API)  0.19.0
Loading...
Searching...
No Matches
ImageImpl.h File Reference

Go to the source code of this file.

Namespaces

namespace  open3d
namespace  open3d::t
namespace  open3d::t::geometry
namespace  open3d::t::geometry::kernel
namespace  open3d::t::geometry::kernel::image

Macros

#define LINEAR_SATURATE(elem_t, calc_t)

Functions

void open3d::t::geometry::kernel::image::ToCPU (const core::Tensor &src, core::Tensor &dst, double scale, double offset)
void open3d::t::geometry::kernel::image::ClipTransformCPU (const core::Tensor &src, core::Tensor &dst, float scale, float min_value, float max_value, float clip_fill=0.0f)
void open3d::t::geometry::kernel::image::PyrDownDepthCPU (const core::Tensor &src, core::Tensor &dst, float diff_threshold, float invalid_fill)
void open3d::t::geometry::kernel::image::CreateVertexMapCPU (const core::Tensor &src, core::Tensor &dst, const core::Tensor &intrinsics, float invalid_fill)
void open3d::t::geometry::kernel::image::CreateNormalMapCPU (const core::Tensor &src, core::Tensor &dst, float invalid_fill)
void open3d::t::geometry::kernel::image::ColorizeDepthCPU (const core::Tensor &src, core::Tensor &dst, float scale, float min_value, float max_value)

Macro Definition Documentation

◆ LINEAR_SATURATE

#define LINEAR_SATURATE ( elem_t,
calc_t )
Value:
elem_t limits[2] = {std::numeric_limits<elem_t>::min(), \
std::numeric_limits<elem_t>::max()}; \
calc_t c_scale = static_cast<calc_t>(scale); \
calc_t c_offset = static_cast<calc_t>(offset); \
DISPATCH_DTYPE_TO_TEMPLATE(src.GetDtype(), [&]() { \
core::ParallelFor( \
src.GetDevice(), indexer.NumWorkloads(), \
[=] OPEN3D_DEVICE(int64_t workload_idx) { \
auto src_ptr = \
indexer.GetInputPtr<scalar_t>(0, workload_idx); \
auto dst_ptr = indexer.GetOutputPtr<elem_t>(workload_idx); \
calc_t out = static_cast<calc_t>(*src_ptr) * c_scale + \
c_offset; \
out = out < limits[0] ? limits[0] : out; \
out = out > limits[1] ? limits[1] : out; \
*dst_ptr = static_cast<elem_t>(out); \
}); \
});