delete temp; temp = 0;
}
if( !temp )
- temp = new VFrame(asset->width, asset->height, BC_RGB888);
+ temp = new VFrame(asset->width, asset->height, BC_RGB888, 0);
int ww = picon->gui->vicon_thread->view_w;
int hh = picon->gui->vicon_thread->view_h;
while( seq_no >= images.size() ) {
void PaletteWheelValue::create_objects()
{
- frame = new VFrame(0, -1, get_w(), get_h(), BC_RGB888, -1);
+ frame = new VFrame(get_w(), get_h(), BC_RGB888);
draw(window->hsv.h, window->hsv.s, window->hsv.v);
flash();
}
int h = input->get_h();
// Default to NTSC if unknown
if(h != 480 && h != 576) h = 480;
-
- temp_frame2 = new VFrame(0,
- -1,
- 720,
- h,
- BC_YUV422,
- -1);
+ temp_frame2 = new VFrame(720, h, BC_YUV422, 0);
}
}
if( !temp_frame ) {
- temp_frame = new VFrame(asset->width, asset->height, supported_colormodel);
+ temp_frame = new VFrame(asset->width, asset->height, supported_colormodel, 0);
}
// printf("File::read_frame %d\n", __LINE__);
}
VFrame *fp = frame->get_w() == swidth && frame->get_h() == sheight &&
frame->get_color_model() == BC_YUV420P ? frame :
- !vframe ? (vframe = new VFrame(swidth,sheight,BC_YUV420P)) :
+ !vframe ? (vframe = new VFrame(swidth,sheight,BC_YUV420P,0)) :
vframe;
if( !result ) {
if( frame_id < 0 )
if(frame->get_color_model() != native_cmodel)
{
- if(!exr_unit->temp_frame) exr_unit->temp_frame = new VFrame(0,
- -1,
- asset->width,
- asset->height,
- native_cmodel,
- -1);
+ if(!exr_unit->temp_frame) exr_unit->temp_frame =
+ new VFrame(asset->width, asset->height, native_cmodel, 0);
BC_CModels::transfer(exr_unit->temp_frame->get_rows(), /* Leave NULL if non existent */
frame->get_rows(),
exr_unit->temp_frame->get_y(), /* Leave NULL if non existent */
data->allocate_compressed_data(ostat.st_size);
data->set_compressed_size(ostat.st_size);
(void)fread(data->get_data(), ostat.st_size, 1, fd);
- temp = new VFrame(0,
- -1,
- asset->width,
- asset->height,
- frame->get_color_model(),
- -1);
+ temp = new VFrame(asset->width, asset->height,
+ frame->get_color_model(), 0);
read_frame(temp, data);
break;
}
}
else
{
- temp = new VFrame(0,
- -1,
- asset->width,
- asset->height,
- frame->get_color_model(),
- -1);
+ temp = new VFrame(asset->width, asset->height, frame->get_color_model(), 0);
read_frame(temp, asset->path);
}
}
if(!temp_frame)
{
- temp_frame = new VFrame(0,
- -1,
- temp_w,
- temp_h,
- output_cmodel,
- -1);
+ temp_frame = new VFrame(temp_w, temp_h,
+ output_cmodel, 0);
}
BC_CModels::transfer(temp_frame->get_rows(),
//printf("FileMPEG::write_frames %d\n", __LINE__);sleep(1);
if(!temp_frame)
{
- temp_frame = new VFrame(0,
- -1,
- asset->width,
- asset->height,
- output_cmodel,
- -1);
+ temp_frame = new VFrame(asset->width, asset->height,
+ output_cmodel, 0);
}
// printf("FileMPEG::write_frames %d temp_frame=%p %p %p %p frame=%p %p %p %p color_model=%p %p\n",
yuv.v += yuv.uv_stride * (yuv.uv_height - 1);
yuv.y_stride = - yuv.y_stride;
yuv.uv_stride = - yuv.uv_stride;*/
- VFrame *temp_frame = new VFrame(yuv.y,
- -1,
- 0,
- yuv.u - yuv.y,
- yuv.v - yuv.y,
- - yuv.y_stride,
- yuv.y_height,
- BC_YUV420P,
- - yuv.y_stride);
+ VFrame *temp_frame = new VFrame(yuv.y, -1, 0,
+ yuv.u - yuv.y, yuv.v - yuv.y, - yuv.y_stride,
+ yuv.y_height, BC_YUV420P, - yuv.y_stride);
// copy into temp frame...
BC_CModels::transfer(frame->get_rows(),
if (!temp_frame)
{
- temp_frame = new VFrame (0,
- -1,
- tf->ti.width,
- tf->ti.height,
- BC_YUV420P,
- -1);
+ temp_frame = new VFrame ( tf->ti.width, tf->ti.height, BC_YUV420P, 0);
}
VFrame *frame = frames[0][j];
int in_color_model = frame->get_color_model();
native_cmodel = asset->png_use_alpha ? BC_RGBA8888 : BC_RGB888;
if(frame->get_color_model() != native_cmodel)
{
- if(!png_unit->temp_frame) png_unit->temp_frame = new VFrame(0,
- -1, asset->width, asset->height, native_cmodel, -1);
+ if(!png_unit->temp_frame) png_unit->temp_frame =
+ new VFrame(asset->width, asset->height, native_cmodel, 0);
png_unit->temp_frame->transfer_from(frame);
output_frame = png_unit->temp_frame;
if(!temp)
{
- temp = new VFrame(0, -1, width, height, source_cmodel, -1);
+ temp = new VFrame(width, height, source_cmodel, 0);
}
output_frame = temp;
}
//printf("FileThread::run %d\n", __LINE__);
if(!local_frame->frame)
{
- local_frame->frame = new VFrame(0,
- -1,
- file->asset->width,
- file->asset->height,
- supported_colormodel,
- -1);
+ local_frame->frame =
+ new VFrame(file->asset->width, file->asset->height,
+ supported_colormodel, 0);
}
// Read it
else
{
video_buffer[buffer][layer][frame] =
- new VFrame(0,
- -1,
- file->asset->width,
- file->asset->height,
- color_model,
- -1);
+ new VFrame( file->asset->width, file->asset->height,
+ color_model, -1);
// printf("FileThread::start_writing %d %d %d %d %p\n",
// __LINE__,
// buffer,
}
if(!tiff_unit->temp)
{
- tiff_unit->temp = new VFrame(0,
- -1,
- asset->width,
- asset->height,
- color_model,
- -1);
+ tiff_unit->temp =
+ new VFrame(asset->width, asset->height, color_model, 0);
}
BC_CModels::transfer(tiff_unit->temp->get_rows(),
this->auto_toggle = auto_toggle;
this->color = 0;
for( int i=0; i<3; ++i ) {
- vframes[i] = new VFrame(w, w, BC_RGBA8888, -1);
+ vframes[i] = new VFrame(w, w, BC_RGBA8888);
vframes[i]->clear_frame();
}
}
int h = input->get_h();
// Default to NTSC if unknown
if(h != 480 && h != 576) h = 480;
-
- temp_frame2 = new VFrame(0,
- -1,
- 720,
- h,
- BC_YUV422,
- -1);
-
+ temp_frame2 = new VFrame(720, h, BC_YUV422, 0);
}
int norm = is_pal ? DV_PAL : DV_NTSC;
SET_TRACE
if(temp &&
(temp->get_w() != oversampled_package_w ||
- temp->get_h() != oversampled_package_h))
- {
- delete temp;
- temp = 0;
+ temp->get_h() != oversampled_package_h)) {
+ delete temp; temp = 0;
}
//printf("MaskUnit::process_package 1\n");
SET_TRACE
- if(!temp)
- {
- temp = new VFrame(0,
- -1,
- oversampled_package_w,
- oversampled_package_h,
- BC_A8,
- -1);
+ if(!temp) {
+ temp = new VFrame(oversampled_package_w, oversampled_package_h, BC_A8, 0);
}
SET_TRACE
recalculate = 1;
if(!mask)
{
- mask = new VFrame(0,
- -1,
- output->get_w(),
- output->get_h(),
- new_color_model,
- -1);
- temp_mask = new VFrame(0,
- -1,
- output->get_w(),
- output->get_h(),
- new_color_model,
- -1);
+ mask = new VFrame(output->get_w(), output->get_h(),
+ new_color_model, 0);
+ temp_mask = new VFrame(output->get_w(), output->get_h(),
+ new_color_model, 0);
}
if(new_feather > 0)
temp_mask->clear_frame();
{
SET_TRACE
//printf("MaskEngine::init_packages 1\n");
- int division = (int)((float)output->get_h() / (get_total_packages() / 2) + 0.5);
- if(division < 1) division = 1;
-
+ int x0 = 0, y0 = 0, i = 0, n = get_total_packages();
+ int out_w = output->get_w(), out_h = output->get_h();
SET_TRACE
- for(int i = 0; i < get_total_packages(); i++)
- {
- MaskPackage *ptr = (MaskPackage*)get_package(i);
-
- ptr->start_y = output->get_h() * i / get_total_packages();
- ptr->end_y = output->get_h() * (i + 1) / get_total_packages();
-
- ptr->start_x = output->get_w() * i / get_total_packages();
- ptr->end_x = output->get_w() * (i + 1) / get_total_packages();
+ while( i < n ) {
+ MaskPackage *ptr = (MaskPackage*)get_package(i++);
+ int x1 = (out_w * i) / n, y1 = (out_h * i) / n;
+ ptr->start_x = x0; ptr->end_x = x1;
+ ptr->start_y = y0; ptr->end_y = y1;
+ x0 = x1; y0 = y1;
}
SET_TRACE
//printf("MaskEngine::init_packages 2\n");
}
if(!temp_frame) {
- temp_frame = new VFrame(0, -1, temp_w, temp_h,
- input->get_color_model(), -1);
+ temp_frame =
+ new VFrame(temp_w, temp_h, input->get_color_model(), 0);
}
temp_frame->clear_frame();
if(!temp)
{
- temp = new VFrame(0, -1, w, h, color_model, -1);
+ temp = new VFrame(w, h, color_model, 0);
}
return temp;
if(!temp_picon)
{
- temp_picon = new VFrame(0,
- -1,
- source_w,
- source_h,
- source_cmodel,
- -1);
+ temp_picon = new VFrame(source_w, source_h, source_cmodel, 0);
}
// Get temporary to copy cached frame to
if(!temp_picon2)
{
- temp_picon2 = new VFrame(0,
- -1,
- item->picon_w,
- item->picon_h,
- BC_RGB888,
- -1);
+ temp_picon2 = new VFrame( item->picon_w, item->picon_h, BC_RGB888, 0);
}
Asset *asset = 0;
picon_frame = mwindow->frame_cache->get_frame_ptr(item->position,
- item->layer,
- item->frame_rate,
- BC_RGB888,
- item->picon_w,
- item->picon_h,
- source_id);
+ item->layer, item->frame_rate, BC_RGB888,
+ item->picon_w, item->picon_h, source_id);
//printf("search cache %ld,%d,%f,%dx%d,%d = %p\n",
// item->position, item->layer, item->frame_rate,
// item->picon_w, item->picon_h, source_id, picon_frame);
- if( picon_frame )
- {
+ if( picon_frame ) {
temp_picon2->copy_from(picon_frame);
// Unlock the get_frame_ptr command
mwindow->frame_cache->unlock();
if(need_conversion)
{
- picon_frame = new VFrame(0,
- -1,
- item->picon_w,
- item->picon_h,
- BC_RGB888,
- -1);
- BC_CModels::transfer(picon_frame->get_rows(),
- temp_picon->get_rows(),
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- temp_picon->get_w(),
- temp_picon->get_h(),
- 0,
- 0,
- picon_frame->get_w(),
- picon_frame->get_h(),
- source_cmodel,
- BC_RGB888,
- 0,
+ picon_frame = new VFrame(item->picon_w, item->picon_h, BC_RGB888, 0);
+ BC_CModels::transfer(picon_frame->get_rows(), temp_picon->get_rows(),
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, temp_picon->get_w(), temp_picon->get_h(),
+ 0, 0, picon_frame->get_w(), picon_frame->get_h(),
+ source_cmodel, BC_RGB888, 0,
temp_picon->get_bytes_per_line(),
picon_frame->get_bytes_per_line());
temp_picon2->copy_from(picon_frame);
- mwindow->frame_cache->put_frame(picon_frame,
- item->position,
- item->layer,
- mwindow->edl->session->frame_rate,
- 0,
- item->indexable);
+ mwindow->frame_cache->put_frame(picon_frame, item->position, item->layer,
+ mwindow->edl->session->frame_rate, 0, item->indexable);
}
// Allow escape here
if(interrupted)
- {
return;
- }
-
// Draw the picon
mwindow->gui->lock_window("ResourceThread::do_video");
// Render everything into a temporary, then overlay the temporary
// if(!EQUIV(ry, 0) || get_flip())
// {
- temp = new VFrame(image->get_w(),
- image->get_h(),
- image->get_color_model());
+ temp = new VFrame(image->get_w(), image->get_h(), image->get_color_model(), 0);
// }
if(debug) printf("SceneNode::render %d\n", __LINE__);
VFrame *src = temp;
if(!EQUIV(ry, 0))
{
- src = temp2 = new VFrame(image->get_w(),
- image->get_h(),
- image->get_color_model());
- if(!scene->affine) scene->affine =
- new AffineEngine(scene->cpus, scene->cpus);
- scene->affine->rotate(temp2,
- temp,
- ry);
+ src = temp2 = new VFrame(image->get_w(), image->get_h(), image->get_color_model(), 0);
+ if(!scene->affine) scene->affine = new AffineEngine(scene->cpus, scene->cpus);
+ scene->affine->rotate(temp2, temp, ry);
if(debug) printf("SceneNode::render %d ry=%f\n", __LINE__, ry);
}
src->flip_horiz();
if(debug) printf("SceneNode::render %d src=%p x=%f y=%f sx=%f sy=%f\n",
- __LINE__,
- src,
- x,
- y,
- sx,
- sy);
-
+ __LINE__, src, x, y, sx, sy);
// Overlay on the output frame
if(!scene->overlayer) scene->overlayer = new OverlayFrame(scene->cpus);
this->mwindow = mwindow;
active_channel = -1;
box_r = mwindow->theme->channel_position_data->get_w() / 2;
- temp_picon = new VFrame(0,
- -1,
+ temp_picon = new VFrame(
mwindow->theme->channel_position_data->get_w(),
mwindow->theme->channel_position_data->get_h(),
mwindow->theme->channel_position_data->get_color_model(),
- -1);
+ 0);
rotater = new RotateFrame(mwindow->preferences->processors,
mwindow->theme->channel_position_data->get_w(),
mwindow->theme->channel_position_data->get_h());
#include <string.h>
#define NEW_VFRAME \
-new VFrame(0, -1, default_data.get_w(), default_data.get_h(), BC_RGBA8888, -1)
+new VFrame(default_data.get_w(), default_data.get_h(), BC_RGBA8888)
Theme::Theme()
: BC_Theme()
buffer_vector = new VFrame*[virtual_plugins.total];
for(int i = 0; i < virtual_plugins.total; i++)
{
- buffer_vector[i] = new VFrame(0,
- -1,
- width,
- height,
- colormodel,
- -1);
+ buffer_vector[i] = new VFrame(width, height, colormodel);
}
}
}
user_frame = new VFrame;
break;
default:
- user_frame = new VFrame(0,
- -1,
- device->out_w,
- device->out_h,
- colormodel,
- -1);
+ user_frame = new VFrame(device->out_w, device->out_h, colormodel);
break;
}
}
if(!output_temp)
{
// Texture is created on demand
- output_temp = new VFrame(0,
- -1,
- track->track_w,
- track->track_h,
- renderengine->get_edl()->session->color_model,
- -1);
+ output_temp = new VFrame( track->track_w, track->track_h,
+ renderengine->get_edl()->session->color_model);
}
// Reset OpenGL state
if(!(*input))
{
- (*input) = new VFrame(0,
- -1,
- asset_w,
- asset_h,
- get_edl()->session->color_model,
- -1);
+ (*input) =
+ new VFrame(asset_w, asset_h,
+ get_edl()->session->color_model);
}
// Load incoming frame
if(!(*transition_input))
{
- (*transition_input) = new VFrame(0,
- -1,
- track->track_w,
- track->track_h,
- get_edl()->session->color_model,
- -1);
+ (*transition_input) =
+ new VFrame(track->track_w, track->track_h,
+ get_edl()->session->color_model);
}
(*transition_input)->copy_stacks(output);
int tw = frame->get_w(), th = frame->get_h();
if( frame->get_color_model() != BC_RGBA8888 ) {
- temp_frame = new VFrame(tw, th, BC_RGBA8888);
+ temp_frame = new VFrame(tw, th, BC_RGBA8888, 0);
temp_frame->transfer_from(frame);
}
VFrame::VFrame(int w, int h, int color_model, long bytes_per_line)
{
reset_parameters(1);
+// use bytes_per_line == 0 to allocate default unshared
+ if( !bytes_per_line ) { bytes_per_line = -1; use_shm = 0; }
params = new BC_Hash;
allocate_data(data, -1, 0, 0, 0, w, h,
color_model, bytes_per_line);
bc_cmodel = BC_RGBA8888;
png_cmodel = PNG_COLOR_TYPE_RGB_ALPHA;
}
- vframe = new VFrame(get_w(), get_h(), bc_cmodel, -1);
+ vframe = new VFrame(get_w(), get_h(), bc_cmodel, 0);
vframe->transfer_from(this);
break;
}
load_configuration();
if(!temp)
{
- temp = new VFrame(input->get_w(), input->get_h(), input->get_color_model());
+ temp = new VFrame(input->get_w(), input->get_h(), input->get_color_model(), 0);
temp->clear_frame();
}
load_configuration();
if(!temp)
{
- temp = new VFrame(0,
- -1,
- input->get_w(),
- input->get_h(),
- input->get_color_model(),
- -1);
+ temp = new VFrame(input->get_w(), input->get_h(),
+ input->get_color_model(), 0);
temp->clear_frame();
}
int result = 0;
if(!temp)
- temp = new VFrame(0,
- -1,
- output->get_w(),
- output->get_h(),
- output->get_color_model(),
- -1);
+ temp = new VFrame(output->get_w(), output->get_h(),
+ output->get_color_model(), 0);
if(config.direction == FORWARD)
{
delete dst; dst = 0;
}
if( !dst )
- dst = new VFrame(w, h, BC_A8);
+ dst = new VFrame(w, h, BC_A8, 0);
dst->clear_frame();
if( !engine )
delete msk; msk = 0;
}
if( !msk )
- msk = new VFrame(w, h, BC_A8);
+ msk = new VFrame(w, h, BC_A8, 0);
memset(msk->get_data(), 0xff, msk->get_data_size());
FillRegion fill_region(dst, msk);
if(!frames[0])
{
- for(int i = 0; i < TOTAL_FRAMES; i++)
- {
- frames[i] = new VFrame(0,
- -1,
- frame->get_w(),
- frame->get_h(),
- frame->get_color_model(),
- -1);
+ for(int i = 0; i < TOTAL_FRAMES; i++) {
+ frames[i] = new VFrame(frame->get_w(), frame->get_h(),
+ frame->get_color_model(), 0);
}
}
temp = frame;
// if(!temp)
-// temp = new VFrame(
-// frame->get_w(),
-// frame->get_h(),
-// frame->get_color_model());
+// temp = new VFrame(frame->get_w(), frame->get_h(),
+// frame->get_color_model(), 0);
if(!temp_prevframe)
- temp_prevframe = new VFrame(
- frame->get_w(),
- frame->get_h(),
- frame->get_color_model());
+ temp_prevframe = new VFrame(frame->get_w(), frame->get_h(),
+ frame->get_color_model(), 0);
switch(config.mode)
{
temp = frame;
// if(!temp)
-// temp = new VFrame(0,
-// frame->get_w(),
-// frame->get_h(),
-// frame->get_color_model());
+// temp = new VFrame(frame->get_w(), frame->get_h(),
+// frame->get_color_model(), 0);
switch(config.mode)
{
for(int i = reuse; i < new_allocation; i++)
{
- new_buffer[i] = new VFrame(0,
- -1,
- input->get_w(),
- input->get_h(),
- PluginVClient::project_color_model,
- -1);
+ new_buffer[i] = new VFrame(input->get_w(), input->get_h(),
+ PluginVClient::project_color_model, 0);
}
for(int i = reuse; i < allocation; i++)
// Create new frames
for( ; i < config.frames; i++)
{
- history2[i] = new VFrame(w, h, color_model);
+ history2[i] = new VFrame(w, h, color_model, 0);
history_frame2[i] = -0x7fffffff;
history_valid2[i] = 0;
}
{
history = new VFrame*[config.frames];
for(int i = 0; i < config.frames; i++)
- history[i] = new VFrame(w, h, color_model);
+ history[i] = new VFrame(w, h, color_model, 0);
history_size = config.frames;
history_frame = new int64_t[config.frames];
bzero(history_frame, sizeof(int64_t) * config.frames);
delete dst; dst = 0;
}
if( !dst )
- dst = new VFrame(0, -1, w, h, color_model, -1);
+ dst = new VFrame(w, h, color_model, 0);
if( !engine )
engine = new EdgeEngine(this,
if(!input)
{
- input = new VFrame(0,
- -1,
- frame->get_w(),
- frame->get_h(),
- frame->get_color_model(),
- -1);
+ input = new VFrame(frame->get_w(), frame->get_h(),
+ frame->get_color_model(), 0);
}
// Get input frames
delete accum; accum = 0;
}
if( !accum ) {
- accum = new VFrame(width, height, color_model);
+ accum = new VFrame(width, height, color_model, 0);
accum->clear_frame();
}
if( !overlay )
if(!src_frame)
{
- src_frame = new VFrame(0,
- -1,
- frame->get_w(),
- frame->get_h(),
- frame->get_color_model(),
- -1);
+ src_frame = new VFrame(frame->get_w(), frame->get_h(),
+ frame->get_color_model(), 0);
}
ptr = src_frame;
}
if(!first_frame && config.enabled)
{
if(!first_frame)
- first_frame = new VFrame(0,
- -1,
- frame->get_w(),
- frame->get_h(),
- frame->get_color_model(),
- -1);
+ first_frame = new VFrame(frame->get_w(), frame->get_h(),
+ frame->get_color_model(), 0);
//printf("FreezeFrameMain::process_buffer 1 %jd\n", first_frame_position);
read_frame(first_frame,
0,
gradient = 0;
}
- if(!gradient) gradient = new VFrame(0,
- -1,
- input->get_w(),
- input->get_h(),
- gradient_cmodel,
- -1);
+ if(!gradient)
+ gradient = new VFrame(input->get_w(), input->get_h(),
+ gradient_cmodel, 0);
if(!engine) engine = new GradientServer(this,
get_project_smp() + 1,
{
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;
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++)
{
delete out_temp; out_temp = 0;
}
if( !out_temp )
- out_temp = new VFrame(0, -1, w, h, active_model, -1);
+ out_temp = new VFrame(w, h, active_model, 0);
out_frame = out_temp;
}
{
for(int i = 0; i < 2; i++)
{
- frames[i] = new VFrame(0,
- -1,
- frame->get_w(),
- frame->get_h(),
- frame->get_color_model(),
- -1);
+ frames[i] = new VFrame(frame->get_w(), frame->get_h(),
+ frame->get_color_model(), 0);
}
}
//printf("InterpolateVideo::process_buffer 1 %lld %lld\n", range_start, range_end);
int pattern_position = (PluginClient::source_position + config.frame_offset) % 5;
//printf("IVTCMain::process_realtime %d %d\n", pattern_position, config.first_field);
- if(!temp_frame[0]) temp_frame[0] = new VFrame(0,
- -1,
- input_ptr->get_w(),
- input_ptr->get_h(),
- input_ptr->get_color_model(),
- -1);
- if(!temp_frame[1]) temp_frame[1] = new VFrame(0,
- -1,
- input_ptr->get_w(),
- input_ptr->get_h(),
- input_ptr->get_color_model(),
- -1);
+ if(!temp_frame[0])
+ temp_frame[0] = new VFrame(input_ptr->get_w(), input_ptr->get_h(),
+ input_ptr->get_color_model(), 0);
+ if(!temp_frame[1])
+ temp_frame[1] = new VFrame(input_ptr->get_w(), input_ptr->get_h(),
+ input_ptr->get_color_model(), 0);
int row_size = VFrame::calculate_bytes_per_pixel(input_ptr->get_color_model()) * input_ptr->get_w();
this->input = input_ptr;
this->output = frame;
- if(!temp) temp = new VFrame(0,
- -1,
- frame->get_w(),
- frame->get_h(),
- frame->get_color_model(),
- -1);
+ if(!temp)
+ temp = new VFrame(frame->get_w(), frame->get_h(),
+ frame->get_color_model(), 0);
temp->copy_from(frame);
this->input = temp;
{
if(!temp)
{
- temp = new VFrame(0,
- -1,
- session->vconfig_in->w,
- session->vconfig_in->h,
- input_cmodel,
- -1);
+ temp = new VFrame(session->vconfig_in->w, session->vconfig_in->h,
+ input_cmodel, 0);
}
input = temp;
}
temp_frame = 0;
}
if( !temp_frame )
- temp_frame = new VFrame(w, h, color_model);
+ temp_frame = new VFrame(w, h, color_model, 0);
}
void MotionCVMain::process_global()
//PRINT_TRACE
- VFrame *result = new VFrame();
- result->set_use_shm(0);
- result->reallocate(0,
- -1,
- 0,
- 0,
- 0,
- downsampled_w + 1,
- downsampled_h + 1,
- src->get_color_model(),
- -1);
- downsample_frame(result,
- src,
- ratio);
-
+ VFrame *result =
+ new VFrame(downsampled_w+1, downsampled_h+1, src->get_color_model(), 0);
+ downsample_frame(result, src, ratio);
MotionHVCacheItem *item = new MotionHVCacheItem();
item->image = result;
// rotated_current[i]);
if(!rotated_current[i])
{
- rotated_current[i] = new VFrame();
- rotated_current[i]->set_use_shm(0);
- rotated_current[i]->reallocate(0,
- -1,
- 0,
- 0,
- 0,
- downsampled_current_w + 1,
- downsampled_current_h + 1,
- current_frame_arg->get_color_model(),
- -1);
+ rotated_current[i] =
+ new VFrame(downsampled_current_w+1, downsampled_current_h+1,
+ current_frame_arg->get_color_model(), 0);
//printf("MotionHVScan::pixel_search %d\n", __LINE__);
}
temp_frame = 0;
}
if( !temp_frame )
- temp_frame = new VFrame(w, h, color_model);
+ temp_frame = new VFrame(w, h, color_model, 0);
}
void MotionMain::process_global()
// The center of the search area is fixed in compensate mode or
// the user value + the accumulation vector in track mode.
if( !prev_global_ref )
- prev_global_ref = new VFrame(w, h, color_model);
+ prev_global_ref = new VFrame(w, h, color_model, 0);
if( !current_global_ref )
- current_global_ref = new VFrame(w, h, color_model);
+ current_global_ref = new VFrame(w, h, color_model, 0);
// Global loads the current target frame into the src and
// writes it to the dst frame with desired translation.
if( !global_target_src )
- global_target_src = new VFrame(w, h, color_model);
+ global_target_src = new VFrame(w, h, color_model, 0);
if( !global_target_dst )
- global_target_dst = new VFrame(w, h, color_model);
+ global_target_dst = new VFrame(w, h, color_model, 0);
// Load the global frames
if( need_reload ) {
// The center of the search area is always the user value + the accumulation
// vector.
if( !prev_rotate_ref )
- prev_rotate_ref = new VFrame(w, h, color_model);
+ prev_rotate_ref = new VFrame(w, h, color_model, 0);
// The current global reference is the current rotation reference.
if( !current_rotate_ref )
- current_rotate_ref = new VFrame(w, h, color_model);
+ current_rotate_ref = new VFrame(w, h, color_model, 0);
current_rotate_ref->copy_from(current_global_ref);
// The global target destination is copied to the rotation target source
// if we're tracking.
// The pivot is fixed to the user position if we're compensating.
if( !rotate_target_src )
- rotate_target_src = new VFrame(w, h, color_model);
+ rotate_target_src = new VFrame(w, h, color_model, 0);
if( !rotate_target_dst )
- rotate_target_dst = new VFrame(w, h, color_model);
+ rotate_target_dst = new VFrame(w, h, color_model, 0);
}
}
// Rotation only
// Rotation reads the previous reference frame and compares it with current
// reference frame.
if( !prev_rotate_ref )
- prev_rotate_ref = new VFrame(w, h, color_model);
+ prev_rotate_ref = new VFrame(w, h, color_model, 0);
if( !current_rotate_ref )
- current_rotate_ref = new VFrame(w, h, color_model);
+ current_rotate_ref = new VFrame(w, h, color_model, 0);
// Rotation loads target frame to temporary, rotates it, and writes it to the
// target frame. The pivot is always fixed.
if( !rotate_target_src )
- rotate_target_src = new VFrame(w, h, color_model);
+ rotate_target_src = new VFrame(w, h, color_model, 0);
if( !rotate_target_dst )
- rotate_target_dst = new VFrame(w, h, color_model);
+ rotate_target_dst = new VFrame(w, h, color_model, 0);
// Load the rotate frames
if( !rotater )
rotater = new AffineEngine(1, 1);
- if( !temp ) temp = new VFrame(0,
- -1,
- server->previous_frame->get_w(),
- server->previous_frame->get_h(),
- color_model,
- -1);
+ if( !temp )
+ temp = new VFrame(
+ server->previous_frame->get_w(),
+ server->previous_frame->get_h(),
+ color_model, 0);
//printf("RotateScanUnit::process_package %d\n", __LINE__);
temp_frame = 0;
}
if(!temp_frame)
- temp_frame = new VFrame(w, h, color_model);
+ temp_frame = new VFrame(w, h, color_model, 0);
}
// The center of the search area is fixed in compensate mode or
// the user value + the accumulation vector in track mode.
if(!prev_global_ref)
- prev_global_ref = new VFrame(w, h, color_model);
+ prev_global_ref = new VFrame(w, h, color_model, 0);
if(!current_global_ref)
- current_global_ref = new VFrame(w, h, color_model);
+ current_global_ref = new VFrame(w, h, color_model, 0);
// Global loads the current target frame into the src and
// writes it to the dst frame with desired translation.
if(!global_target_src)
- global_target_src = new VFrame(w, h, color_model);
+ global_target_src = new VFrame(w, h, color_model, 0);
if(!global_target_dst)
- global_target_dst = new VFrame(w, h, color_model);
+ global_target_dst = new VFrame(w, h, color_model, 0);
// Load the global frames
delete tmp; tmp = 0;
}
if( !tmp )
- tmp = new VFrame(0, -1, ref->get_w(), ref->get_h(), ref->get_color_model(), -1);
+ tmp = new VFrame(ref->get_w(), ref->get_h(), ref->get_color_model(), 0);
return tmp;
}
if(input_ptr->get_rows()[0] == output_ptr->get_rows()[0])
{
- if(!temp) temp = new VFrame(0,
- -1,
- input_ptr->get_w(),
- input_ptr->get_h(),
- input_ptr->get_color_model(),
- -1);
+ if(!temp) temp = new VFrame(input_ptr->get_w(), input_ptr->get_h(),
+ input_ptr->get_color_model(), 0);
temp->copy_from(input_ptr);
this->input = temp;
}
{
if(input->get_rows()[0] == output->get_rows()[0])
{
- if(!temp_frame) temp_frame = new VFrame(0,
- -1,
- input->get_w(),
- input->get_h(),
- input->get_color_model(),
- -1);
+ if(!temp_frame)
+ temp_frame = new VFrame(input->get_w(), input->get_h(),
+ input->get_color_model(), 0);
temp_frame->copy_from(input);
this->input = temp_frame;
}
if( --layers > 0 ) { // need 2 layers to do overlay
if( !temp )
- temp = new VFrame(0, -1, frame[0]->get_w(), frame[0]->get_h(),
- frame[0]->get_color_model(), -1);
+ temp = new VFrame(frame[0]->get_w(), frame[0]->get_h(),
+ frame[0]->get_color_model(), 0);
while( --layers >= 0 ) {
current_layer += step;
}
}
if( !temp )
- temp = new VFrame(need_w, need_h, color_model);
+ temp = new VFrame(need_w, need_h, color_model, 0);
break;
}
switch( config.mode ) {
{
if(input->get_rows()[0] == output->get_rows()[0])
{
- if(!temp_frame) temp_frame = new VFrame(0,
- -1,
- input->get_w(),
- input->get_h(),
- input->get_color_model(),
- -1);
+ if(!temp_frame)
+ temp_frame = new VFrame(input->get_w(), input->get_h(),
+ input->get_color_model(), 0);
temp_frame->copy_from(input);
this->input = temp_frame;
}
this->output = frame;
- if(!temp) temp = new VFrame(0,
- -1,
- frame->get_w(),
- frame->get_h(),
- frame->get_color_model(),
- -1);
+ if(!temp)
+ temp = new VFrame(frame->get_w(), frame->get_h(),
+ frame->get_color_model(), 0);
temp->copy_from(frame);
this->input = temp;
delete temp_frame; temp_frame = 0;
}
if( !temp_frame )
- temp_frame = new VFrame(w, h, color_model);
+ temp_frame = new VFrame(w, h, color_model, 0);
frame = temp_frame;
if( color_model != input->get_color_model() )
BC_CModels::transfer(frame->get_rows(), input->get_rows(),
temp_frame = 0;
}
if(!temp_frame)
- temp_frame = new VFrame(0, -1,
- input_ptr->get_w(), input_ptr->get_h(),
- input->get_color_model(), -1);
+ temp_frame = new VFrame(input_ptr->get_w(), input_ptr->get_h(),
+ input->get_color_model(), 0);
temp_frame->copy_from(input);
input = temp_frame;
}
close(fd);
if( ofrm && ofrm->get_color_model() != output->get_color_model() ) {
VFrame *vfrm = new VFrame(ofrm->get_w(), ofrm->get_h(),
- output->get_color_model());
+ output->get_color_model(), 0);
vfrm->transfer_from(ofrm);
delete ofrm; ofrm = vfrm;
}
if(new_position > prev_frame + 1)
{
//printf("SwapFrames::process_buffer %d\n", __LINE__);
- if(!buffer) buffer = new VFrame(0,
- -1,
- frame->get_w(),
- frame->get_h(),
- frame->get_color_model(),
- -1);
+ if(!buffer)
+ buffer = new VFrame(frame->get_w(), frame->get_h(),
+ frame->get_color_model(), 0);
buffer_position = new_position - 1;
read_frame(buffer,
0,
// Create new frames
for( ; i < config.frames; i++)
{
- history2[i] = new VFrame(w, h, color_model);
+ history2[i] = new VFrame(w, h, color_model, 0);
history_frame2[i] = -0x7fffffff;
history_valid2[i] = 0;
}
{
history = new VFrame*[config.frames];
for(int i = 0; i < config.frames; i++)
- history[i] = new VFrame(w, h, color_model);
+ history[i] = new VFrame(w, h, color_model, 0);
history_size = config.frames;
history_frame = new int64_t[config.frames];
bzero(history_frame, sizeof(int64_t) * config.frames);
{
VFrame **outframes = frame;
VFrame *(framelist[1024]);
- framelist[0] = new VFrame (
- outframes[0]->get_w(),
- outframes[0]->get_h(),
- outframes[0]->get_color_model());
+ framelist[0] = new VFrame (outframes[0]->get_w(), outframes[0]->get_h(),
+ outframes[0]->get_color_model(), 0);
read_frame(framelist[0],
0,
start_position,
{
need_reconfigure = 0;
- if(!gradient) gradient = new VFrame(
- outframes[0]->get_w(),
- outframes[0]->get_h(),
- BC_A8);
-
+ if(!gradient)
+ gradient = new VFrame( outframes[0]->get_w(), outframes[0]->get_h(), BC_A8, 0);
if (config.shape != TimeFrontConfig::OTHERTRACK &&
config.shape != TimeFrontConfig::ALPHA)
}
if (config.shape == TimeFrontConfig::ALPHA)
{
- if(!gradient) gradient = new VFrame(
- outframes[0]->get_w(),
- outframes[0]->get_h(),
- BC_A8);
+ if(!gradient)
+ gradient = new VFrame(outframes[0]->get_w(), outframes[0]->get_h(), BC_A8, 0);
VFrame *tfframe = framelist[0];
switch (tfframe->get_color_model())
{
} else
if (config.shape == TimeFrontConfig::OTHERTRACK)
{
- if(!gradient) gradient = new VFrame(
- outframes[0]->get_w(),
- outframes[0]->get_h(),
- BC_A8);
+ if(!gradient)
+ gradient = new VFrame(outframes[0]->get_w(), outframes[0]->get_h(), BC_A8, 0);
VFrame *tfframe = outframes[1];
read_frame(tfframe,
1,
{
for (int i = 1; i <= config.frame_range; i++)
{
- framelist[i] = new VFrame (
- outframes[0]->get_w(),
- outframes[0]->get_h(),
- outframes[0]->get_color_model());
+ framelist[i] = new VFrame (outframes[0]->get_w(), outframes[0]->get_h(),
+ outframes[0]->get_color_model(), 0);
read_frame(framelist[i],
0,
delete bg_frame; bg_frame = 0;
}
if( !bg_frame )
- bg_frame = new VFrame(0, -1, bw, bh, output_model, -1);
+ bg_frame = new VFrame(bw, bh, output_model);
int64_t position = get_source_position() - get_source_start();
if( !read_background(bg_frame, position, output_model) ) {
if( !overlay_frame )
VFrame *vframe = get_image(path);
if( !vframe && (vframe=VFramePng::vframe_png(path)) != 0 ) {
if( vframe->get_color_model() != text_model ) {
- VFrame *frame = new VFrame(vframe->get_w(), vframe->get_h(), text_model);
+ VFrame *frame = new VFrame(vframe->get_w(), vframe->get_h(),
+ text_model, 0);
frame->transfer_from(vframe); delete vframe;
vframe = frame;
}
temp_frame = 0;
}
if(!temp_frame)
- temp_frame = new VFrame(0,
- -1,
- input_ptr->get_w(),
- input_ptr->get_h(),
- input->get_color_model(),
- -1);
+ temp_frame = new VFrame(input_ptr->get_w(), input_ptr->get_h(),
+ input->get_color_model(), 0);
temp_frame->copy_from(input);
input = temp_frame;
}
{
if(input->get_rows()[0] == output->get_rows()[0])
{
- if(!temp_frame) temp_frame = new VFrame(0,
- -1,
- input->get_w(),
- input->get_h(),
- input->get_color_model(),
- -1);
+ if(!temp_frame) temp_frame = new VFrame(input->get_w(), input->get_h(),
+ input->get_color_model(), 0);
temp_frame->copy_from(input);
this->input = temp_frame;
}
{
if(input->get_rows()[0] == output->get_rows()[0])
{
- if(!temp_frame) temp_frame = new VFrame(0,
- -1,
- input->get_w(),
- input->get_h(),
- input->get_color_model(),
- -1);
+ if(!temp_frame) temp_frame = new VFrame(input->get_w(), input->get_h(),
+ input->get_color_model(), 0);
temp_frame->copy_from(input);
this->input = temp_frame;
}
temp_frame = 0;
}
if( !temp_frame )
- temp_frame = new VFrame(w, h, colormodel);
+ temp_frame = new VFrame(w, h, colormodel, 0);
if( input_ptr == output_ptr ) {
temp_frame->copy_from(input_ptr);
input_ptr = temp_frame;
delete temp_frame; temp_frame = 0;
}
if( !temp_frame )
- temp_frame = new VFrame(w, h, color_model);
+ temp_frame = new VFrame(w, h, color_model, 0);
frame = temp_frame;
if( color_model != input->get_color_model() )
BC_CModels::transfer(frame->get_rows(), input->get_rows(),
if(is_before)
{
- if(!temp) temp = new VFrame(outgoing->get_w(),
- outgoing->get_h(),
- outgoing->get_color_model());
+ if(!temp) temp = new VFrame(outgoing->get_w(), outgoing->get_h(),
+ outgoing->get_color_model(), 0);
temp->clear_frame();
- overlayer->overlay(temp,
- outgoing,
- in_x,
- in_y,
- in_x + in_w,
- in_y + in_h,
- 0,
- 0,
- temp->get_w(),
- temp->get_h(),
- 1.0,
- TRANSFER_REPLACE,
- CUBIC_LINEAR);
+ overlayer->overlay(temp, outgoing,
+ in_x, in_y, in_x + in_w, in_y + in_h,
+ 0, 0, temp->get_w(), temp->get_h(),
+ 1.0, TRANSFER_REPLACE, CUBIC_LINEAR);
outgoing->copy_from(temp);
}
else
{
outgoing->clear_frame();
- overlayer->overlay(outgoing,
- incoming,
- in_x,
- in_y,
- in_x + in_w,
- in_y + in_h,
- 0,
- 0,
- temp->get_w(),
- temp->get_h(),
- 1.0,
- TRANSFER_REPLACE,
- CUBIC_LINEAR);
+ overlayer->overlay(outgoing, incoming,
+ in_x, in_y, in_x + in_w, in_y + in_h,
+ 0, 0, temp->get_w(), temp->get_h(),
+ 1.0, TRANSFER_REPLACE, CUBIC_LINEAR);
}
return 0;
this->output = frame;
- if(!temp) temp = new VFrame(0,
- -1,
- frame->get_w(),
- frame->get_h(),
- frame->get_color_model(),
- -1);
+ if(!temp) temp = new VFrame(frame->get_w(), frame->get_h(),
+ frame->get_color_model(), 0);
temp->copy_from(frame);
this->input = temp;