Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-04-17 07:17:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-17 07:21:24 +0300
commite12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch)
tree8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/compositor/operations/COM_TrackPositionOperation.cpp
parentb3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff)
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/compositor/operations/COM_TrackPositionOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_TrackPositionOperation.cpp180
1 files changed, 90 insertions, 90 deletions
diff --git a/source/blender/compositor/operations/COM_TrackPositionOperation.cpp b/source/blender/compositor/operations/COM_TrackPositionOperation.cpp
index dbea46a4d85..178a9b57cba 100644
--- a/source/blender/compositor/operations/COM_TrackPositionOperation.cpp
+++ b/source/blender/compositor/operations/COM_TrackPositionOperation.cpp
@@ -25,111 +25,111 @@
#include "BLI_math_color.h"
extern "C" {
-# include "BKE_movieclip.h"
-# include "BKE_node.h"
-# include "BKE_tracking.h"
+#include "BKE_movieclip.h"
+#include "BKE_node.h"
+#include "BKE_tracking.h"
}
TrackPositionOperation::TrackPositionOperation() : NodeOperation()
{
- this->addOutputSocket(COM_DT_VALUE);
- this->m_movieClip = NULL;
- this->m_framenumber = 0;
- this->m_trackingObjectName[0] = 0;
- this->m_trackName[0] = 0;
- this->m_axis = 0;
- this->m_position = CMP_TRACKPOS_ABSOLUTE;
- this->m_relativeFrame = 0;
- this->m_speed_output = false;
+ this->addOutputSocket(COM_DT_VALUE);
+ this->m_movieClip = NULL;
+ this->m_framenumber = 0;
+ this->m_trackingObjectName[0] = 0;
+ this->m_trackName[0] = 0;
+ this->m_axis = 0;
+ this->m_position = CMP_TRACKPOS_ABSOLUTE;
+ this->m_relativeFrame = 0;
+ this->m_speed_output = false;
}
void TrackPositionOperation::initExecution()
{
- MovieTracking *tracking = NULL;
- MovieClipUser user = {0};
- MovieTrackingObject *object;
-
- zero_v2(this->m_markerPos);
- zero_v2(this->m_relativePos);
-
- if (!this->m_movieClip)
- return;
-
- tracking = &this->m_movieClip->tracking;
-
- BKE_movieclip_user_set_frame(&user, this->m_framenumber);
- BKE_movieclip_get_size(this->m_movieClip, &user, &this->m_width, &this->m_height);
-
- object = BKE_tracking_object_get_named(tracking, this->m_trackingObjectName);
- if (object) {
- MovieTrackingTrack *track;
-
- track = BKE_tracking_track_get_named(tracking, object, this->m_trackName);
-
- if (track) {
- MovieTrackingMarker *marker;
- int clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(this->m_movieClip, this->m_framenumber);
-
- marker = BKE_tracking_marker_get(track, clip_framenr);
-
- copy_v2_v2(this->m_markerPos, marker->pos);
-
- if (this->m_speed_output) {
- int relative_clip_framenr =
- BKE_movieclip_remap_scene_to_clip_frame(
- this->m_movieClip,
- this->m_relativeFrame);
-
- marker = BKE_tracking_marker_get_exact(track,
- relative_clip_framenr);
- if (marker != NULL && (marker->flag & MARKER_DISABLED) == 0) {
- copy_v2_v2(this->m_relativePos, marker->pos);
- }
- else {
- copy_v2_v2(this->m_relativePos, this->m_markerPos);
- }
- if (this->m_relativeFrame < this->m_framenumber) {
- swap_v2_v2(this->m_relativePos, this->m_markerPos);
- }
- }
- else if (this->m_position == CMP_TRACKPOS_RELATIVE_START) {
- int i;
-
- for (i = 0; i < track->markersnr; i++) {
- marker = &track->markers[i];
-
- if ((marker->flag & MARKER_DISABLED) == 0) {
- copy_v2_v2(this->m_relativePos, marker->pos);
-
- break;
- }
- }
- }
- else if (this->m_position == CMP_TRACKPOS_RELATIVE_FRAME) {
- int relative_clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(this->m_movieClip,
- this->m_relativeFrame);
-
- marker = BKE_tracking_marker_get(track, relative_clip_framenr);
- copy_v2_v2(this->m_relativePos, marker->pos);
- }
- }
- }
+ MovieTracking *tracking = NULL;
+ MovieClipUser user = {0};
+ MovieTrackingObject *object;
+
+ zero_v2(this->m_markerPos);
+ zero_v2(this->m_relativePos);
+
+ if (!this->m_movieClip)
+ return;
+
+ tracking = &this->m_movieClip->tracking;
+
+ BKE_movieclip_user_set_frame(&user, this->m_framenumber);
+ BKE_movieclip_get_size(this->m_movieClip, &user, &this->m_width, &this->m_height);
+
+ object = BKE_tracking_object_get_named(tracking, this->m_trackingObjectName);
+ if (object) {
+ MovieTrackingTrack *track;
+
+ track = BKE_tracking_track_get_named(tracking, object, this->m_trackName);
+
+ if (track) {
+ MovieTrackingMarker *marker;
+ int clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(this->m_movieClip,
+ this->m_framenumber);
+
+ marker = BKE_tracking_marker_get(track, clip_framenr);
+
+ copy_v2_v2(this->m_markerPos, marker->pos);
+
+ if (this->m_speed_output) {
+ int relative_clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(this->m_movieClip,
+ this->m_relativeFrame);
+
+ marker = BKE_tracking_marker_get_exact(track, relative_clip_framenr);
+ if (marker != NULL && (marker->flag & MARKER_DISABLED) == 0) {
+ copy_v2_v2(this->m_relativePos, marker->pos);
+ }
+ else {
+ copy_v2_v2(this->m_relativePos, this->m_markerPos);
+ }
+ if (this->m_relativeFrame < this->m_framenumber) {
+ swap_v2_v2(this->m_relativePos, this->m_markerPos);
+ }
+ }
+ else if (this->m_position == CMP_TRACKPOS_RELATIVE_START) {
+ int i;
+
+ for (i = 0; i < track->markersnr; i++) {
+ marker = &track->markers[i];
+
+ if ((marker->flag & MARKER_DISABLED) == 0) {
+ copy_v2_v2(this->m_relativePos, marker->pos);
+
+ break;
+ }
+ }
+ }
+ else if (this->m_position == CMP_TRACKPOS_RELATIVE_FRAME) {
+ int relative_clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(this->m_movieClip,
+ this->m_relativeFrame);
+
+ marker = BKE_tracking_marker_get(track, relative_clip_framenr);
+ copy_v2_v2(this->m_relativePos, marker->pos);
+ }
+ }
+ }
}
void TrackPositionOperation::executePixelSampled(float output[4],
- float /*x*/, float /*y*/,
+ float /*x*/,
+ float /*y*/,
PixelSampler /*sampler*/)
{
- output[0] = this->m_markerPos[this->m_axis] - this->m_relativePos[this->m_axis];
+ output[0] = this->m_markerPos[this->m_axis] - this->m_relativePos[this->m_axis];
- if (this->m_axis == 0)
- output[0] *= this->m_width;
- else
- output[0] *= this->m_height;
+ if (this->m_axis == 0)
+ output[0] *= this->m_width;
+ else
+ output[0] *= this->m_height;
}
-void TrackPositionOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
+void TrackPositionOperation::determineResolution(unsigned int resolution[2],
+ unsigned int preferredResolution[2])
{
- resolution[0] = preferredResolution[0];
- resolution[1] = preferredResolution[1];
+ resolution[0] = preferredResolution[0];
+ resolution[1] = preferredResolution[1];
}