uvgVPCCenc 1.1.0
uvgVPCCenc is an open-source real-time V-PCC encoder library written in C++ from scratch.
Loading...
Searching...
No Matches
fileExport.hpp
Go to the documentation of this file.
1/*****************************************************************************
2 * This file is part of uvgVPCCenc V-PCC encoder.
3 *
4 * Copyright (c) 2024-present, Tampere University, ITU/ISO/IEC, project contributors
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without modification,
8 * are permitted provided that the following conditions are met:
9 *
10 * * Redistributions of source code must retain the above copyright notice, this
11 * list of conditions and the following disclaimer.
12 *
13 * * Redistributions in binary form must reproduce the above copyright notice, this
14 * list of conditions and the following disclaimer in the documentation and/or
15 * other materials provided with the distribution.
16 *
17 * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its
18 * contributors may be used to endorse or promote products derived from
19 * this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
25 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON
28 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
31 ****************************************************************************/
32
34
35#include <cstddef>
36#include <memory>
37#include <string>
38#include <vector>
39
40#include "utils/constants.hpp"
41#include "uvgutils/utils.hpp"
42#include "uvgvpcc/uvgvpcc.hpp"
43
44using namespace uvgvpcc_enc;
45
46namespace FileExport {
47
48const std::array<uvgutils::VectorN<uint8_t, 3>, 10> ppiColors = {{
49 {91, 91, 91}, // Charcoal Gray
50 {0, 102, 51}, // Forest Green
51 {153, 0, 0}, // Rich Crimson
52 {0, 51, 102}, // Deep Blue
53 {255, 204, 0}, // Golden Yellow
54 {102, 204, 204}, // Muted Cyan
55 {255,0,255}, // Magenta for isolated point identification
56 {255,255,255}, // White for masters
57 {0,0,0}, // Black
58 {255, 0, 255} //
59}};
60
62
63// Patch generation
64void exportPointCloudNormalComputation(const std::shared_ptr<Frame>& frame, const std::vector<uvgutils::VectorN<typeGeometryInput, 3>>& pointsGeometry,
65 std::vector<uvgutils::VectorN<double, 3>>& normals);
66void exportPointCloudNormalOrientation(const std::shared_ptr<Frame>& frame, const std::vector<uvgutils::VectorN<typeGeometryInput, 3>>& pointsGeometry,
67 std::vector<uvgutils::VectorN<double, 3>>& normals);
68void exportPointCloudInitialSegmentation(const std::shared_ptr<Frame>& frame, const std::vector<uvgutils::VectorN<typeGeometryInput, 3>>& pointsGeometry,
69 const std::vector<size_t>& pointsPPIs);
70void exportPointCloudSubslices(const std::shared_ptr<Frame>& frame, const std::vector<uvgutils::VectorN<typeGeometryInput, 3>>& pointsGeometry,const std::vector<uvgutils::VectorN<uint8_t, 3>>& attributes,
71 const std::string& axisStr);
72void exportPointCloudPPIAttributionSlicing(const std::shared_ptr<Frame>& frame, const std::vector<uvgutils::VectorN<typeGeometryInput, 3>>& pointsGeometry,
73 const std::vector<size_t>& pointsPPIs);
74void exportPointCloudRefineSegmentation(const std::shared_ptr<Frame>& frame, const std::vector<uvgutils::VectorN<typeGeometryInput, 3>>& pointsGeometry,
75 const std::vector<size_t>& pointsPPIs);
76void exportPointCloudPatchSegmentationColor(const std::shared_ptr<Frame>& frame);
77void exportPointCloudPatchSegmentationBorder(const std::shared_ptr<Frame>& frame);
78void exportPointCloudPatchSegmentationBorderBlank(const std::shared_ptr<Frame>& frame);
79
80// Map generation
81void exportImageOccupancy(const std::shared_ptr<Frame>& frame);
82void exportImageOccupancyDS(const std::shared_ptr<Frame>& frame);
83void exportImageAttribute(const std::shared_ptr<Frame>& frame);
84void exportImageGeometry(const std::shared_ptr<Frame>& frame);
85void exportImageAttributeBgFill(const std::shared_ptr<Frame>& frame);
86void exportImageGeometryBgFill(const std::shared_ptr<Frame>& frame);
87void exportImageAttributeYUV(const std::shared_ptr<Frame>& frame);
88
89// Map encoding
90void exportOccupancyBitstream(const std::shared_ptr<uvgvpcc_enc::GOF>& gof, const std::vector<uint8_t>& bitstream,
91 const std::string& codecExtension);
92void exportAttributeBitstream(const std::shared_ptr<uvgvpcc_enc::GOF>& gof, const std::vector<uint8_t>& bitstream,
93 const std::string& codecExtension);
94void exportGeometryBitstream(const std::shared_ptr<uvgvpcc_enc::GOF>& gof, const std::vector<uint8_t>& bitstream,
95 const std::string& codecExtension);
96
97// Bitstream generation
98void exportAtlasInformation(const size_t& gofId, const std::string& logLine);
99
100
101} // namespace FileExport
Definition utils.hpp:49
Definition fileExport.cpp:267
void exportPointCloudPatchSegmentationColor(const std::shared_ptr< Frame > &frame)
Definition fileExport.cpp:392
const std::array< uvgutils::VectorN< uint8_t, 3 >, 10 > ppiColors
Definition fileExport.hpp:48
void exportPointCloudRefineSegmentation(const std::shared_ptr< Frame > &frame, const std::vector< uvgutils::VectorN< typeGeometryInput, 3 > > &pointsGeometry, const std::vector< size_t > &pointsPPIs)
Definition fileExport.cpp:376
void cleanIntermediateFiles()
Definition fileExport.cpp:269
void exportImageGeometryBgFill(const std::shared_ptr< Frame > &frame)
Definition fileExport.cpp:673
void exportAttributeBitstream(const std::shared_ptr< uvgvpcc_enc::GOF > &gof, const std::vector< uint8_t > &bitstream, const std::string &codecExtension)
Definition fileExport.cpp:708
void exportPointCloudSubslices(const std::shared_ptr< Frame > &frame, const std::vector< uvgutils::VectorN< typeGeometryInput, 3 > > &pointsGeometry, const std::vector< uvgutils::VectorN< uint8_t, 3 > > &attributes, const std::string &axisStr)
Definition fileExport.cpp:348
void exportGeometryBitstream(const std::shared_ptr< uvgvpcc_enc::GOF > &gof, const std::vector< uint8_t > &bitstream, const std::string &codecExtension)
Definition fileExport.cpp:718
void exportPointCloudNormalOrientation(const std::shared_ptr< Frame > &frame, const std::vector< uvgutils::VectorN< typeGeometryInput, 3 > > &pointsGeometry, std::vector< uvgutils::VectorN< double, 3 > > &normals)
Definition fileExport.cpp:314
void exportImageAttributeYUV(const std::shared_ptr< Frame > &frame)
Definition fileExport.cpp:686
void exportPointCloudInitialSegmentation(const std::shared_ptr< Frame > &frame, const std::vector< uvgutils::VectorN< typeGeometryInput, 3 > > &pointsGeometry, const std::vector< size_t > &pointsPPIs)
Definition fileExport.cpp:332
void exportPointCloudPatchSegmentationBorder(const std::shared_ptr< Frame > &frame)
Definition fileExport.cpp:435
void exportAtlasInformation(const size_t &gofId, const std::string &logLine)
Definition fileExport.cpp:728
void exportImageAttributeBgFill(const std::shared_ptr< Frame > &frame)
Definition fileExport.cpp:660
void exportOccupancyBitstream(const std::shared_ptr< uvgvpcc_enc::GOF > &gof, const std::vector< uint8_t > &bitstream, const std::string &codecExtension)
Definition fileExport.cpp:698
void exportImageOccupancy(const std::shared_ptr< Frame > &frame)
Definition fileExport.cpp:578
void exportPointCloudNormalComputation(const std::shared_ptr< Frame > &frame, const std::vector< uvgutils::VectorN< typeGeometryInput, 3 > > &pointsGeometry, std::vector< uvgutils::VectorN< double, 3 > > &normals)
Definition fileExport.cpp:296
void exportPointCloudPPIAttributionSlicing(const std::shared_ptr< Frame > &frame, const std::vector< uvgutils::VectorN< typeGeometryInput, 3 > > &pointsGeometry, const std::vector< size_t > &pointsPPIs)
Definition fileExport.cpp:360
void exportImageGeometry(const std::shared_ptr< Frame > &frame)
Definition fileExport.cpp:648
void exportImageOccupancyDS(const std::shared_ptr< Frame > &frame)
Definition fileExport.cpp:606
void exportImageAttribute(const std::shared_ptr< Frame > &frame)
Definition fileExport.cpp:636
void exportPointCloudPatchSegmentationBorderBlank(const std::shared_ptr< Frame > &frame)
Definition fileExport.cpp:507
Definition uvgvpcc.hpp:55
size_t gofId
Definition uvgvpcc.cpp:89