Blender  V2.93
COM_PlaneDistortCommonOperation.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 
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 
33 #define PLANE_DISTORT_MAX_SAMPLES 64
34 
36  protected:
37  struct MotionSample {
38  float frameSpaceCorners[4][2]; /* Corners coordinates in pixel space. */
39  float perspectiveMatrix[3][3];
40  };
45 
46  public:
48 
49  void calculateCorners(const float corners[4][2], bool normalized, int sample);
50 
51  void initExecution() override;
52  void deinitExecution() override;
53 
54  void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
55 
57  ReadBufferOperation *readOperation,
58  rcti *output) override;
59 
60  void setMotionBlurSamples(int samples)
61  {
63  this->m_motion_blur_samples = samples;
64  }
65  void setMotionBlurShutter(float shutter)
66  {
67  this->m_motion_blur_shutter = shutter;
68  }
69 };
70 
72  protected:
73  struct MotionSample {
74  float frameSpaceCorners[4][2]; /* Corners coordinates in pixel space. */
75  };
76  int m_osa;
78  float m_jitter[32][2];
81 
82  public:
84 
85  void calculateCorners(const float corners[4][2], bool normalized, int sample);
86 
87  void initExecution() override;
88 
89  void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
90 
91  void setMotionBlurSamples(int samples)
92  {
94  this->m_motion_blur_samples = samples;
95  }
96  void setMotionBlurShutter(float shutter)
97  {
98  this->m_motion_blur_shutter = shutter;
99  }
100 };
101 
102 } // namespace blender::compositor
#define BLI_assert(a)
Definition: BLI_assert.h:58
#define PLANE_DISTORT_MAX_SAMPLES
_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
SIMD_FORCE_INLINE btVector3 normalized() const
Return a normalized version of this vector.
NodeOperation contains calculation logic.
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void calculateCorners(const float corners[4][2], bool normalized, int sample)
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) override
void calculateCorners(const float corners[4][2], bool normalized, int sample)
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
static void sample(SocketReader *reader, int x, int y, float color[4])