00001 #ifndef SWAPCHANNELS_H 00002 #define SWAPCHANNELS_H 00003 00004 #include "bchash.inc" 00005 #include "guicast.h" 00006 #include "mutex.h" 00007 #include "pluginvclient.h" 00008 #include "vframe.inc" 00009 00010 00011 00012 00013 00014 class SwapMain; 00015 00016 #define RED_SRC 0 00017 #define GREEN_SRC 1 00018 #define BLUE_SRC 2 00019 #define ALPHA_SRC 3 00020 #define NO_SRC 4 00021 #define MAX_SRC 5 00022 00023 00024 00025 class SwapConfig 00026 { 00027 public: 00028 SwapConfig(); 00029 00030 int equivalent(SwapConfig &that); 00031 void copy_from(SwapConfig &that); 00032 00033 int red; 00034 int green; 00035 int blue; 00036 int alpha; 00037 }; 00038 00039 00040 00041 class SwapMenu : public BC_PopupMenu 00042 { 00043 public: 00044 SwapMenu(SwapMain *client, int *output, int x, int y); 00045 00046 00047 int handle_event(); 00048 int create_objects(); 00049 00050 SwapMain *client; 00051 int *output; 00052 }; 00053 00054 00055 class SwapItem : public BC_MenuItem 00056 { 00057 public: 00058 SwapItem(SwapMenu *menu, char *title); 00059 00060 int handle_event(); 00061 00062 SwapMenu *menu; 00063 char *title; 00064 }; 00065 00066 class SwapWindow : public BC_Window 00067 { 00068 public: 00069 SwapWindow(SwapMain *plugin, int x, int y); 00070 ~SwapWindow(); 00071 00072 00073 void create_objects(); 00074 int close_event(); 00075 00076 SwapMain *plugin; 00077 SwapMenu *red; 00078 SwapMenu *green; 00079 SwapMenu *blue; 00080 SwapMenu *alpha; 00081 }; 00082 00083 00084 00085 00086 PLUGIN_THREAD_HEADER(SwapMain, SwapThread, SwapWindow) 00087 00088 00089 00090 class SwapMain : public PluginVClient 00091 { 00092 public: 00093 SwapMain(PluginServer *server); 00094 ~SwapMain(); 00095 00096 // required for all realtime plugins 00097 int process_realtime(VFrame *input_ptr, VFrame *output_ptr); 00098 int is_realtime(); 00099 int is_synthesis(); 00100 char* plugin_title(); 00101 VFrame* new_picon(); 00102 int show_gui(); 00103 void raise_window(); 00104 void update_gui(); 00105 int set_string(); 00106 void save_data(KeyFrame *keyframe); 00107 void read_data(KeyFrame *keyframe); 00108 00109 00110 00111 00112 00113 00114 00115 void reset(); 00116 void load_configuration(); 00117 int load_defaults(); 00118 int save_defaults(); 00119 00120 00121 00122 00123 // parameters needed for processor 00124 char* output_to_text(int value); 00125 int text_to_output(char *text); 00126 00127 VFrame *temp; 00128 SwapConfig config; 00129 SwapThread *thread; 00130 BC_Hash *defaults; 00131 }; 00132 00133 00134 #endif
1.5.5