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/utils.hpp"
41#include "uvgvpcc/uvgvpcc.hpp"
42
43using namespace uvgvpcc_enc;
44
45namespace FileExport {
46
47const std::array<Vector3<uint8_t>, 10> ppiColors = {{
48 {91, 91, 91}, // Charcoal Gray
49 {0, 102, 51}, // Forest Green
50 {153, 0, 0}, // Rich Crimson
51 {0, 51, 102}, // Deep Blue
52 {255, 204, 0}, // Golden Yellow
53 {102, 204, 204}, // Muted Cyan
54 {255,0,255}, // Magenta for isolated point identification
55 {255,255,255}, // White for masters
56 {0,0,0}, // Black
57 {255, 0, 255} //
58}};
59
61
62// Patch generation
63void exportPointCloudNormalComputation(const std::shared_ptr<Frame>& frame, const std::vector<Vector3<typeGeometryInput>>& pointsGeometry,
64 std::vector<Vector3<double>>& normals);
65void exportPointCloudNormalOrientation(const std::shared_ptr<Frame>& frame, const std::vector<Vector3<typeGeometryInput>>& pointsGeometry,
66 std::vector<Vector3<double>>& normals);
67void exportPointCloudInitialSegmentation(const std::shared_ptr<Frame>& frame, const std::vector<Vector3<typeGeometryInput>>& pointsGeometry,
68 const std::vector<size_t>& pointsPPIs);
69void exportPointCloudSubslices(const std::shared_ptr<Frame>& frame, const std::vector<Vector3<typeGeometryInput>>& pointsGeometry,const std::vector<Vector3<uint8_t>>& attributes,
70 const std::string& axisStr);
71void exportPointCloudPPIAttributionSlicing(const std::shared_ptr<Frame>& frame, const std::vector<Vector3<typeGeometryInput>>& pointsGeometry,
72 const std::vector<size_t>& pointsPPIs);
73void exportPointCloudRefineSegmentation(const std::shared_ptr<Frame>& frame, const std::vector<Vector3<typeGeometryInput>>& pointsGeometry,
74 const std::vector<size_t>& pointsPPIs);
75void exportPointCloudPatchSegmentationColor(const std::shared_ptr<Frame>& frame);
76void exportPointCloudPatchSegmentationBorder(const std::shared_ptr<Frame>& frame);
77void exportPointCloudPatchSegmentationBorderBlank(const std::shared_ptr<Frame>& frame);
78
79// Map generation
80void exportImageOccupancy(const std::shared_ptr<Frame>& frame);
81void exportImageOccupancyDS(const std::shared_ptr<Frame>& frame);
82void exportImageAttribute(const std::shared_ptr<Frame>& frame);
83void exportImageGeometry(const std::shared_ptr<Frame>& frame);
84void exportImageAttributeBgFill(const std::shared_ptr<Frame>& frame);
85void exportImageGeometryBgFill(const std::shared_ptr<Frame>& frame);
86void exportImageAttributeYUV(const std::shared_ptr<Frame>& frame);
87
88// Map encoding
89void exportOccupancyBitstream(const std::shared_ptr<uvgvpcc_enc::GOF>& gof, const std::vector<uint8_t>& bitstream,
90 const std::string& codecExtension);
91void exportAttributeBitstream(const std::shared_ptr<uvgvpcc_enc::GOF>& gof, const std::vector<uint8_t>& bitstream,
92 const std::string& codecExtension);
93void exportGeometryBitstream(const std::shared_ptr<uvgvpcc_enc::GOF>& gof, const std::vector<uint8_t>& bitstream,
94 const std::string& codecExtension);
95
96// Bitstream generation
97void exportAtlasInformation(const size_t& gofId, const std::string& logLine);
98
99
100} // namespace FileExport
Definition utils.hpp:60
Definition fileExport.cpp:222
void exportPointCloudPatchSegmentationColor(const std::shared_ptr< Frame > &frame)
Definition fileExport.cpp:341
void cleanIntermediateFiles()
Definition fileExport.cpp:224
void exportPointCloudSubslices(const std::shared_ptr< Frame > &frame, const std::vector< Vector3< typeGeometryInput > > &pointsGeometry, const std::vector< Vector3< uint8_t > > &attributes, const std::string &axisStr)
Definition fileExport.cpp:300
void exportImageGeometryBgFill(const std::shared_ptr< Frame > &frame)
Definition fileExport.cpp:622
void exportAttributeBitstream(const std::shared_ptr< uvgvpcc_enc::GOF > &gof, const std::vector< uint8_t > &bitstream, const std::string &codecExtension)
Definition fileExport.cpp:655
void exportGeometryBitstream(const std::shared_ptr< uvgvpcc_enc::GOF > &gof, const std::vector< uint8_t > &bitstream, const std::string &codecExtension)
Definition fileExport.cpp:663
void exportImageAttributeYUV(const std::shared_ptr< Frame > &frame)
Definition fileExport.cpp:634
void exportPointCloudNormalOrientation(const std::shared_ptr< Frame > &frame, const std::vector< Vector3< typeGeometryInput > > &pointsGeometry, std::vector< Vector3< double > > &normals)
Definition fileExport.cpp:268
const std::array< Vector3< uint8_t >, 10 > ppiColors
Definition fileExport.hpp:47
void exportPointCloudNormalComputation(const std::shared_ptr< Frame > &frame, const std::vector< Vector3< typeGeometryInput > > &pointsGeometry, std::vector< Vector3< double > > &normals)
Definition fileExport.cpp:251
void exportPointCloudPatchSegmentationBorder(const std::shared_ptr< Frame > &frame)
Definition fileExport.cpp:383
void exportAtlasInformation(const size_t &gofId, const std::string &logLine)
Definition fileExport.cpp:672
void exportImageAttributeBgFill(const std::shared_ptr< Frame > &frame)
Definition fileExport.cpp:610
void exportOccupancyBitstream(const std::shared_ptr< uvgvpcc_enc::GOF > &gof, const std::vector< uint8_t > &bitstream, const std::string &codecExtension)
Definition fileExport.cpp:646
void exportImageOccupancy(const std::shared_ptr< Frame > &frame)
Definition fileExport.cpp:531
void exportPointCloudRefineSegmentation(const std::shared_ptr< Frame > &frame, const std::vector< Vector3< typeGeometryInput > > &pointsGeometry, const std::vector< size_t > &pointsPPIs)
Definition fileExport.cpp:326
void exportPointCloudInitialSegmentation(const std::shared_ptr< Frame > &frame, const std::vector< Vector3< typeGeometryInput > > &pointsGeometry, const std::vector< size_t > &pointsPPIs)
Definition fileExport.cpp:285
void exportImageGeometry(const std::shared_ptr< Frame > &frame)
Definition fileExport.cpp:599
void exportImageOccupancyDS(const std::shared_ptr< Frame > &frame)
Definition fileExport.cpp:558
void exportImageAttribute(const std::shared_ptr< Frame > &frame)
Definition fileExport.cpp:588
void exportPointCloudPPIAttributionSlicing(const std::shared_ptr< Frame > &frame, const std::vector< Vector3< typeGeometryInput > > &pointsGeometry, const std::vector< size_t > &pointsPPIs)
Definition fileExport.cpp:311
void exportPointCloudPatchSegmentationBorderBlank(const std::shared_ptr< Frame > &frame)
Definition fileExport.cpp:457
Definition log.hpp:48
size_t gofId
Definition uvgvpcc.cpp:90