yuv colorspace/range + prefs, ffmpeg colorrange probe, x11 direct force colormodel...
[goodguy/history.git] / cinelerra-5.1 / plugins / holo / holo.C
index 48c68474d321f70bcf1c9f46e3fcf1f1db9921fb..717f0f362be7df2c2f941c571a478dc1c7d9170e 100644 (file)
@@ -2,21 +2,21 @@
 /*
  * CINELERRA
  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
- * 
+ *
  * 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 2 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, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- * 
+ *
  */
 
 #include "clip.h"
@@ -26,7 +26,7 @@
 #include "holo.h"
 #include "holowindow.h"
 #include "language.h"
-#include "cicolors.h"
+#include "bccolors.h"
 
 #include <stdint.h>
 #include <stdio.h>
@@ -60,24 +60,17 @@ HoloMain::HoloMain(PluginServer *server)
        effecttv = 0;
        bgimage = 0;
        do_reconfigure = 1;
-       yuv = new YUV;
-       
 }
 
 HoloMain::~HoloMain()
 {
-       
-
-
-       if(effecttv)
-       {
+       if(effecttv) {
                delete holo_server;
                delete effecttv;
        }
 
        if(bgimage)
                delete bgimage;
-       delete yuv;
 }
 
 const char* HoloMain::plugin_title() { return _("HolographicTV"); }
@@ -195,10 +188,8 @@ total = 0;
        {
                case 0:
 /* step 1: grab frame-1 to buffer-1 */
-//                     tmp = new VFrame(0, 
-//                             input_ptr->get_w(), 
-//                             input_ptr->get_h(),
-//                             project_color_model);
+//                     tmp = new VFrame(input_ptr->get_w(),input_ptr->get_h(),
+//                             project_color_model, 0);
                        bgimage->copy_from(input_ptr);
                        break;
 
@@ -247,12 +238,8 @@ int HoloMain::process_realtime(VFrame *input_ptr, VFrame *output_ptr)
                if(!effecttv)
                {
                        effecttv = new EffectTV(input_ptr->get_w(), input_ptr->get_h());
-                       bgimage = new VFrame(0, 
-                               -1,
-                               input_ptr->get_w(), 
-                               input_ptr->get_h(), 
-                               input_ptr->get_color_model(),
-                               -1);
+                       bgimage = new VFrame(input_ptr->get_w(), input_ptr->get_h(),
+                               input_ptr->get_color_model(), 0);
 
                        for(int i = 0; i < 256; i++)
                        {
@@ -266,9 +253,9 @@ int HoloMain::process_realtime(VFrame *input_ptr, VFrame *output_ptr)
        }
 
        set_background();
-       
+
        holo_server->process_packages();
-       
+
        total++;
        if(total >= config.recycle * project_frame_rate)
                total = 0;
@@ -287,7 +274,7 @@ HoloServer::HoloServer(HoloMain *plugin, int total_clients, int total_packages)
 }
 
 
-LoadClient* HoloServer::new_client() 
+LoadClient* HoloServer::new_client()
 {
        return new HoloClient(this);
 }
@@ -295,9 +282,9 @@ LoadClient* HoloServer::new_client()
 
 
 
-LoadPackage* HoloServer::new_package() 
-{ 
-       return new HoloPackage; 
+LoadPackage* HoloServer::new_package()
+{
+       return new HoloPackage;
 }
 
 
@@ -339,7 +326,7 @@ void HoloClient::process_package(LoadPackage *package)
        uint32_t s, t;
        int r, g, b;
 
-       diff = plugin->effecttv->image_diff_filter(plugin->effecttv->image_bgsubtract_y(input_rows, 
+       diff = plugin->effecttv->image_diff_filter(plugin->effecttv->image_bgsubtract_y(input_rows,
                plugin->input_ptr->get_color_model()));
 
        diff += width;
@@ -367,7 +354,7 @@ if(sizeof(type) == 2) \
                int r = (int)src[0] >> 8; \
                int g = (int)src[1] >> 8; \
                int b = (int)src[2] >> 8; \
-               plugin->yuv->yuv_to_rgb_8(r, g, b); \
+               YUV::yuv.yuv_to_rgb_8(r, g, b); \
                dest = (r << 16) | (g << 8) | b; \
        } \
        else \
@@ -384,7 +371,7 @@ else \
                int r = (int)src[0]; \
                int g = (int)src[1]; \
                int b = (int)src[2]; \
-               plugin->yuv->yuv_to_rgb_8(r, g, b); \
+               YUV::yuv.yuv_to_rgb_8(r, g, b); \
                dest = (r << 16) | (g << 8) | b; \
        } \
        else \
@@ -441,7 +428,7 @@ else \
                                        if(g > 255) g = 255; \
                                        if(b > 255) b = 255; \
  \
-                                       if(is_yuv) plugin->yuv->rgb_to_yuv_8(r, g, b); \
+                                       if(is_yuv) YUV::yuv.rgb_to_yuv_8(r, g, b); \
                                        if(sizeof(type) == 4) \
                                        { \
                                                dest[0] = (type)r / 0xff; \
@@ -508,7 +495,7 @@ else \
                                        if(g > 255) g = 255; \
                                        if(b > 255) b = 255; \
  \
-                                       if(is_yuv) plugin->yuv->rgb_to_yuv_8(r, g, b); \
+                                       if(is_yuv) YUV::yuv.rgb_to_yuv_8(r, g, b); \
                                        if(sizeof(type) == 4) \
                                        { \
                                                dest[0] = (type)r / 0xff; \