Blender
V2.93
source
blender
compositor
operations
COM_ScreenLensDistortionOperation.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 2011, Blender Foundation.
17
*/
18
19
#pragma once
20
21
#include "
COM_NodeOperation.h
"
22
#include "
DNA_node_types.h
"
23
24
struct
RNG
;
25
26
namespace
blender::compositor
{
27
28
class
ScreenLensDistortionOperation
:
public
NodeOperation
{
29
private
:
33
SocketReader
*m_inputProgram;
34
struct
RNG
*m_rng;
35
36
bool
m_fit;
37
bool
m_jitter;
38
39
float
m_dispersion;
40
float
m_distortion;
41
bool
m_dispersion_const;
42
bool
m_distortion_const;
43
bool
m_variables_ready;
44
float
m_k[3];
45
float
m_k4[3];
46
float
m_dk4[3];
47
float
m_maxk;
48
float
m_sc, m_cx, m_cy;
49
50
public
:
51
ScreenLensDistortionOperation
();
52
56
void
executePixel
(
float
output
[4],
int
x
,
int
y
,
void
*
data
)
override
;
57
61
void
initExecution
()
override
;
62
63
void
*
initializeTileData
(
rcti
*rect)
override
;
67
void
deinitExecution
()
override
;
68
69
void
setFit
(
bool
fit)
70
{
71
m_fit = fit;
72
}
73
void
setJitter
(
bool
jitter)
74
{
75
m_jitter = jitter;
76
}
77
79
void
setDistortion
(
float
distortion);
81
void
setDispersion
(
float
dispersion);
82
83
bool
determineDependingAreaOfInterest
(
rcti
*input,
84
ReadBufferOperation
*readOperation,
85
rcti
*
output
)
override
;
86
87
private
:
88
void
determineUV(
float
result
[6],
float
x
,
float
y
)
const
;
89
void
updateVariables(
float
distortion,
float
dispersion);
90
91
void
get_uv(
const
float
xy[2],
float
uv[2])
const
;
92
void
distort_uv(
const
float
uv[2],
float
t
,
float
xy[2])
const
;
93
bool
get_delta(
float
r_sq,
float
k4,
const
float
uv[2],
float
delta[2])
const
;
94
void
accumulate(
MemoryBuffer
*
buffer
,
95
int
a
,
96
int
b,
97
float
r_sq,
98
const
float
uv[2],
99
const
float
delta[3][2],
100
float
sum
[4],
101
int
count
[3])
const
;
102
};
103
104
}
// namespace blender::compositor
result
double result
Definition:
BLI_expr_pylike_eval_test.cc:348
x
x
Definition:
BLI_expr_pylike_eval_test.cc:342
COM_NodeOperation.h
DNA_node_types.h
y
_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
Definition:
GPU_legacy_stubs.h:206
t
_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 GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
Definition:
GPU_legacy_stubs.h:439
data
data
Definition:
bmesh_operator_api_inline.h:176
output
#define output
sum
static T sum(const btAlignedObjectArray< T > &items)
Definition:
btSoftBodyHelpers.cpp:94
blender::compositor::MemoryBuffer
a MemoryBuffer contains access to the data of a chunk
Definition:
COM_MemoryBuffer.h:52
blender::compositor::NodeOperation
NodeOperation contains calculation logic.
Definition:
COM_NodeOperation.h:259
blender::compositor::ReadBufferOperation
Definition:
COM_ReadBufferOperation.h:27
blender::compositor::ScreenLensDistortionOperation
Definition:
COM_ScreenLensDistortionOperation.h:28
blender::compositor::ScreenLensDistortionOperation::setJitter
void setJitter(bool jitter)
Definition:
COM_ScreenLensDistortionOperation.h:73
blender::compositor::ScreenLensDistortionOperation::deinitExecution
void deinitExecution() override
Definition:
COM_ScreenLensDistortionOperation.cc:204
blender::compositor::ScreenLensDistortionOperation::determineDependingAreaOfInterest
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) override
Definition:
COM_ScreenLensDistortionOperation.cc:226
blender::compositor::ScreenLensDistortionOperation::setFit
void setFit(bool fit)
Definition:
COM_ScreenLensDistortionOperation.h:69
blender::compositor::ScreenLensDistortionOperation::setDispersion
void setDispersion(float dispersion)
Definition:
COM_ScreenLensDistortionOperation.cc:50
blender::compositor::ScreenLensDistortionOperation::setDistortion
void setDistortion(float distortion)
Definition:
COM_ScreenLensDistortionOperation.cc:44
blender::compositor::ScreenLensDistortionOperation::initializeTileData
void * initializeTileData(rcti *rect) override
Definition:
COM_ScreenLensDistortionOperation.cc:75
blender::compositor::ScreenLensDistortionOperation::ScreenLensDistortionOperation
ScreenLensDistortionOperation()
Definition:
COM_ScreenLensDistortionOperation.cc:29
blender::compositor::ScreenLensDistortionOperation::initExecution
void initExecution() override
Definition:
COM_ScreenLensDistortionOperation.cc:56
blender::compositor::ScreenLensDistortionOperation::executePixel
void executePixel(float output[4], int x, int y, void *data) override
Definition:
COM_ScreenLensDistortionOperation.cc:166
count
int count
Definition:
interface_widgets.c:1165
buffer
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int ccl_global float * buffer
Definition:
kernel_split_function.h:33
Freestyle::a
static unsigned a[3]
Definition:
RandGen.cpp:92
blender::compositor
Definition:
COM_defines.h:21
RNG
Definition:
rand.cc:48
rcti
Definition:
DNA_vec_types.h:78
Generated on Tue Jan 31 2023 14:37:24 for Blender by
doxygen
1.9.1