~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to source/blender/compositor/nodes/COM_PlaneTrackDeformNode.cpp

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-02-19 11:24:23 UTC
  • mfrom: (14.2.23 sid)
  • Revision ID: package-import@ubuntu.com-20140219112423-rkmaz2m7ha06d4tk
Tags: 2.69-3ubuntu1
* Merge with Debian; remaining changes:
  - Configure without OpenImageIO on armhf, as it is not available on
    Ubuntu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2013, Blender Foundation.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU General Public License
 
6
 * as published by the Free Software Foundation; either version 2
 
7
 * of the License, or (at your option) any later version.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software Foundation,
 
16
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
17
 *
 
18
 * Contributor:
 
19
 *              Jeroen Bakker
 
20
 *              Monique Dewanchand
 
21
 *              Sergey Sharybin
 
22
 */
 
23
 
 
24
#include "COM_PlaneTrackDeformNode.h"
 
25
#include "COM_ExecutionSystem.h"
 
26
 
 
27
#include "COM_PlaneTrackMaskOperation.h"
 
28
#include "COM_PlaneTrackWarpImageOperation.h"
 
29
 
 
30
extern "C" {
 
31
        #include "BKE_node.h"
 
32
        #include "BKE_movieclip.h"
 
33
        #include "BKE_tracking.h"
 
34
}
 
35
 
 
36
PlaneTrackDeformNode::PlaneTrackDeformNode(bNode *editorNode) : Node(editorNode)
 
37
{
 
38
        /* pass */
 
39
}
 
40
 
 
41
void PlaneTrackDeformNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context)
 
42
{
 
43
        InputSocket *input_image = this->getInputSocket(0);
 
44
 
 
45
        OutputSocket *output_warped_image = this->getOutputSocket(0);
 
46
        OutputSocket *output_plane = this->getOutputSocket(1);
 
47
 
 
48
        bNode *editorNode = this->getbNode();
 
49
        MovieClip *clip = (MovieClip *) editorNode->id;
 
50
 
 
51
        NodePlaneTrackDeformData *data = (NodePlaneTrackDeformData *) editorNode->storage;
 
52
 
 
53
        int frame_number = context->getFramenumber();
 
54
 
 
55
        if (output_warped_image->isConnected()) {
 
56
                PlaneTrackWarpImageOperation *warp_image_operation = new PlaneTrackWarpImageOperation();
 
57
 
 
58
                warp_image_operation->setMovieClip(clip);
 
59
                warp_image_operation->setTrackingObject(data->tracking_object);
 
60
                warp_image_operation->setPlaneTrackName(data->plane_track_name);
 
61
                warp_image_operation->setFramenumber(frame_number);
 
62
 
 
63
                input_image->relinkConnections(warp_image_operation->getInputSocket(0), 0, graph);
 
64
                output_warped_image->relinkConnections(warp_image_operation->getOutputSocket());
 
65
 
 
66
                graph->addOperation(warp_image_operation);
 
67
        }
 
68
 
 
69
        if (output_plane->isConnected()) {
 
70
                PlaneTrackMaskOperation *plane_mask_operation = new PlaneTrackMaskOperation();
 
71
 
 
72
                plane_mask_operation->setMovieClip(clip);
 
73
                plane_mask_operation->setTrackingObject(data->tracking_object);
 
74
                plane_mask_operation->setPlaneTrackName(data->plane_track_name);
 
75
                plane_mask_operation->setFramenumber(frame_number);
 
76
 
 
77
                output_plane->relinkConnections(plane_mask_operation->getOutputSocket());
 
78
 
 
79
                graph->addOperation(plane_mask_operation);
 
80
        }
 
81
}