[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59100] branches/soc-2013-vse/source/ blender/sequencer: Initial seqViewHandle:

Alexander Kuznetsov kuzsasha at gmail.com
Tue Aug 13 07:36:36 CEST 2013


Revision: 59100
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59100
Author:   alexk
Date:     2013-08-13 05:36:36 +0000 (Tue, 13 Aug 2013)
Log Message:
-----------
Initial seqViewHandle:
   Each sequencer space registers a new viewhandle. It is used to keep the list of image outputs of different size we must to render including scopes.
Blender requests to render a frame, and we render for all views. Then each view request its buffer for actual drawing. 

Modified Paths:
--------------
    branches/soc-2013-vse/source/blender/sequencer/sequencer_main.h
    branches/soc-2013-vse/source/blender/sequencer/sequencer_seqEngine.h

Added Paths:
-----------
    branches/soc-2013-vse/source/blender/sequencer/sequencer_seqViewHandle.h

Modified: branches/soc-2013-vse/source/blender/sequencer/sequencer_main.h
===================================================================
--- branches/soc-2013-vse/source/blender/sequencer/sequencer_main.h	2013-08-13 05:01:05 UTC (rev 59099)
+++ branches/soc-2013-vse/source/blender/sequencer/sequencer_main.h	2013-08-13 05:36:36 UTC (rev 59100)
@@ -18,27 +18,40 @@
 
 #ifndef __cplusplus
 typedef struct seqEngine seqEngine;
+typedef struct seqViewHandle seqViewHandle;
 #else
 class seqEngine;
+class seqViewHandle;
 #endif
 
 
-typedef struct SeqCanvasInfo
+
+
+typedef struct seqViewData
 {
-	int memory_size[2];
-	float real_size[2];
-} SeqCanvasInfo;
+	void *pointer;
+	int phys_size[2];
+} seqViewData;
 
 
 
 
-void SEQ_display_frame(Scene *scene, int cframe, SeqCanvasInfo *can);
+void SEQ_display_frame(Scene *scene, int cframe);
 void SEQ_seqEngine_start(seqEngine *engine/*cldm param,*/);
 void SEQ_Engine_exit(void);
 
 
 
+seqViewHandle *SEQ_AddView(void);
+void SEQ_RemoveVew(seqViewHandle * view);
+seqViewData SEQ_ViewGetData(seqViewHandle *view);
 
+void SEQ_ViewVisible(seqViewHandle *view, int visible);
+void SEQ_ViewSetResolution(seqViewHandle *view, int width, int height);
+
+
+
+
 #ifdef __cplusplus
 }
 #endif

Modified: branches/soc-2013-vse/source/blender/sequencer/sequencer_seqEngine.h
===================================================================
--- branches/soc-2013-vse/source/blender/sequencer/sequencer_seqEngine.h	2013-08-13 05:01:05 UTC (rev 59099)
+++ branches/soc-2013-vse/source/blender/sequencer/sequencer_seqEngine.h	2013-08-13 05:36:36 UTC (rev 59100)
@@ -12,9 +12,13 @@
 
 #include <list>
 #include <vector>
+#include <algorithm>
 #include "sequencer_seqDevice.h"
 #include "sequencer_include.h"
+#include "sequencer_seqViewHandle.h"
 
+void seqRegisterEffects(void);
+
 class seqEngine
 {
 
@@ -27,23 +31,50 @@
 	std::vector<seqCLPlatform*>  clplatformlist;
 	std::list<seqBucket*>  list_buckets_todo;
 
+	// must be list as we use pointers
+	std::list<seqViewHandle> list_views;
 
-	scond buckets_notifiication;
+
+
+	scond buckets_notification;
 	smutex omutex;
 
+
 	seqEngine(void):
-	buckets_notifiication(&omutex)
+		buckets_notification(&omutex)
 	{
+		seqRegisterEffects();
+	}
 
+
+	seqViewHandle *view_add(seqViewHandle *n)
+	{
+		list_views.push_back(*n);
+		return &(list_views.back());
 	}
 
+	void view_remove(seqViewHandle *view)
+	{
+		for(std::list<seqViewHandle>::iterator it = list_views.begin(); it!=list_views.end(); it++)
+		{
+			if(&(*it) == view)
+			{
+				list_views.erase(it);
+				break;
+			}
 
+		}
 
+	}
+
+
+
+
 	void NotifyBucketChange()
 	{
-		buckets_notifiication.lock();
-		buckets_notifiication.broadcast();
-		buckets_notifiication.unlock();
+		buckets_notification.lock();
+		buckets_notification.broadcast();
+		buckets_notification.unlock();
 	}
 
 	MEM_CXX_CLASS_ALLOC_FUNCS("seqEngine");

Added: branches/soc-2013-vse/source/blender/sequencer/sequencer_seqViewHandle.h
===================================================================
--- branches/soc-2013-vse/source/blender/sequencer/sequencer_seqViewHandle.h	                        (rev 0)
+++ branches/soc-2013-vse/source/blender/sequencer/sequencer_seqViewHandle.h	2013-08-13 05:36:36 UTC (rev 59100)
@@ -0,0 +1,77 @@
+#ifndef __SEQUENCER_SEQVIEWHANDLE_H__
+#define __SEQUENCER_SEQVIEWHANDLE_H__
+
+#include "MEM_guardedalloc.h"
+#include "sequencer_main.h"
+#include <math.h>
+
+class seqEngine;
+
+typedef enum seqViewType
+{
+	SEQ_VIEW_PICTURE,
+	SEQ_VIEW_HISTOGRAm
+
+} seqViewType;
+
+class seqViewHandle{
+
+
+private:
+	float size[2];
+	int phys_size[2];
+	seqViewType type;
+	bool visible;
+
+
+	void phys_size_update()
+	{
+		phys_size[0] = ceil(size[0]);
+		phys_size[1] = ceil(size[1]);
+	}
+
+public:
+
+	void set_visable(bool v)
+	{
+		visible = v;
+		//engine add outputs
+	}
+
+	void set_size(float width, float height)
+	{
+		size[0] = width;
+		size[1] = height;
+
+		phys_size_update();
+
+	}
+
+	float get_sizex(){
+		return size[0];
+	}
+
+	float get_sizey(){
+		return size[1];
+	}
+
+	seqViewHandle() :
+		type(SEQ_VIEW_PICTURE),
+		visible(false)
+	{
+		type = SEQ_VIEW_PICTURE;
+		size[0] = size[1] =0.0f;
+		phys_size[0] = phys_size[1] = 0;
+
+	}
+
+	seqViewData getData(seqEngine *se);
+
+
+	MEM_CXX_CLASS_ALLOC_FUNCS("seqViewHendle");
+
+};
+
+
+
+#endif /* __SEQUENCER_SEQVIEWHANDLE_H__ */




More information about the Bf-blender-cvs mailing list