made node edge changes undoable

This commit is contained in:
itsmattkc
2019-07-17 00:14:49 -04:00
parent a78cc3950a
commit 39256fd6f9
15 changed files with 318 additions and 12 deletions
+22
View File
@@ -0,0 +1,22 @@
# Olive - Non-Linear Video Editor
# Copyright (C) 2019 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
add_subdirectory(image)
set(OLIVE_SOURCES
${OLIVE_SOURCES}
PARENT_SCOPE
)
+22
View File
@@ -0,0 +1,22 @@
# Olive - Non-Linear Video Editor
# Copyright (C) 2019 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/input/image/image.h
node/input/image/image.cpp
PARENT_SCOPE
)
+46
View File
@@ -0,0 +1,46 @@
#include "image.h"
ImageInput::ImageInput() :
texture_(nullptr)
{
texture_output_ = new NodeOutput();
texture_output_->set_data_type(NodeOutput::kTexture);
AddParameter(texture_output_);
}
QString ImageInput::Name()
{
return tr("Image");
}
QString ImageInput::Category()
{
return tr("Input");
}
QString ImageInput::Description()
{
return tr("Import an image file.");
}
NodeOutput *ImageInput::texture_output()
{
return texture_output_;
}
void ImageInput::Process(const rational &time)
{
// FIXME: Use OIIO and OCIO here
// FIXME: Test code
Q_UNUSED(time)
if (texture_ == nullptr) {
QImage img("/home/matt/Desktop/oof.png");
texture_ = new QOpenGLTexture(img);
}
texture_output_->set_value(texture_->textureId());
// End test code
}
+29
View File
@@ -0,0 +1,29 @@
#ifndef IMAGE_H
#define IMAGE_H
#include <QOpenGLTexture>
#include "node/node.h"
class ImageInput : public Node
{
Q_OBJECT
public:
ImageInput();
virtual QString Name() override;
virtual QString Category() override;
virtual QString Description() override;
NodeOutput* texture_output();
public slots:
virtual void Process(const rational &time) override;
private:
NodeOutput* texture_output_;
QOpenGLTexture* texture_;
};
#endif // IMAGE_H