source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/vrippack-0.31/src/vrip/DepthMap.h @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 2.5 KB
Line 
1/*
2
3Brian Curless
4
5Computer Graphics Laboratory
6Stanford University
7
8---------------------------------------------------------------------
9
10Copyright (1997) The Board of Trustees of the Leland Stanford Junior
11University. Except for commercial resale, lease, license or other
12commercial transactions, permission is hereby given to use, copy,
13modify this software for academic purposes only.  No part of this
14software or any derivatives thereof may be used in the production of
15computer models for resale or for use in a commercial
16product. STANFORD MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND
17CONCERNING THIS SOFTWARE.  No support is implied or provided.
18
19*/
20
21
22#ifndef _DEPTH_MAP_
23#define _DEPTH_MAP_
24
25#include "vrip.h"
26
27struct DepthElement {
28    float z;
29    float conf;
30};
31
32
33struct DepthTreeElement {
34    float minZ;
35    float maxZ;
36};
37
38
39struct DepthMapNorm {
40    signed char nx;
41    signed char ny;
42    signed char nz;
43};
44
45
46class DepthMap {
47
48  public:
49    enum {TRIANGLE_ONE=0x1, TRIANGLE_TWO=0x2, 
50          TRIANGLE_THREE=0x4, TRIANGLE_FOUR=0x8};
51
52    int xdim;
53    int ydim;
54    float resolution;
55    vec2f origin;
56    DepthElement *elems;
57    uchar *tags;
58    DepthMapNorm *norms;
59    signed char *edgeSteps;
60    DepthTreeElement ***treeElems;
61    DepthTreeElement ***holeTreeElems;
62    int *leafIndices;
63    int *runs;
64    int treeDepth;
65    int treeGranularity;
66
67    int origTreeDepth;
68    int origXdim;
69    int origYdim;
70
71    int linePersp;
72    int perspective;
73
74    DepthMap();
75    DepthMap(int,int,int);
76    DepthMap(int,int,int,int);
77
78    ~DepthMap();
79
80    void tagCellsForResampling();
81    int writePly(const char*, float noiseLevel);
82    void updateNx();
83    void updateNy();
84    void updateNz();
85    void updateEdgeSteps();
86    void normalize();
87    int reuse(int xd, int yd);
88    void initTree(int granularity);
89    void fillTree(int numLines);
90    void pullUpTree(int y, int level);
91    int * getDepthRuns(float y, float zmin, float zmax, int *numRuns);
92    void consolidateRuns(int *leafIndices, int numLeaves, int *numRuns);
93    void traverseTree(int y, int level, int off, float zmin, float zmax,
94                      int *leafIndices, int *numLeaves);
95    int *getDepthRunsUpperBound(float y, float zmax, int *numRuns);
96    void traverseTreeUpperBound(int y, int level, int off, float zmax,
97                                int *leafIndices, int *numLeaves);
98    int *getDepthRunsEdges(float y, float zmax, int *numRuns);
99    void traverseTreeEdges(int y, int level, int off, float zmax,
100                                int *leafIndices, int *numLeaves);
101};
102
103
104#endif
Note: See TracBrowser for help on using the repository browser.