output.tag.set_title("1080TO480");
output.tag.set_property("FIRST_FIELD", config.first_field);
output.append_tag();
+ output.tag.set_title("/1080TO480");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
int h = input->get_h();
if(h > output->get_h()) h = output->get_h();
- if(w > output->get_w()) h = output->get_w();
+ if(w > output->get_w()) w = output->get_w();
#define REDUCE_MACRO(type, temp, components) \
for(int i = 0; i < OUT_ROWS; i++) \
output.tag.set_title("1080TO540");
output.tag.set_property("FIRST_FIELD", config.first_field);
output.append_tag();
+ output.tag.set_title("/1080TO540");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("FIRST_FIELD", config.first_field);
output.tag.set_property("DIRECTION", config.direction);
output.append_tag();
+ output.tag.set_title("/720TO480");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("MODE", (int)config.mode);
output.tag.set_property("TRIGGER_LEVEL", (float)config.trigger_level);
output.append_tag();
+ output.tag.set_title("/AUDIOSCOPE");
+ output.append_tag();
output.append_newline();
output.terminate_string();
}
output.tag.set_property("BANDS", bands);
output.tag.set_property("DIRECTION", direction);
output.append_tag();
+ output.tag.set_title("/BANDSLIDE");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
class BandSlideMain;
class BandSlideWindow;
-
+class BandSlideConfig;
#include "overlayframe.inc"
#include "pluginvclient.h"
};
+class BandSlideConfig
+{
+public:
+};
class BandSlideMain : public PluginVClient
{
public:
BandSlideMain(PluginServer *server);
~BandSlideMain();
+ PLUGIN_CLASS_MEMBERS(BandSlideConfig);
- int load_configuration();
- const char* plugin_title();
- PluginClientWindow* new_window();
// required for all realtime plugins
int process_realtime(VFrame *incoming, VFrame *outgoing);
void save_data(KeyFrame *keyframe);
output.tag.set_property("BANDS", bands);
output.tag.set_property("DIRECTION", direction);
output.append_tag();
+ output.tag.set_title("/BANDWIPE");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
class BandWipeMain;
class BandWipeWindow;
+class BandWipeConfig;
#include "overlayframe.inc"
+class BandWipeConfig
+{
+public:
+};
+
class BandWipeMain : public PluginVClient
{
BandWipeMain(PluginServer *server);
~BandWipeMain();
-// required for all realtime plugins
- int load_configuration();
- const char* plugin_title();
- PluginClientWindow* new_window();
+ PLUGIN_CLASS_MEMBERS(BandWipeConfig);
+
int process_realtime(VFrame *incoming, VFrame *outgoing);
void save_data(KeyFrame *keyframe);
void read_data(KeyFrame *keyframe);
output.tag.set_property("A", config.a);
output.tag.set_property("A_KEY", config.a_key);
output.append_tag();
+ output.tag.set_title("/BLUR");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("CONTRAST", config.contrast);
output.tag.set_property("LUMA", config.luma);
output.append_tag();
+ output.tag.set_title("/BRIGHTNESS");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
}
}
-//printf("CDRipMain::get_toc " _LD " " _LD "\n", startlba, endlba);
+//printf("CDRipMain::get_toc %jd %jd\n", startlba, endlba);
close_drive();
return result;
}
int CDRipMain::process_loop(Samples **plugin_buffer, int64_t &write_length)
{
int result = 0;
-printf("CDRipMain::process_loop 1\n");
+//printf("CDRipMain::process_loop 1\n");
// render it
if(arg.addr.lba < endlba && !endofselection)
fragment_length *= NFRAMES * FRAMESIZE;
endofselection = 1;
}
-printf("CDRipMain::process_loop 2 %d " _LD "\n", arg.addr.lba, endlba);
+//printf("CDRipMain::process_loop 2 %d %jd\n", arg.addr.lba, endlba);
for(i = 0; i < fragment_length;
i += NFRAMES * FRAMESIZE,
if(attempts == 2 && !previewing) printf("Can't read CD audio.\n");
}
}
-printf("CDRipMain::process_loop 3\n");
+//printf("CDRipMain::process_loop 3\n");
if(arg.addr.lba > startlba)
{
write_length = fragment_samples;
}
-printf("CDRipMain::process_loop 5 %d\n", interactive);
+//printf("CDRipMain::process_loop 5 %d\n", interactive);
currentlength++;
if(interactive)
{
if(!result) result = progress->update(currentlength);
}
-printf("CDRipMain::process_loop 6\n");
+//printf("CDRipMain::process_loop 6\n");
}
else
{
-printf("CDRipMain::process_loop 7\n");
+//printf("CDRipMain::process_loop 7\n");
endofselection = 1;
write_length = 0;
}
-printf("CDRipMain::process_loop 8 %d %d\n", endofselection, result);
+//printf("CDRipMain::process_loop 8 %d %d\n", endofselection, result);
return endofselection || result;
}
output.tag.set_property("SLOPE", config.slope);
output.tag.set_property("USE_VALUE", config.use_value);
output.append_tag();
+ output.tag.set_title("/CHROMAKEY");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
LOAD_CONFIGURATION_MACRO(ChromaKeyHSV, ChromaKeyConfig)
-void
-ChromaKeyHSV::save_data (KeyFrame * keyframe)
+void ChromaKeyHSV::save_data(KeyFrame * keyframe)
{
- FileXML output;
- output.set_shared_output(keyframe->get_data(), MESSAGESIZE);
- output.tag.set_title ("CHROMAKEY_HSV");
- output.tag.set_property ("RED", config.red);
- output.tag.set_property ("GREEN", config.green);
- output.tag.set_property ("BLUE", config.blue);
- output.tag.set_property ("MIN_BRIGHTNESS", config.min_brightness);
- output.tag.set_property ("MAX_BRIGHTNESS", config.max_brightness);
- output.tag.set_property ("SATURATION", config.saturation);
- output.tag.set_property ("MIN_SATURATION", config.min_saturation);
- output.tag.set_property ("TOLERANCE", config.tolerance);
- output.tag.set_property ("IN_SLOPE", config.in_slope);
- output.tag.set_property ("OUT_SLOPE", config.out_slope);
- output.tag.set_property ("ALPHA_OFFSET", config.alpha_offset);
- output.tag.set_property ("SPILL_THRESHOLD", config.spill_threshold);
- output.tag.set_property ("SPILL_AMOUNT", config.spill_amount);
- output.tag.set_property ("SHOW_MASK", config.show_mask);
- output.append_tag ();
- output.terminate_string ();
+ FileXML output;
+ output.set_shared_output(keyframe->get_data(), MESSAGESIZE);
+ output.tag.set_title("CHROMAKEY_HSV");
+ output.tag.set_property("RED", config.red);
+ output.tag.set_property("GREEN", config.green);
+ output.tag.set_property("BLUE", config.blue);
+ output.tag.set_property("MIN_BRIGHTNESS", config.min_brightness);
+ output.tag.set_property("MAX_BRIGHTNESS", config.max_brightness);
+ output.tag.set_property("SATURATION", config.saturation);
+ output.tag.set_property("MIN_SATURATION", config.min_saturation);
+ output.tag.set_property("TOLERANCE", config.tolerance);
+ output.tag.set_property("IN_SLOPE", config.in_slope);
+ output.tag.set_property("OUT_SLOPE", config.out_slope);
+ output.tag.set_property("ALPHA_OFFSET", config.alpha_offset);
+ output.tag.set_property("SPILL_THRESHOLD", config.spill_threshold);
+ output.tag.set_property("SPILL_AMOUNT", config.spill_amount);
+ output.tag.set_property("SHOW_MASK", config.show_mask);
+ output.append_tag();
+ output.tag.set_title("/CHROMAKEY_HSV");
+ output.append_tag();
+ output.append_newline();
+ output.terminate_string();
}
-void
-ChromaKeyHSV::read_data (KeyFrame * keyframe)
+void ChromaKeyHSV::read_data(KeyFrame * keyframe)
{
- FileXML input;
-
- input.set_shared_input (keyframe->get_data(), strlen (keyframe->get_data()));
-
- while (!input.read_tag ())
- {
- if (input.tag.title_is ("CHROMAKEY_HSV"))
- {
- config.red = input.tag.get_property ("RED", config.red);
- config.green = input.tag.get_property ("GREEN", config.green);
- config.blue = input.tag.get_property ("BLUE", config.blue);
- config.min_brightness =
- input.tag.get_property ("MIN_BRIGHTNESS", config.min_brightness);
- config.max_brightness =
- input.tag.get_property ("MAX_BRIGHTNESS", config.max_brightness);
- config.saturation =
- input.tag.get_property ("SATURATION", config.saturation);
- config.min_saturation =
- input.tag.get_property ("MIN_SATURATION", config.min_saturation);
- config.tolerance =
- input.tag.get_property ("TOLERANCE", config.tolerance);
- config.in_slope =
- input.tag.get_property ("IN_SLOPE", config.in_slope);
- config.out_slope =
- input.tag.get_property ("OUT_SLOPE", config.out_slope);
- config.alpha_offset =
- input.tag.get_property ("ALPHA_OFFSET", config.alpha_offset);
- config.spill_threshold =
- input.tag.get_property ("SPILL_THRESHOLD",
- config.spill_threshold);
- config.spill_amount =
- input.tag.get_property ("SPILL_AMOUNT", config.spill_amount);
- config.show_mask =
- input.tag.get_property ("SHOW_MASK", config.show_mask);
+ FileXML input;
+
+ input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));
+
+ while( !input.read_tag() ) {
+ if( input.tag.title_is("CHROMAKEY_HSV") ) {
+ config.red = input.tag.get_property("RED", config.red);
+ config.green = input.tag.get_property("GREEN", config.green);
+ config.blue = input.tag.get_property("BLUE", config.blue);
+ config.min_brightness =
+ input.tag.get_property("MIN_BRIGHTNESS", config.min_brightness);
+ config.max_brightness =
+ input.tag.get_property("MAX_BRIGHTNESS", config.max_brightness);
+ config.saturation =
+ input.tag.get_property("SATURATION", config.saturation);
+ config.min_saturation =
+ input.tag.get_property("MIN_SATURATION", config.min_saturation);
+ config.tolerance =
+ input.tag.get_property("TOLERANCE", config.tolerance);
+ config.in_slope =
+ input.tag.get_property("IN_SLOPE", config.in_slope);
+ config.out_slope =
+ input.tag.get_property("OUT_SLOPE", config.out_slope);
+ config.alpha_offset =
+ input.tag.get_property("ALPHA_OFFSET", config.alpha_offset);
+ config.spill_threshold =
+ input.tag.get_property("SPILL_THRESHOLD",
+ config.spill_threshold);
+ config.spill_amount =
+ input.tag.get_property("SPILL_AMOUNT", config.spill_amount);
+ config.show_mask =
+ input.tag.get_property("SHOW_MASK", config.show_mask);
+ }
}
- }
}
NEW_WINDOW_MACRO(ChromaKeyHSV, ChromaKeyWindow)
-void ChromaKeyHSV::update_gui ()
+void ChromaKeyHSV::update_gui()
{
- if (thread)
- {
- load_configuration ();
- thread->window->lock_window ();
- ((ChromaKeyWindow*)thread->window)->min_brightness->update (config.min_brightness);
- ((ChromaKeyWindow*)thread->window)->max_brightness->update (config.max_brightness);
- ((ChromaKeyWindow*)thread->window)->saturation->update (config.saturation);
- ((ChromaKeyWindow*)thread->window)->min_saturation->update (config.min_saturation);
- ((ChromaKeyWindow*)thread->window)->tolerance->update (config.tolerance);
- ((ChromaKeyWindow*)thread->window)->in_slope->update (config.in_slope);
- ((ChromaKeyWindow*)thread->window)->out_slope->update (config.out_slope);
- ((ChromaKeyWindow*)thread->window)->alpha_offset->update (config.alpha_offset);
- ((ChromaKeyWindow*)thread->window)->spill_threshold->update (config.spill_threshold);
- ((ChromaKeyWindow*)thread->window)->spill_amount->update (config.spill_amount);
- ((ChromaKeyWindow*)thread->window)->show_mask->update (config.show_mask);
- ((ChromaKeyWindow*)thread->window)->update_sample ();
- thread->window->unlock_window ();
- }
+ if( thread ) {
+ load_configuration();
+ ChromaKeyWindow *window = (ChromaKeyWindow*)thread->window;
+ window->lock_window();
+ window->min_brightness->update(config.min_brightness);
+ window->max_brightness->update(config.max_brightness);
+ window->saturation->update(config.saturation);
+ window->min_saturation->update(config.min_saturation);
+ window->tolerance->update(config.tolerance);
+ window->in_slope->update(config.in_slope);
+ window->out_slope->update(config.out_slope);
+ window->alpha_offset->update(config.alpha_offset);
+ window->spill_threshold->update(config.spill_threshold);
+ window->spill_amount->update(config.spill_amount);
+ window->show_mask->update(config.show_mask);
+ window->update_sample();
+ window->unlock_window();
+ }
}
}
output.append_tag();
+ output.tag.set_title("/COLOR3WAY");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("PRESERVELUMINOSITY", config.preserve);
output.tag.set_property("LOCKPARAMS", config.lock_params);
output.append_tag();
+ output.tag.set_title("/COLORBALANCE");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("SMOOTHING_ONLY", config.smoothing_only);
output.tag.set_property("INPUT", config.input);
output.append_tag();
+ output.tag.set_title("/COMPRESSOR");
+ output.append_tag();
output.append_newline();
output.tag.set_property("X", config.levels.values[i].x);
output.tag.set_property("Y", config.levels.values[i].y);
+ output.append_tag();
+ output.tag.set_title("/LEVEL");
output.append_tag();
output.append_newline();
}
// output.tag.set_property("AVERAGED_FRAMES", config.averaged_frames);
// output.tag.set_property("LEAST_DIFFERENCE", config.least_difference);
output.append_tag();
+ output.tag.set_title("/DECIMATE");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
// output.tag.set_property("ADAPTIVE", config.adaptive);
// output.tag.set_property("THRESHOLD", config.threshold);
output.append_tag();
+ output.tag.set_title("/DEINTERLACE");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_title("DELAYAUDIO");
output.tag.set_property("LENGTH", (double)config.length);
output.append_tag();
+ output.tag.set_title("/DELAYAUDIO");
+ output.append_tag();
output.append_newline();
output.terminate_string();
}
output.tag.set_title("DELAYVIDEO");
output.tag.set_property("LENGTH", (double)config.length);
output.append_tag();
+ output.tag.set_title("/DELAYVIDEO");
+ output.append_tag();
output.append_newline();
output.terminate_string();
}
output.tag.set_title("DENOISE");
output.tag.set_property("LEVEL", config.level);
output.append_tag();
+ output.tag.set_title("/DENOISE");
+ output.append_tag();
output.append_newline();
-
output.terminate_string();
}
output.tag.set_property("SAMPLES", config.samples);
output.tag.set_property("LEVEL", config.level);
output.append_tag();
+ output.tag.set_title("/DENOISEFFT");
+ output.append_tag();
output.append_newline();
-
output.terminate_string();
}
output.tag.set_property("MODE", config.mode);
output.tag.set_property("DELAY", config.delay);
output.append_tag();
+ output.tag.set_title("/DENOISE_VIDEO2");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
paranoid = 0;
nosubtract = 0;
offset_restartmarker_keyframe = 0;
- offset_fixed_value = -1000;
+ offset_fixed_value = -15;
gain = 1.00;
avg_threshold_RY = 0; avg_threshold_GU = 0; avg_threshold_BV = 0;
output.tag.set_property("MASK_BV", config.mask_BV);
output.append_tag();
+ output.tag.set_title("/SELECTIVE_TEMPORAL_AVERAGE");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
{
*output = get_value();
plugin->send_configure_change();
- return 0;
+ return 1;
}
output.tag.set_property("DO_A", config.do_a);
output.tag.set_property("COUNT_CHANGED", config.count_changed);
output.append_tag();
+ output.tag.set_title("/DENOISE_VIDEO");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("LEVEL", config.level);
output.tag.set_property("SLOPE", config.slope);
output.append_tag();
+ output.tag.set_title("/DESPIKE");
+ output.append_tag();
output.append_newline();
output.terminate_string();
}
output.tag.set_property("SLOPE", config.slope);
output.tag.set_property("DO_VALUE", config.do_value);
output.append_tag();
+ output.tag.set_title("/DIFFKEY");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("B", config.b);
output.tag.set_property("A", config.a);
output.append_tag();
+ output.tag.set_title("/DOWNSAMPLE");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("ATTEN", config.atten);
output.tag.set_property("OFFSET", config.offset);
output.append_tag();
+ output.tag.set_title("/ECHO");
+ output.append_tag();
output.append_newline();
output.terminate_string();
}
output.tag.set_property("W", w);
output.tag.set_property("H", h);
output.append_tag();
+ output.tag.set_title("/ECHOCANCEL");
+ output.append_tag();
output.append_newline();
output.terminate_string();
}
if(temp) delete temp;
}
-const char* Edge::plugin_title() { return N_("Edge"); }
+const char* Edge::plugin_title() { return _("Edge"); }
int Edge::is_realtime() { return 1; }
NEW_WINDOW_MACRO(Edge, EdgeWindow);
output.tag.set_property("DOMINANCE", config.field_dominance);
output.tag.set_property("FIRST_FRAME", config.first_frame);
output.append_tag();
+ output.tag.set_title("/FIELD_FRAME");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
#include "surfscan.h"
#include "transportque.h"
+// Needed with OpenCV version 2.4.8
+#include "opencv2/legacy/legacy.hpp"
+#include "opencv2/legacy/compat.hpp"
+
#include "opencv2/video/tracking.hpp"
#include "opencv2/video/background_segm.hpp"
output.tag.set_property("SMIN", config.smin);
output.tag.set_property("BLEND", config.blend);
output.append_tag();
+ output.tag.set_title("/FINDOBJECT");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
delete [] scene_rows;
blob_pTracker->Process(scene_image, pMask);
-printf("FindObjectMain::process_blob %d %ld %d\n", __LINE__, get_source_position(), blob_pTracker->GetBlobNum());
+printf("FindObjectMain::process_blob %d %jd %d\n", __LINE__, get_source_position(), blob_pTracker->GetBlobNum());
#if 0
// TODO: use oblique corners & affine transform
object_w = (int)(config.global_block_w * w / 100);
object_h = (int)(config.global_block_h * h / 100);
- object_x1;
- object_y1;
- object_x2;
- object_y2;
object_x1 = (int)(config.block_x * w / 100 - object_w / 2);
object_y1 = (int)(config.block_y * h / 100 - object_h / 2);
scene_w = (int)(config.global_range_w * w / 100);
scene_h = (int)(config.global_range_h * h / 100);
- scene_x1;
- scene_y1;
- scene_x2;
- scene_y2;
scene_x1 = (int)(config.block_x * w / 100 - scene_w / 2);
scene_y1 = (int)(config.block_y * h / 100 - scene_h / 2);
scene_x2 = scene_x1 + scene_w;
switch(config.algorithm)
{
+#if HAVE_OPENCV_SURF
case ALGORITHM_SURF:
process_surf();
break;
+#endif
case ALGORITHM_CAMSHIFT:
process_camshift();
#ifndef FINDOBJECT_H
#define FINDOBJECT_H
+//#include "config.h"
+
#include <math.h>
#include <stdint.h>
#include <string.h>
#define NO_ALGORITHM 0
+#if HAVE_OPENCV_SURF
#define ALGORITHM_SURF 1
+#endif
#define ALGORITHM_CAMSHIFT 2
#define ALGORITHM_BLOB 3
void FindObjectAlgorithm::create_objects()
{
add_item(new BC_MenuItem(to_text(NO_ALGORITHM)));
-#ifdef HAVE_OPENCV_SURF
+#if HAVE_OPENCV_SURF
add_item(new BC_MenuItem(to_text(ALGORITHM_SURF)));
#endif
add_item(new BC_MenuItem(to_text(ALGORITHM_CAMSHIFT)));
int FindObjectAlgorithm::from_text(char *text)
{
if(!strcmp(text, _("Don't Calculate"))) return NO_ALGORITHM;
-#ifdef HAVE_OPENCV_SURF
+#if HAVE_OPENCV_SURF
if(!strcmp(text, _("SURF"))) return ALGORITHM_SURF;
#endif
if(!strcmp(text, _("CAMSHIFT"))) return ALGORITHM_CAMSHIFT;
{
case NO_ALGORITHM:
return _("Don't Calculate");
-#ifdef HAVE_OPENCV_SURF
+#if HAVE_OPENCV_SURF
case ALGORITHM_SURF:
return _("SURF");
#endif
{
int result = 0;
result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(NO_ALGORITHM)));
-#ifdef HAVE_OPENCV_SURF
+#if HAVE_OPENCV_SURF
result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(ALGORITHM_SURF)));
#endif
result = MAX(result, gui->get_text_width(MEDIUMFONT, to_text(ALGORITHM_CAMSHIFT)));
{
output.tag.set_title("VERTICAL");
output.append_tag();
+ output.tag.set_title("/VERTICAL");
+ output.append_tag();
}
if(config.flip_horizontal)
{
output.tag.set_title("HORIZONTAL");
output.append_tag();
+ output.tag.set_title("/HORIZONTAL");
+ output.append_tag();
}
+ output.tag.set_title("/FLIP");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
// data is now in *text
}
output.tag.set_title("FRAME_FIELD");
output.tag.set_property("DOMINANCE", config.field_dominance);
output.append_tag();
+ output.tag.set_title("/FRAME_FIELD");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("WIDTH", config.width);
output.tag.set_property("MODE", config.mode);
output.append_tag();
+ output.tag.set_title("/FREEVERB");
+ output.append_tag();
output.append_newline();
-
output.terminate_string();
}
{
output.tag.set_title("ENABLED");
output.append_tag();
+ output.tag.set_title("/ENABLED");
+ output.append_tag();
}
if(config.line_double)
{
output.tag.set_title("LINE_DOUBLE");
output.append_tag();
+ output.tag.set_title("/LINE_DOUBLE");
+ output.append_tag();
}
+ output.tag.set_title("/FREEZEFRAME");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
// data is now in *text
}
frame->get_h(),
frame->get_color_model(),
-1);
-//printf("FreezeFrameMain::process_buffer 1 " _LD "\n", first_frame_position);
+//printf("FreezeFrameMain::process_buffer 1 %jd\n", first_frame_position);
read_frame(first_frame,
0,
get_direction() == PLAY_REVERSE ? first_frame_position + 1 : first_frame_position,
output.tag.set_title("GAIN");
output.tag.set_property("LEVEL", config.level);
output.append_tag();
+ output.tag.set_title("/GAIN");
+ output.append_tag();
output.append_newline();
output.terminate_string();
}
output.tag.set_property("AUTOMATIC", config.automatic);
output.tag.set_property("PLOT", config.plot);
output.append_tag();
+ output.tag.set_title("/GAMMA");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("CENTER_X", config.center_x);
output.tag.set_property("CENTER_Y", config.center_y);
output.append_tag();
+ output.tag.set_title("/GRADIENT");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("W", w);
output.tag.set_property("H", h);
output.append_tag();
+ output.tag.set_title("/GRAPHICEQ");
+ output.append_tag();
output.append_newline();
for(int i = 0; i < config.points.total; i++)
output.tag.set_property("X", config.points.values[i]->freq);
output.tag.set_property("Y", config.points.values[i]->value);
output.append_tag();
+ output.tag.set_title("/POINT");
+ output.append_tag();
+ output.append_newline();
}
- if(config.points.total) output.append_newline();
output.terminate_string();
}
//printf("HistogramMain::save_data %d %f %d\n", config.input_min[i], config.input_mid[i], config.input_max[i]);
}
+ output.append_tag();
+ output.tag.set_title("/HISTOGRAM");
output.append_tag();
output.append_newline();
-
-
-
-
-
-
output.terminate_string();
}
output.tag.set_property("SATURATION", config.saturation);
output.tag.set_property("VALUE", config.value);
output.append_tag();
+ output.tag.set_title("/HUESATURATION");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
void HueEffect::read_data(KeyFrame *keyframe)
output.tag.set_property("X", config.x);
output.tag.set_property("Y", config.y);
output.append_tag();
+ output.tag.set_title("/INTERPOLATEPIXELS");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
-const char* InterpolateAudioEffect::plugin_title()
-{
- return _("Interpolate");
-}
-
-
-int InterpolateAudioEffect::is_realtime()
-{
- return 1;
-}
+const char* InterpolateAudioEffect::plugin_title() { return _("Interpolate"); }
+int InterpolateAudioEffect::is_realtime() { return 1; }
-int InterpolateVideo::is_realtime()
-{
- return 1;
-}
NEW_WINDOW_MACRO(InterpolateVideo, InterpolateVideoWindow)
const char* InterpolateVideo::plugin_title() { return _("Interpolate Video"); }
+int InterpolateVideo::is_realtime() { return 1; }
int InterpolateVideo::load_configuration()
{
output.tag.set_property("SEARCH_RADIUS", config.search_radius);
output.tag.set_property("MACROBLOCK_SIZE", config.macroblock_size);
output.append_tag();
+ output.tag.set_title("/INTERPOLATEVIDEO");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
{
public:
InvertAudioEffect(PluginServer *server)
- : PluginAClient(server)
- {
- };
- ~InvertAudioEffect()
- {
- };
+ : PluginAClient(server) {};
+ ~InvertAudioEffect() {};
- const char* plugin_title()
- {
- return _("Invert Audio");
- };
- int is_realtime()
- {
- return 1;
- };
- int process_realtime(int64_t size, Samples *input_ptr, Samples *output_ptr)
- {
+ const char* plugin_title() { return _("Invert Audio"); };
+ int is_realtime() { return 1; };
+ int process_realtime(int64_t size, Samples *input_ptr, Samples *output_ptr) {
double *output_samples = output_ptr->get_data();
double *input_samples = input_ptr->get_data();
for(int i = 0; i < size; i++)
output.tag.set_property("B", config.b);
output.tag.set_property("A", config.a);
output.append_tag();
+ output.tag.set_title("/INVERTVIDEO");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_title("IRISSQUARE");
output.tag.set_property("DIRECTION", direction);
output.append_tag();
+ output.tag.set_title("/IRISSQUARE");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("AUTO_THRESHOLD", config.auto_threshold);
output.tag.set_property("PATTERN", config.pattern);
output.append_tag();
+ output.tag.set_title("/IVTC");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("CENTER_Y", config.center_y);
output.tag.set_property("DRAW_GUIDES", config.draw_guides);
output.append_tag();
+ output.tag.set_title("/LENS");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_title("SOUNDLEVEL");
output.tag.set_property("DURATION", config.duration);
output.append_tag();
+ output.tag.set_title("/SOUNDLEVEL");
+ output.append_tag();
output.append_newline();
-
output.terminate_string();
}
output.tag.set_property("B", config.b);
output.tag.set_property("A", config.a);
output.append_tag();
+ output.tag.set_title("/LINEARBLUR");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_title("LIVEVIDEO");
output.tag.set_property("CHANNEL", config.channel);
output.append_tag();
+ output.tag.set_title("/LIVEVIDEO");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_title("LOOPAUDIO");
output.tag.set_property("SAMPLES", config.samples);
output.append_tag();
+ output.tag.set_title("/LOOPAUDIO");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_title("LOOPVIDEO");
output.tag.set_property("FRAMES", config.frames);
output.append_tag();
+ output.tag.set_title("/LOOPVIDEO");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("HORIZONTAL_ONLY", config.horizontal_only);
output.tag.set_property("VERTICAL_ONLY", config.vertical_only);
output.append_tag();
+ output.tag.set_title("/MOTION");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
case MotionScan::LOAD:
{
char string[BCTEXTLEN];
- sprintf(string, "%s" _LDv(06),
+ sprintf(string, "%s%06jd",
ROTATION_FILE, plugin->get_source_position());
FILE *input = fopen(string, "r");
if(input)
if(!skip && plugin->config.tracking_type == MotionScan::SAVE)
{
char string[BCTEXTLEN];
- sprintf(string, "%s" _LDv(06),
+ sprintf(string, "%s%06jd",
ROTATION_FILE, plugin->get_source_position());
FILE *output = fopen(string, "w");
if(output)
output.tag.set_property("HORIZONTAL_ONLY", config.horizontal_only);
output.tag.set_property("VERTICAL_ONLY", config.vertical_only);
output.append_tag();
+ output.tag.set_title("/MOTION2");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
#ifdef DEBUG
-printf("MotionMain2::process_buffer 1 start_position=" _LD "\n", start_position);
+printf("MotionMain2::process_buffer 1 start_position=%jd\n", start_position);
#endif
output.tag.set_property("RADIUS", config.radius);
output.tag.set_property("STEPS", config.steps);
output.append_tag();
+ output.tag.set_title("/MOTIONBLUR");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("RADIUS", config.radius);
output.tag.set_property("USE_INTENSITY", config.use_intensity);
output.append_tag();
+ output.tag.set_title("/OIL_PAINTING");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
public:
OverlayConfig();
-
-
static const char* mode_to_text(int mode);
int mode;
};
};
-
-
-
-
class OverlayMode : public BC_PopupMenu
{
public:
OverlayOutput *output;
};
-
-
-
-
-
class Overlay : public PluginVClient
{
public:
int input_layer2;
};
-
-
-
-
-
-
-
-
-
-
-
OverlayConfig::OverlayConfig()
{
mode = TRANSFER_NORMAL;
const char* OverlayConfig::mode_to_text(int mode)
{
- switch(mode)
- {
- case TRANSFER_NORMAL:
- return _("Normal");
- break;
-
- case TRANSFER_REPLACE:
- return _("Replace");
- break;
-
- case TRANSFER_ADDITION:
- return _("Addition");
- break;
-
- case TRANSFER_SUBTRACT:
- return _("Subtract");
- break;
-
- case TRANSFER_MULTIPLY:
- return _("Multiply");
- break;
-
- case TRANSFER_DIVIDE:
- return _("Divide");
- break;
-
- case TRANSFER_MAX:
- return _("Max");
- break;
-
- case TRANSFER_MIN:
- return _("Min");
- break;
-
- default:
- return _("Normal");
- break;
+ switch(mode) {
+ case TRANSFER_NORMAL: return _("Normal");
+ case TRANSFER_ADDITION: return _("Addition");
+ case TRANSFER_SUBTRACT: return _("Subtract");
+ case TRANSFER_MULTIPLY: return _("Multiply");
+ case TRANSFER_DIVIDE: return _("Divide");
+ case TRANSFER_REPLACE: return _("Replace");
+ case TRANSFER_MAX: return _("Max");
+ case TRANSFER_MIN: return _("Min");
+ case TRANSFER_AVERAGE: return _("Average");
+ case TRANSFER_DARKEN: return _("Darken");
+ case TRANSFER_LIGHTEN: return _("Lighten");
+ case TRANSFER_DST: return _("Dst");
+ case TRANSFER_DST_ATOP: return _("DstAtop");
+ case TRANSFER_DST_IN: return _("DstIn");
+ case TRANSFER_DST_OUT: return _("DstOut");
+ case TRANSFER_DST_OVER: return _("DstOver");
+ case TRANSFER_SRC: return _("Src");
+ case TRANSFER_SRC_ATOP: return _("SrcAtop");
+ case TRANSFER_SRC_IN: return _("SrcIn");
+ case TRANSFER_SRC_OUT: return _("SrcOut");
+ case TRANSFER_SRC_OVER: return _("SrcOver");
+ case TRANSFER_OR: return _("Or");
+ case TRANSFER_XOR: return _("Xor");
+ default: break;
}
- return "";
+ return _("Normal");
}
const char* OverlayConfig::direction_to_text(int direction)
-OverlayMode::OverlayMode(Overlay *plugin,
- int x,
- int y)
- : BC_PopupMenu(x,
- y,
- 150,
- OverlayConfig::mode_to_text(plugin->config.mode),
- 1)
+OverlayMode::OverlayMode(Overlay *plugin, int x, int y)
+ : BC_PopupMenu(x, y, 150,
+ OverlayConfig::mode_to_text(plugin->config.mode), 1)
{
this->plugin = plugin;
}
load_configuration();
-printf("Overlay::process_buffer mode=%d\n", config.mode);
if(!temp) temp = new VFrame(0,
-1,
frame[0]->get_w(),
output.tag.set_property("OUTPUT", config.output_track);
output.tag.set_property("MODE", config.mode);
output.append_tag();
+ output.tag.set_title("/OVERLAY");
+ output.append_tag();
output.append_newline();
output.terminate_string();
}
output.tag.set_property("MAGNITUDE", config.band[i].magnitude);
output.tag.set_property("MODE", config.band[i].mode);
output.append_tag();
+ output.tag.set_title("/BAND");
+ output.append_tag();
output.append_newline();
}
+ output.tag.set_title("/PARAMETRICEQ");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("WINDOW_W", config.window_w);
output.tag.set_property("WINDOW_H", config.window_h);
output.append_tag();
+ output.tag.set_title("/PERSPECTIVE");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("HEIGHT", config.height);
output.tag.set_property("USE_FILE", config.use_file);
output.append_tag();
+ output.tag.set_title("/PHOTOSCALE");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
config.oscillator_config.values[i]->save_data(&output);
}
+ output.tag.set_title("/SYNTH");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
// data is now in *text
}
int Piano::set_string()
{
- if(thread) thread->window->set_title(gui_string);
+ if( thread )
+ thread->window->set_title(gui_string);
return 0;
}
output.tag.set_property("SCALE", config.scale);
output.tag.set_property("SIZE", config.size);
output.append_tag();
+ output.tag.set_title("/PITCH");
+ output.append_tag();
output.append_newline();
-
output.terminate_string();
}
output.tag.set_property("DEPTH", config.depth);
output.tag.set_property("ANGLE", config.angle);
output.append_tag();
+ output.tag.set_title("/POLAR");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("B", config.b);
output.tag.set_property("A", config.a);
output.append_tag();
+ output.tag.set_title("/RADIALBLUR");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("STRETCH", config.stretch);
output.tag.set_property("INTERPOLATE", config.interp);
output.append_tag();
+ output.tag.set_title("/REFRAMERT");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("DURATION", config.duration);
output.tag.set_property("THRESHOLD", config.threshold);
output.append_tag();
+ output.tag.set_title("/REMOVEGAPS");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_title("RESAMPLERT");
output.tag.set_property("SCALE", config.scale);
output.append_tag();
+ output.tag.set_title("/RESAMPLERT");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_title("/REVERB");
output.append_tag();
output.append_newline();
-//printf("Reverb::save_data 1\n");
-
-
-
output.terminate_string();
//printf("Reverb::save_data 2\n");
}
void ReverbConfig::dump()
{
- printf("ReverbConfig::dump %f " _LD " %f %f " _LD " " _LD " " _LD " " _LD "\n",
+ printf("ReverbConfig::dump %f %jd %f %f %jd %jd %jd %jd\n",
level_init, delay_init, ref_level1, ref_level2,
ref_total, ref_length, lowpass1, lowpass2);
}
output.tag.set_title("REVERSEAUDIO");
output.tag.set_property("ENABLED", config.enabled);
output.append_tag();
+ output.tag.set_title("/REVERSEAUDIO");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_title("REVERSEVIDEO");
output.tag.set_property("ENABLED", config.enabled);
output.append_tag();
+ output.tag.set_title("/REVERSEVIDEO");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_title("RGB601");
output.tag.set_property("DIRECTION", config.direction);
output.append_tag();
+ output.tag.set_title("/RGB601");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("B_DX", config.b_dx);
output.tag.set_property("B_DY", config.b_dy);
output.append_tag();
+ output.tag.set_title("/RGBSHIFT");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("DRAW_PIVOT", (int)config.draw_pivot);
// output.tag.set_property("INTERPOLATE", (int)config.bilinear);
output.append_tag();
+ output.tag.set_title("/ROTATE");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
// data is now in *text
}
output.tag.set_property("HEIGHT", config.height);
output.tag.set_property("CONSTRAIN", config.constrain);
output.append_tag();
+ output.tag.set_title("/SCALE");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
// data is now in *text
}
output.set_shared_output(keyframe->get_data(), MESSAGESIZE);
output.tag.set_title("SHARPNESS");
output.tag.set_property("VALUE", config.sharpness);
+ output.tag.set_property("INTERLACE", config.interlace);
+ output.tag.set_property("HORIZONTAL", config.horizontal);
+ output.tag.set_property("LUMINANCE", config.luminance);
output.append_tag();
-
- if(config.interlace)
- {
- output.tag.set_title("INTERLACE");
- output.append_tag();
- }
-
- if(config.horizontal)
- {
- output.tag.set_title("HORIZONTAL");
- output.append_tag();
- }
-
- if(config.luminance)
- {
- output.tag.set_title("LUMINANCE");
- output.append_tag();
- }
+ output.tag.set_title("/SHARPNESS");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));
int result = 0;
- int new_interlace = 0;
- int new_horizontal = 0;
- int new_luminance = 0;
while(!result)
{
if(input.tag.title_is("SHARPNESS"))
{
config.sharpness = input.tag.get_property("VALUE", config.sharpness);
+ config.interlace = input.tag.get_property("INTERLACE", config.interlace);
+ config.horizontal = input.tag.get_property("HORIZONTAL", config.horizontal);
+ config.luminance = input.tag.get_property("LUMINANCE", config.luminance);
//printf("SharpenMain::read_data %f\n", sharpness);
}
- else
- if(input.tag.title_is("INTERLACE"))
- {
- new_interlace = 1;
- }
- else
- if(input.tag.title_is("HORIZONTAL"))
- {
- new_horizontal = 1;
- }
- else
- if(input.tag.title_is("LUMINANCE"))
- {
- new_luminance = 1;
- }
}
}
- config.interlace = new_interlace;
- config.horizontal = new_horizontal;
- config.luminance = new_luminance;
-
if(config.sharpness > MAXSHARPNESS)
config.sharpness = MAXSHARPNESS;
else
output.tag.set_property("ODD_OFFSET", config.odd_offset);
output.tag.set_property("EVEN_OFFSET", config.even_offset);
output.append_tag();
+ output.tag.set_title("/SHIFTINTERLACE");
+ output.append_tag();
output.append_newline();
output.terminate_string();
// data is now in *text
output.tag.set_property("MOTION_DIRECTION", motion_direction);
output.tag.set_property("DIRECTION", direction);
output.append_tag();
+ output.tag.set_title("/SLIDE");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("W", (int)w);
output.tag.set_property("H", (int)h);
output.append_tag();
+ output.tag.set_title("/SPECTROGRAM");
+ output.append_tag();
output.append_newline();
output.terminate_string();
}
output.tag.set_property("BLUE", config.blue);
output.tag.set_property("ALPHA", config.alpha);
output.append_tag();
+ output.tag.set_title("/SWAPCHANNELS");
+ output.append_tag();
output.append_newline();
output.terminate_string();
// data is now in *text
output.tag.set_property("ON", config.on);
output.tag.set_property("SWAP_EVEN", config.swap_even);
output.append_tag();
+ output.tag.set_title("/SWAPFRAMES");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
config.oscillator_config.values[i]->save_data(&output);
}
+ output.tag.set_title("/SYNTH");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
//printf("Synth::save_data %d %s\n", __LINE__, output.string);
// data is now in *text
delete threshold_engine;
}
-int ThresholdMain::is_realtime()
-{
- return 1;
-}
-
-const char* ThresholdMain::plugin_title()
-{
- return _("Threshold");
-}
+const char* ThresholdMain::plugin_title() { return _("Threshold"); }
+int ThresholdMain::is_realtime() { return 1; }
void ThresholdMain::save_data(KeyFrame *keyframe)
{
- FileXML file;
- file.set_shared_output(keyframe->get_data(), MESSAGESIZE);
- file.tag.set_title("THRESHOLD");
- file.tag.set_property("MIN", config.min);
- file.tag.set_property("MAX", config.max);
- file.tag.set_property("PLOT", config.plot);
- config.low_color.set_property(file.tag, "LOW_COLOR");
- config.mid_color.set_property(file.tag, "MID_COLOR");
- config.high_color.set_property(file.tag, "HIGH_COLOR");
- file.append_tag();
- file.tag.set_title("/THRESHOLD");
- file.append_tag();
- file.terminate_string();
+ FileXML output;
+ output.set_shared_output(keyframe->get_data(), MESSAGESIZE);
+ output.tag.set_title("THRESHOLD");
+ output.tag.set_property("MIN", config.min);
+ output.tag.set_property("MAX", config.max);
+ output.tag.set_property("PLOT", config.plot);
+ config.low_color.set_property(output.tag, "LOW_COLOR");
+ config.mid_color.set_property(output.tag, "MID_COLOR");
+ config.high_color.set_property(output.tag, "HIGH_COLOR");
+ output.append_tag();
+ output.tag.set_title("/THRESHOLD");
+ output.append_tag();
+ output.append_newline();
+ output.terminate_string();
}
void ThresholdMain::read_data(KeyFrame *keyframe)
{
- FileXML file;
+ FileXML input;
const char *data = keyframe->get_data();
- file.set_shared_input((char *)data, strlen(data));
+ input.set_shared_input((char *)data, strlen(data));
int result = 0;
while(!result)
{
- result = file.read_tag();
+ result = input.read_tag();
if(!result)
{
- config.min = file.tag.get_property("MIN", config.min);
- config.max = file.tag.get_property("MAX", config.max);
- config.plot = file.tag.get_property("PLOT", config.plot);
- config.low_color = config.low_color.get_property(file.tag, "LOW_COLOR");
- config.mid_color = config.mid_color.get_property(file.tag, "MID_COLOR");
- config.high_color = config.high_color.get_property(file.tag, "HIGH_COLOR");
+ config.min = input.tag.get_property("MIN", config.min);
+ config.max = input.tag.get_property("MAX", config.max);
+ config.plot = input.tag.get_property("PLOT", config.plot);
+ config.low_color = config.low_color.get_property(input.tag, "LOW_COLOR");
+ config.mid_color = config.mid_color.get_property(input.tag, "MID_COLOR");
+ config.high_color = config.high_color.get_property(input.tag, "HIGH_COLOR");
}
}
config.boundaries();
window->update_low_color();
window->flush();
plugin->send_configure_change();
- return 0;
+ return 1;
}
window->update_mid_color();
window->flush();
plugin->send_configure_change();
- return 0;
+ return 1;
}
window->update_high_color();
window->flush();
plugin->send_configure_change();
- return 0;
+ return 1;
}
reset_accum(w, h, color_model);
}
-// printf("TimeAvgMain::process_buffer %d prev_frame=" _LD " start_position=" _LD "\n",
+// printf("TimeAvgMain::process_buffer %d prev_frame=%jd start_position=%jd\n",
// __LINE__, prev_frame, start_position);
for(int64_t i = prev_frame; i <= start_position; i++)
{
frame_rate,
0);
add_accum(frame);
-printf("TimeAvgMain::process_buffer %d prev_frame=" _LD " start_position=" _LD " i=" _LD "\n",
+printf("TimeAvgMain::process_buffer %d prev_frame=%jd start_position=%jd i=%jd\n",
__LINE__, prev_frame, start_position, i);
}
output.tag.set_property("THRESHOLD", config.threshold);
output.tag.set_property("BORDER", config.border);
output.append_tag();
+ output.tag.set_title("/TIME_AVERAGE");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
plugin->config.track_usage = from_text(get_text());
gui->update_shape();
plugin->send_configure_change();
- return 0;
+ return 1;
}
output.tag.set_property("INVERT", config.invert);
output.tag.set_property("SHOW_GRAYSCALE", config.show_grayscale);
output.append_tag();
+ output.tag.set_title("/TIMEFRONT");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
engine->update(config.scale, sample_rate, config.size);
need_reconfigure = 0;
//printf("TimeStretchRT::process_buffer %d start_position=" _LD
-// " prev_position=" _LD " scale=%f source_start=" _LD "\n",
+// " prev_position=%jd scale=%f source_start=%jd\n",
// __LINE__, start_position, prev_position, config.scale, source_start);
}
output.tag.set_property("SCALE", config.scale);
output.tag.set_property("SIZE", config.size);
output.append_tag();
+ output.tag.set_title("/TIMESTRETCHRT");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
BC_FontEntry* TitleMain::get_font()
{
int style = 0;
- int mask;
-
- style |= (config.style & BC_FONT_ITALIC) ? FL_SLANT_ITALIC : FL_SLANT_ROMAN;
- style |= (config.style & BC_FONT_BOLD) ? FL_WEIGHT_BOLD : FL_WEIGHT_NORMAL;
+ int mask, pref;
+
+ style |= (config.style & BC_FONT_ITALIC) ?
+ FL_SLANT_ITALIC | FL_SLANT_OBLIQUE : FL_SLANT_ROMAN;
+ style |= (config.style & BC_FONT_BOLD) ?
+ FL_WEIGHT_BOLD | FL_WEIGHT_DEMIBOLD |
+ FL_WEIGHT_EXTRABOLD| FL_WEIGHT_BLACK | FL_WEIGHT_EXTRABLACK :
+ FL_WEIGHT_BOOK | FL_WEIGHT_NORMAL | FL_WEIGHT_MEDIUM |
+ FL_WEIGHT_LIGHT | FL_WEIGHT_EXTRALIGHT | FL_WEIGHT_THIN;
+
+ pref = style & (FL_SLANT_ITALIC | FL_WEIGHT_BOLD | FL_WEIGHT_NORMAL);
mask = FL_WEIGHT_MASK | FL_SLANT_MASK;
BC_Resources *resources = BC_WindowBase::get_resources();
- return resources->find_fontentry(config.font, style, mask);
+ return resources->find_fontentry(config.font, style, mask, pref);
}
int TitleMain::get_char_height()
add_tool(style_title = new BC_Title(x, y, _("Style:")));
add_tool(italic = new TitleItalic(client, this, x, y + 20));
+ int w1 = italic->get_w();
add_tool(bold = new TitleBold(client, this, x, y + 50));
+ if( bold->get_w() > w1 ) w1 = bold->get_w();
#ifdef USE_OUTLINE
- add_tool(stroke = new TitleStroke(client, this, x, y + 110));
+ add_tool(stroke = new TitleStroke(client, this, x, y + 80));
+ if( stroke->get_w() > w1 ) w1 = stroke->get_w();
#endif
- x += 90;
+ x += w1 + 10;
add_tool(justify_title = new BC_Title(x, y, _("Justify:")));
add_tool(left = new TitleLeft(client, this, x, y + 20));
+ w1 = left->get_w();
add_tool(center = new TitleCenter(client, this, x, y + 50));
+ if( center->get_w() > w1 ) w1 = center->get_w();
add_tool(right = new TitleRight(client, this, x, y + 80));
+ if( right->get_w() > w1 ) w1 = right->get_w();
- x += 80;
+ x += w1 + 10;
add_tool(top = new TitleTop(client, this, x, y + 20));
add_tool(mid = new TitleMid(client, this, x, y + 50));
add_tool(bottom= new TitleBottom(client, this, x, y + 80));
y += 50;
add_tool(dropshadow_title = new BC_Title(x, y, _("Drop shadow:")));
+ w1 = dropshadow_title->get_w();
dropshadow = new TitleDropShadow(client, this, x, y + 20);
dropshadow->create_objects();
- x += 100;
+ if( dropshadow->get_w() > w1 ) w1 = dropshadow->get_w();
+ x += w1 + 10;
add_tool(fadein_title = new BC_Title(x, y, _("Fade in (sec):")));
+ w1 = fadein_title->get_w();
add_tool(fade_in = new TitleFade(client, this, &client->config.fade_in, x, y + 20));
- x += 100;
+ if( fade_in->get_w() > w1 ) w1 = fade_in->get_w();
+ x += w1 + 10;
add_tool(fadeout_title = new BC_Title(x, y, _("Fade out (sec):")));
+ w1 = fadeout_title->get_w();
add_tool(fade_out = new TitleFade(client, this, &client->config.fade_out, x, y + 20));
- x += 110;
+ if( fade_out->get_w() > w1 ) w1 = fade_out->get_w();
+ x += w1 + 10;
add_tool(speed_title = new BC_Title(x, y, _("Speed:")));
+ w1 = speed_title->get_w();
speed = new TitleSpeed(client, this, x, y + 20);
speed->create_objects();
- x += 110;
+ if( speed->get_w() > w1 ) w1 = speed->get_w();
+ x += w1 + 10;
color_x = x;
- color_y = y + 20;
+ color_y = y + 16;
x += COLOR_W + 5;
- add_tool(color_button = new TitleColorButton(client, this, x, y + 20, 0));
- x += color_button->get_w();
+ add_tool(color_button = new TitleColorButton(client, this, x, y + 16, 0));
+ x += color_button->get_w() + 5;
color_thread = new TitleColorThread(client, this, 0);
x = color_x;
output.tag.set_property("OUT_W", config.out_w);
output.tag.set_property("OUT_H", config.out_h);
output.append_tag();
-
+ output.tag.set_title("/TRANSLATE");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
// data is now in *text
}
}
-
-
-
-
-
+#define EPSILON 0.001
int TranslateMain::process_realtime(VFrame *input_ptr, VFrame *output_ptr)
{
- VFrame *input, *output;
-
-
- input = input_ptr;
- output = output_ptr;
+ VFrame *input = input_ptr;
+ VFrame *output = output_ptr;
load_configuration();
//printf("TranslateMain::process_realtime 1 %p\n", input);
- if(input->get_rows()[0] == output->get_rows()[0])
- {
+ if( input->get_rows()[0] == output->get_rows()[0] ) {
+ if( temp_frame && (
+ temp_frame->get_w() != input_ptr->get_w() ||
+ temp_frame->get_h() != input_ptr->get_h() ||
+ temp_frame->get_color_model() != input_ptr->get_color_model() ) ) {
+ delete temp_frame;
+ temp_frame = 0;
+ }
if(!temp_frame)
temp_frame = new VFrame(0,
-1,
output->clear_frame();
+ if( config.in_w < EPSILON ) return 1;
+ if( config.in_h < EPSILON ) return 1;
+ if( config.out_w < EPSILON ) return 1;
+ if( config.out_h < EPSILON ) return 1;
-// printf("TranslateMain::process_realtime 3 output=%p input=%p config.w=%f config.h=%f"
-// "%f %f %f %f -> %f %f %f %f\n", output, input, config.w, config.h,
-// in_x1, in_y1, in_x2, in_y2, out_x1, out_y1, out_x2, out_y2);
- overlayer->overlay(output, input,
- config.in_x, config.in_y,
- config.in_x + config.in_w, config.in_y + config.in_h,
- config.out_x, config.out_y,
- config.out_x + config.out_w, config.out_y + config.out_h,
- 1, TRANSFER_REPLACE, get_interpolation_type());
- return 0;
-}
+ float ix1 = config.in_x, ox1 = config.out_x;
+ float ix2 = ix1 + config.in_w;
+ if( ix1 < 0 ) {
+ ox1 -= ix1;
+ ix2 = config.in_w;
+ ix1 = 0;
+ }
+
+ if(ix2 > output->get_w())
+ ix2 = output->get_w();
+ float iy1 = config.in_y, oy1 = config.out_y;
+ float iy2 = iy1 + config.in_h;
+
+ if( iy1 < 0 ) {
+ oy1 -= iy1;
+ iy2 = config.in_h;
+ iy1 = 0;
+ }
+
+ if( iy2 > output->get_h() )
+ iy2 = output->get_h();
+
+ float cx = config.out_w / config.in_w;
+ float cy = config.out_h / config.in_h;
+
+ float ox2 = ox1 + (ix2 - ix1) * cx;
+ float oy2 = oy1 + (iy2 - iy1) * cy;
+
+ if( ox1 < 0 ) {
+ ix1 += -ox1 / cx;
+ ox1 = 0;
+ }
+ if( oy1 < 0 ) {
+ iy1 += -oy1 / cy;
+ oy1 = 0;
+ }
+ if( ox2 > output->get_w() ) {
+ ix2 -= (ox2 - output->get_w()) / cx;
+ ox2 = output->get_w();
+ }
+ if( oy2 > output->get_h() ) {
+ iy2 -= (oy2 - output->get_h()) / cy;
+ oy2 = output->get_h();
+ }
+
+ if( ix1 >= ix2 ) return 1;
+ if( iy1 >= iy2 ) return 1;
+ if( ox1 >= ox2 ) return 1;
+ if( oy1 >= oy2 ) return 1;
+
+ overlayer->overlay(output, input,
+ ix1, iy1, ix2, iy2,
+ ox1, oy1, ox2, oy2,
+ 1, TRANSFER_REPLACE,
+ get_interpolation_type());
+ return 0;
+}
NEW_WINDOW_MACRO(TranslateMain, TranslateWin)
void TranslateMain::update_gui()
{
- if(thread)
- {
- if(load_configuration())
- {
- thread->window->lock_window();
- ((TranslateWin*)thread->window)->in_x->update(config.in_x);
- ((TranslateWin*)thread->window)->in_y->update(config.in_y);
- ((TranslateWin*)thread->window)->in_w->update(config.in_w);
- ((TranslateWin*)thread->window)->in_h->update(config.in_h);
- ((TranslateWin*)thread->window)->out_x->update(config.out_x);
- ((TranslateWin*)thread->window)->out_y->update(config.out_y);
- ((TranslateWin*)thread->window)->out_w->update(config.out_w);
- ((TranslateWin*)thread->window)->out_h->update(config.out_h);
- thread->window->unlock_window();
- }
- }
+ if( !thread ) return;
+ if( !load_configuration() ) return;
+
+ TranslateWin *window = (TranslateWin*)thread->window;
+ window->lock_window();
+ window->in_x->update(config.in_x);
+ window->in_y->update(config.in_y);
+ window->in_w->update(config.in_w);
+ window->in_h->update(config.in_h);
+ window->out_x->update(config.out_x);
+ window->out_y->update(config.out_y);
+ window->out_w->update(config.out_w);
+ window->out_h->update(config.out_h);
+ window->unlock_window();
}
output.tag.set_property("AMOUNT", config.amount);
output.tag.set_property("THRESHOLD", config.threshold);
output.append_tag();
+ output.tag.set_title("/UNSHARP");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("USE_WAVE_PARADE", use_wave_parade);
}
+ output.append_tag();
+ output.tag.set_title("/VIDEOSCOPE");
output.append_tag();
output.append_newline();
output.terminate_string();
output.tag.set_property("OUTPUT", config.carrier_track);
output.tag.set_property("BANDS", config.bands);
output.append_tag();
+ output.tag.set_title("/VOCODER");
+ output.append_tag();
output.append_newline();
-
output.terminate_string();
}
output.tag.set_property("PHASE", config.phase);
output.tag.set_property("WAVELENGTH", config.wavelength);
output.append_tag();
+ output.tag.set_title("/WAVE");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("PINCH", config.pinch);
output.tag.set_property("RADIUS", config.radius);
output.append_tag();
+ output.tag.set_title("/WHIRL");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
// data is now in *text
}
output.tag.set_title("WIPE");
output.tag.set_property("DIRECTION", direction);
output.append_tag();
+ output.tag.set_title("/WIPE");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("U", config.u);
output.tag.set_property("V", config.v);
output.append_tag();
+ output.tag.set_title("/YUV");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("V_DX", config.v_dx);
output.tag.set_property("V_DY", config.v_dy);
output.append_tag();
+ output.tag.set_title("/YUVSHIFT");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}
output.tag.set_property("B", config.b);
output.tag.set_property("A", config.a);
output.append_tag();
+ output.tag.set_title("/ZOOMBLUR");
+ output.append_tag();
+ output.append_newline();
output.terminate_string();
}