ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
RGBDImage.cpp
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
9 
10 namespace cloudViewer {
11 namespace t {
12 namespace geometry {
13 
15  color_.Clear();
16  depth_.Clear();
17  return *this;
18 }
19 
20 bool RGBDImage::IsEmpty() const { return color_.IsEmpty() && depth_.IsEmpty(); }
21 
22 std::string RGBDImage::ToString() const {
23  return fmt::format(
24  "RGBD Image pair [{}Aligned]\n"
25  "Color [size=({},{}), channels={}, format={}, device={}]\n"
26  "Depth [size=({},{}), channels={}, format={}, device={}]",
27  AreAligned() ? "" : "Not ", color_.GetCols(), color_.GetRows(),
32 }
33 
34 } // namespace geometry
35 } // namespace t
36 } // namespace cloudViewer
filament::Texture::InternalFormat format
std::string ToString() const
Returns string representation of device, e.g. "CPU:0", "CUDA:0".
Definition: Device.cpp:89
std::string ToString() const
Definition: Dtype.h:65
core::Device GetDevice() const override
Get device of the image.
Definition: Image.h:96
bool IsEmpty() const override
Returns true if rows * cols * channels == 0.
Definition: Image.h:71
core::Dtype GetDtype() const
Get dtype of the image.
Definition: Image.h:93
int64_t GetChannels() const
Get the number of channels of the image.
Definition: Image.h:90
Image & Clear() override
Clear image contents by resetting the rows and cols to 0, while keeping channels, dtype and device un...
Definition: Image.h:65
int64_t GetCols() const
Get the number of columns of the image.
Definition: Image.h:87
int64_t GetRows() const
Get the number of rows of the image.
Definition: Image.h:84
RGBDImage A pair of color and depth images.
Definition: RGBDImage.h:21
bool IsEmpty() const override
Is any data stored?
Definition: RGBDImage.cpp:20
Image depth_
The depth image.
Definition: RGBDImage.h:106
bool AreAligned() const
Are the depth and color images aligned (same viewpoint and resolution)?
Definition: RGBDImage.h:65
std::string ToString() const
Text description.
Definition: RGBDImage.cpp:22
RGBDImage & Clear() override
Clear stored data.
Definition: RGBDImage.cpp:14
Image color_
The color image.
Definition: RGBDImage.h:104
Generic file read and write utility for python interface.