Blender  V2.93
COM_TrackPositionOperation.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 2012, Blender Foundation.
17  */
18 
19 #pragma once
20 
21 #include <string.h>
22 
23 #include "COM_NodeOperation.h"
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 
37  protected:
41  char m_trackName[64];
42  int m_axis;
46 
48  float m_markerPos[2];
49  float m_relativePos[2];
50 
54  void determineResolution(unsigned int resolution[2],
55  unsigned int preferredResolution[2]) override;
56 
57  public:
59 
60  void setMovieClip(MovieClip *clip)
61  {
62  this->m_movieClip = clip;
63  }
64  void setTrackingObject(char *object)
65  {
66  BLI_strncpy(this->m_trackingObjectName, object, sizeof(this->m_trackingObjectName));
67  }
68  void setTrackName(char *track)
69  {
70  BLI_strncpy(this->m_trackName, track, sizeof(this->m_trackName));
71  }
72  void setFramenumber(int framenumber)
73  {
74  this->m_framenumber = framenumber;
75  }
76  void setAxis(int value)
77  {
78  this->m_axis = value;
79  }
80  void setPosition(int value)
81  {
82  this->m_position = value;
83  }
84  void setRelativeFrame(int value)
85  {
86  this->m_relativeFrame = value;
87  }
88  void setSpeedOutput(bool speed_output)
89  {
90  this->m_speed_output = speed_output;
91  }
92 
93  void initExecution() override;
94 
95  void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
96 };
97 
98 } // namespace blender::compositor
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
Definition: string.c:108
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
#define output
NodeOperation contains calculation logic.
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) override