began custom pix fmt converter
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
NodeMedia::NodeMedia(NodeGraph* c) :
|
||||
Node(c),
|
||||
media_(nullptr),
|
||||
buffer_(c->memory_cache())
|
||||
{
|
||||
matrix_input_ = new NodeIO(this, "matrix", tr("Matrix"), true, false);
|
||||
@@ -25,65 +26,25 @@ QString NodeMedia::id()
|
||||
return "org.olivevideoeditor.Olive.media";
|
||||
}
|
||||
|
||||
double H = 0.0;
|
||||
|
||||
void NodeMedia::Process(const rational &time)
|
||||
{
|
||||
Q_UNUSED(time)
|
||||
|
||||
buffer_.buffer()->BindBuffer();
|
||||
|
||||
// DEBUG CODE - we should see a solid rainbow color return from this function
|
||||
H += 1;
|
||||
double S = 1.0;
|
||||
double V = 1.0;
|
||||
double C = S * V;
|
||||
double X = C * (1 - abs(fmod(H / 60.0, 2) - 1));
|
||||
double m = V - C;
|
||||
double Rs, Gs, Bs;
|
||||
|
||||
if(H >= 0 && H < 60) {
|
||||
Rs = C;
|
||||
Gs = X;
|
||||
Bs = 0;
|
||||
}
|
||||
else if(H >= 60 && H < 120) {
|
||||
Rs = X;
|
||||
Gs = C;
|
||||
Bs = 0;
|
||||
}
|
||||
else if(H >= 120 && H < 180) {
|
||||
Rs = 0;
|
||||
Gs = C;
|
||||
Bs = X;
|
||||
}
|
||||
else if(H >= 180 && H < 240) {
|
||||
Rs = 0;
|
||||
Gs = X;
|
||||
Bs = C;
|
||||
}
|
||||
else if(H >= 240 && H < 300) {
|
||||
Rs = X;
|
||||
Gs = 0;
|
||||
Bs = C;
|
||||
}
|
||||
else {
|
||||
Rs = C;
|
||||
Gs = 0;
|
||||
Bs = X;
|
||||
}
|
||||
|
||||
glClearColor(1.0, 0.0, 0.0, 1.0);
|
||||
glClearColor(0.5, 0.0, 1.0, 1.0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
// END DEBUG CODE
|
||||
|
||||
buffer_.buffer()->ReleaseBuffer();
|
||||
|
||||
qDebug() << "Node Media has" << buffer_.buffer()->texture();
|
||||
|
||||
texture_output_->SetValue(buffer_.buffer()->texture());
|
||||
}
|
||||
|
||||
void NodeMedia::SetMedia(Media *f)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
NodeIO *NodeMedia::matrix_input()
|
||||
{
|
||||
return matrix_input_;
|
||||
|
||||
@@ -3,7 +3,20 @@
|
||||
|
||||
#include "nodes/node.h"
|
||||
#include "rendering/memorycache.h"
|
||||
#include "project/media.h"
|
||||
|
||||
/**
|
||||
* @brief The NodeMedia class
|
||||
*
|
||||
* The NodeMedia node is the main entry point for external video/audio files into the Olive pipeline. Its
|
||||
* responsibilities are as follows:
|
||||
*
|
||||
* * Use a Decoder to retrieve the correct raw frame data
|
||||
* * Convert the frame data to the pipeline format (usually RGBA16F or RGBA32F)
|
||||
* * Convert the frame to scene linear colorspace with OpenColorIO
|
||||
*
|
||||
* Naturally this Node is resource intensive and effort should be spent here to make this as performant as possible.
|
||||
*/
|
||||
class NodeMedia : public Node
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -15,13 +28,23 @@ public:
|
||||
|
||||
virtual void Process(const rational& time) override;
|
||||
|
||||
void SetMedia(Media* f);
|
||||
|
||||
NodeIO* matrix_input();
|
||||
NodeIO* texture_output();
|
||||
|
||||
private:
|
||||
// Matrix input for the transformation to apply to this media (if any)
|
||||
NodeIO* matrix_input_;
|
||||
|
||||
// Texture output
|
||||
NodeIO* texture_output_;
|
||||
|
||||
// Media object to display
|
||||
Media* media_;
|
||||
|
||||
// Texture buffer
|
||||
// TODO Probable cache point
|
||||
MemoryCache::Reference buffer_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user