Blender  V2.93
COM_PlaneTrackOperation.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * Copyright 2013, Blender Foundation.
17  */
18 
19 #pragma once
20 
21 #include <string.h>
22 
24 
25 #include "DNA_movieclip_types.h"
26 #include "DNA_tracking_types.h"
27 
28 #include "BLI_listbase.h"
29 #include "BLI_string.h"
30 
31 namespace blender::compositor {
32 
34  protected:
38  char m_planeTrackName[64];
39 
40  /* note: this class is not an operation itself (to prevent virtual inheritance issues)
41  * implementation classes must make wrappers to use these methods, see below.
42  */
43  void readCornersFromTrack(float corners[4][2], float frame);
44  void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
45 
46  public:
48 
49  void setMovieClip(MovieClip *clip)
50  {
51  this->m_movieClip = clip;
52  }
53  void setTrackingObject(char *object)
54  {
55  BLI_strncpy(this->m_trackingObjectName, object, sizeof(this->m_trackingObjectName));
56  }
57  void setPlaneTrackName(char *plane_track)
58  {
59  BLI_strncpy(this->m_planeTrackName, plane_track, sizeof(this->m_planeTrackName));
60  }
61  void setFramenumber(int framenumber)
62  {
63  this->m_framenumber = framenumber;
64  }
65 };
66 
68  public:
70  {
71  }
72 
73  void initExecution() override;
74 
75  void determineResolution(unsigned int resolution[2],
76  unsigned int preferredResolution[2]) override
77  {
78  PlaneTrackCommon::determineResolution(resolution, preferredResolution);
79 
80  unsigned int temp[2];
81  NodeOperation::determineResolution(temp, resolution);
82  }
83 };
84 
86  public PlaneTrackCommon {
87  public:
89  {
90  }
91 
92  void initExecution() override;
93 
94  void determineResolution(unsigned int resolution[2],
95  unsigned int preferredResolution[2]) override
96  {
97  PlaneTrackCommon::determineResolution(resolution, preferredResolution);
98  unsigned int temp[2];
99  NodeOperation::determineResolution(temp, resolution);
100  }
101 };
102 
103 } // namespace blender::compositor
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
Definition: string.c:108
virtual void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
determine the resolution of this node
void readCornersFromTrack(float corners[4][2], float frame)
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) override
determine the resolution of this node
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) override
determine the resolution of this node