VFrame Class Reference

#include <vframe.h>

Collaboration diagram for VFrame:

Collaboration graph
[legend]

Public Types

enum  { UNKNOWN, RAM, TEXTURE, SCREEN }

Public Member Functions

 VFrame (unsigned char *data, int w, int h, int color_model=BC_RGBA8888, long bytes_per_line=-1)
 VFrame (unsigned char *data, long y_offset, long u_offset, long v_offset, int w, int h, int color_model=BC_RGBA8888, long bytes_per_line=-1)
 VFrame (unsigned char *png_data)
 VFrame (VFrame &vframe)
 VFrame ()
 ~VFrame ()
int equivalent (VFrame *src, int test_stacks=0)
int reallocate (unsigned char *data, long y_offset, long u_offset, long v_offset, int w, int h, int color_model, long bytes_per_line)
void set_memory (unsigned char *data, long y_offset, long u_offset, long v_offset)
void set_compressed_memory (unsigned char *data, int data_size, int data_allocated)
int read_png (unsigned char *data)
int equals (VFrame *frame)
int params_match (int w, int h, int color_model)
long set_shm_offset (long offset)
long get_shm_offset ()
int copy_from (VFrame *frame)
int clear_frame ()
int allocate_compressed_data (long bytes)
long get_number ()
void set_number (long number)
long get_compressed_allocated ()
long get_compressed_size ()
long set_compressed_size (long size)
int get_color_model ()
unsigned char * get_data ()
unsigned char ** get_rows ()
unsigned char * get_y ()
unsigned char * get_u ()
unsigned char * get_v ()
int get_w ()
int get_h ()
int get_w_fixed ()
int get_h_fixed ()
int get_bytes_per_pixel ()
long get_bytes_per_line ()
int get_shared ()
long get_data_size ()
void rotate270 ()
void rotate90 ()
void flip_vert ()
int get_field2_offset ()
int set_field2_offset (int value)
void set_keyframe (int value)
int get_keyframe ()
void overlay (VFrame *src, int out_x1, int out_y1)
void to_texture ()
void to_ram ()
void screen_to_texture (int x=-1, int y=-1, int w=-1, int h=-1)
void draw_texture (float in_x1, float in_y1, float in_x2, float in_y2, float out_x1, float out_y1, float out_x2, float out_y2, int flip_y=0)
void draw_texture (int flip_y=0)
int get_opengl_state ()
void set_opengl_state (int value)
int get_texture_id ()
void set_texture_id (int id)
int get_window_id ()
int get_texture_w ()
int get_texture_h ()
int get_texture_components ()
void enable_opengl ()
void clear_pbuffer ()
BC_PBufferget_pbuffer ()
void bind_texture (int texture_unit=-1)
void init_screen ()
void push_prev_effect (char *name)
void pop_prev_effect ()
void push_next_effect (char *name)
void pop_next_effect ()
char * get_next_effect (int number=0)
char * get_prev_effect (int number=0)
BC_Hashget_params ()
int equal_stacks (VFrame *src)
void copy_stacks (VFrame *src)
void copy_params (VFrame *src)
void clear_stacks ()
void dump_stacks ()
void dump_params ()

Static Public Member Functions

static int get_scale_tables (int *column_table, int *row_table, int in_x1, int in_y1, int in_x2, int in_y2, int out_x1, int out_y1, int out_x2, int out_y2)
static int calculate_bytes_per_pixel (int colormodel)
static long calculate_data_size (int w, int h, int bytes_per_line=-1, int color_model=BC_RGB888)
static void init_screen (int w, int h)
static unsigned int make_shader (int x,...)
static void dump_shader (int shader_id)

Private Member Functions

void create_pbuffer ()
int clear_objects (int do_opengl)
int reset_parameters (int do_opengl)
void create_row_pointers ()
int allocate_data (unsigned char *data, long y_offset, long u_offset, long v_offset, int w, int h, int color_model, long bytes_per_line)

Private Attributes

int field2_offset
int shared
long shm_offset
long bytes_per_line
int bytes_per_pixel
unsigned char * data
unsigned char ** rows
int color_model
long compressed_allocated
long compressed_size
unsigned char * y
unsigned char * u
unsigned char * v
long y_offset
long u_offset
long v_offset
int w
int h
unsigned char * image
long image_offset
long image_size
long sequence_number
int is_keyframe
BC_Texturetexture
BC_PBufferpbuffer
int opengl_state
ArrayList< char * > prev_effects
ArrayList< char * > next_effects
BC_Hashparams

Friends

class PngReadFunction

Detailed Description

Definition at line 20 of file vframe.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
UNKNOWN 
RAM 
TEXTURE 
SCREEN 

Definition at line 192 of file vframe.h.


Constructor & Destructor Documentation

VFrame::VFrame ( unsigned char *  data,
int  w,
int  h,
int  color_model = BC_RGBA8888,
long  bytes_per_line = -1 
)

Definition at line 57 of file vframe.C.

References allocate_data(), params, and reset_parameters().

Here is the call graph for this function:

VFrame::VFrame ( unsigned char *  data,
long  y_offset,
long  u_offset,
long  v_offset,
int  w,
int  h,
int  color_model = BC_RGBA8888,
long  bytes_per_line = -1 
)

Definition at line 68 of file vframe.C.

References allocate_data(), params, and reset_parameters().

Here is the call graph for this function:

VFrame::VFrame ( unsigned char *  png_data  ) 

Definition at line 41 of file vframe.C.

References params, read_png(), and reset_parameters().

Here is the call graph for this function:

VFrame::VFrame ( VFrame vframe  ) 

Definition at line 48 of file vframe.C.

References allocate_data(), bytes_per_line, color_model, copy_stacks(), data, h, memcpy, params, reset_parameters(), and w.

Here is the call graph for this function:

VFrame::VFrame (  ) 

Definition at line 89 of file vframe.C.

References BC_COMPRESSED, color_model, params, and reset_parameters().

Here is the call graph for this function:

VFrame::~VFrame (  ) 

Definition at line 106 of file vframe.C.

References clear_objects(), next_effects, params, prev_effects, and ArrayList< TYPE >::remove_all_objects().

Here is the call graph for this function:


Member Function Documentation

int VFrame::equivalent ( VFrame src,
int  test_stacks = 0 
)

Definition at line 115 of file vframe.C.

References bytes_per_line, equal_stacks(), get_color_model(), get_h(), and get_w().

Referenced by FrameCache::frame_exists(), and FieldFrame::process_buffer().

Here is the call graph for this function:

int VFrame::reallocate ( unsigned char *  data,
long  y_offset,
long  u_offset,
long  v_offset,
int  w,
int  h,
int  color_model,
long  bytes_per_line 
)

Definition at line 389 of file vframe.C.

References allocate_data(), clear_objects(), and reset_parameters().

Referenced by read_png().

Here is the call graph for this function:

void VFrame::set_memory ( unsigned char *  data,
long  y_offset,
long  u_offset,
long  v_offset 
)

Definition at line 360 of file vframe.C.

References create_row_pointers(), shared, u, v, and y.

Referenced by VDeviceX11::new_output_buffer().

Here is the call graph for this function:

void VFrame::set_compressed_memory ( unsigned char *  data,
int  data_size,
int  data_allocated 
)

Definition at line 376 of file vframe.C.

References clear_objects(), compressed_allocated, compressed_size, and shared.

Here is the call graph for this function:

int VFrame::read_png ( unsigned char *  data  ) 

Definition at line 436 of file vframe.C.

References BC_RGB888, BC_RGBA8888, get_h(), get_rows(), get_w(), h, image_offset, image_size, NULL, PngReadFunction::png_read_function(), reallocate(), and w.

Referenced by BC_Bitmap::BC_Bitmap(), and VFrame().

Here is the call graph for this function:

int VFrame::equals ( VFrame frame  ) 

Definition at line 533 of file vframe.C.

References data.

int VFrame::params_match ( int  w,
int  h,
int  color_model 
)

Definition at line 140 of file vframe.C.

Referenced by SvgMain::process_realtime(), File::read_frame(), and FileThread::run().

long VFrame::set_shm_offset ( long  offset  ) 

long VFrame::get_shm_offset (  ) 

Definition at line 130 of file vframe.C.

References shm_offset.

int VFrame::copy_from ( VFrame frame  ) 

Definition at line 666 of file vframe.C.

References allocate_compressed_data(), BC_COMPRESSED, BC_YUV420P, BC_YUV422P, calculate_data_size(), color_model, compressed_size, data, get_h(), get_u(), get_v(), get_w(), get_y(), h, memcpy, MIN, and w.

Referenced by Theme::build_button(), Theme::build_toggle(), VDeviceX11::close_all(), FadeEngine::do_fade(), ResourceThread::do_video(), PackageRenderer::do_video(), FrameCache::get_frame(), OverlayFrame::overlay(), ZoomBlurMain::process_buffer(), Reroute::process_buffer(), RadialBlurMain::process_buffer(), PerspectiveMain::process_buffer(), MotionMain::process_buffer(), LinearBlurMain::process_buffer(), InterpolatePixelsMain::process_buffer(), FreezeFrameMain::process_buffer(), Decimate::process_buffer(), ScaleMain::process_buffer(), MotionMain::process_global(), YUVEffect::process_realtime(), WhirlEffect::process_realtime(), WaveEffect::process_realtime(), VideoScopeEffect::process_realtime(), TranslateMain::process_realtime(), SharpenMain::process_realtime(), PolarEffect::process_realtime(), OilEffect::process_realtime(), MotionBlurMain::process_realtime(), IVTCMain::process_realtime(), DownSampleMain::process_realtime(), DelayVideo::process_realtime(), _1080to540Main::process_realtime(), MotionMain::process_rotation(), FileList::read_frame(), VAttachmentPoint::render(), RecordMonitorThread::render_uncompressed(), RotateFrame::rotate(), RecordVideo::run(), HoloMain::set_background(), and FileOGG::write_frames_theora().

Here is the call graph for this function:

int VFrame::clear_frame (  ) 

int VFrame::allocate_compressed_data ( long  bytes  ) 

long VFrame::get_number (  ) 

Definition at line 837 of file vframe.C.

References sequence_number.

Referenced by FileList::write_frames().

void VFrame::set_number ( long  number  ) 

Definition at line 832 of file vframe.C.

References sequence_number.

Referenced by PackageRenderer::do_video().

long VFrame::get_compressed_allocated (  ) 

long VFrame::get_compressed_size (  ) 

long VFrame::set_compressed_size ( long  size  ) 

int VFrame::get_color_model (  ) 

Definition at line 527 of file vframe.C.

References color_model.

Referenced by TimeAvgMain::add_accum(), SelTempAvgMain::add_accum(), HoloMain::add_frames(), FieldFrame::apply_field(), FrameField::average_rows(), BC_Pixmap::BC_Pixmap(), Decimate::calculate_difference(), BC_Capture::capture_frame(), clear_pbuffer(), VDeviceX11::close_all(), FFMPEG::convert_cmodel(), FFMPEG::convert_cmodel_transfer(), AssetPicon::create_objects(), RGB601Main::create_table(), DeInterlaceMain::deinterlace_avg(), DeInterlaceMain::deinterlace_avg_top(), DeInterlaceMain::deinterlace_bobweave(), DeInterlaceMain::deinterlace_swap(), DeInterlaceMain::deinterlace_temporalswap(), DeInterlaceMain::deinterlace_top(), CWindowCanvas::do_eyedrop(), Playback3D::do_fade_sync(), MaskUnit::do_feather(), MaskEngine::do_mask(), Playback3D::do_mask_sync(), DotClient::draw_dot(), Playback3D::draw_output(), MotionMain::draw_pixel(), EffectTV::effecttv_to_frame(), Playback3D::enable_overlay_texture(), FileYUV::ensure_temp(), equivalent(), FrameCache::frame_exists(), EffectTV::frame_to_effecttv(), VDeviceV4L::frame_to_vframe(), get_column(), get_row(), ThresholdMain::handle_opengl(), Overlay::handle_opengl(), DiffKey::handle_opengl(), EffectTV::image_bgset_y(), VModule::import_frame(), FFMPEG::init_picture_from_frame(), VRender::insert_timecode(), VDeviceX11::new_output_buffer(), VDeviceBUZ::new_output_buffer(), VDevice1394::new_output_buffer(), PluginVClient::new_temp(), overlay(), BC_Theme::overlay(), Theme::overlay(), OverlayFrame::overlay(), Playback3D::overlay_sync(), RotateEngine::perform_rotation(), BC_DragWindow::prepare_frame(), RGB601Main::process(), ZoomBlurMain::process_buffer(), TimeFrontMain::process_buffer(), RotateEffect::process_buffer(), Reroute::process_buffer(), PerspectiveMain::process_buffer(), MotionMain::process_buffer(), LiveVideo::process_buffer(), LinearBlurMain::process_buffer(), InvertVideoEffect::process_buffer(), InterpolateVideo::process_buffer(), InterpolatePixelsMain::process_buffer(), GradientMain::process_buffer(), FreezeFrameMain::process_buffer(), FrameField::process_buffer(), FlipMain::process_buffer(), FieldFrame::process_buffer(), DeInterlaceMain::process_buffer(), Decimate::process_buffer(), ScaleMain::process_buffer(), _720to480Main::process_loop(), ZoomBlurUnit::process_package(), WhirlUnit::process_package(), WaveUnit::process_package(), VideoScopeUnit::process_package(), UnsharpUnit::process_package(), TitleTranslateUnit::process_package(), ThresholdUnit::process_package(), RadialBlurUnit::process_package(), PolarUnit::process_package(), OilUnit::process_package(), MotionBlurUnit::process_package(), RotateScanUnit::process_package(), MotionScanUnit::process_package(), AffineUnit::process_package(), LinearBlurUnit::process_package(), IVTCUnit::process_package(), InterpolatePixelsUnit::process_package(), HueUnit::process_package(), HoloClient::process_package(), HistogramUnit::process_package(), GradientUnit::process_package(), GammaUnit::process_package(), DownSampleUnit::process_package(), DotClient::process_package(), DiffKeyClient::process_package(), ChromaKeyUnit::process_package(), BurnClient::process_package(), BrightnessUnit::process_package(), AgingClient::process_package(), BlendUnit::process_package(), ScaleTranslateUnit::process_package(), TranslateUnit::process_package(), ScaleUnit::process_package(), MaskUnit::process_package(), FadeUnit::process_package(), YUVEffect::process_realtime(), WipeMain::process_realtime(), WhirlEffect::process_realtime(), WaveEffect::process_realtime(), TranslateMain::process_realtime(), SwapMain::process_realtime(), SvgMain::process_realtime(), SlideMain::process_realtime(), ShapeWipeMain::process_realtime(), SharpenMain::process_realtime(), PolarEffect::process_realtime(), OilEffect::process_realtime(), MotionBlurMain::process_realtime(), IVTCMain::process_realtime(), IrisSquareMain::process_realtime(), HoloMain::process_realtime(), FlashMain::process_realtime(), DenoiseVideo::process_realtime(), BurnMain::process_realtime(), BandWipeMain::process_realtime(), BandSlideMain::process_realtime(), _1080to540Main::process_realtime(), put_column(), BC_Bitmap::read_frame(), FileYUV::read_frame(), FileThread::read_frame(), FilePNG::read_frame(), FileOGG::read_frame(), FileMPEG::read_frame(), FileMOV::read_frame(), FileList::read_frame(), FileJPEGList::read_frame(), FileJPEG::read_frame(), FileEXR::read_frame(), FileDV::read_frame(), FileCR2::read_frame(), FileAVI::read_frame(), File::read_frame(), FileMOV::read_raw(), FileTGA::read_tga(), _720to480Main::reduce_field(), _1080to540Main::reduce_field(), VAttachmentPoint::render(), RecVideoDVThread::render_frame(), RecVideoMJPGThread::render_frame(), RotateFrame::rotate_obliqueangle(), RotateFrame::rotate_rightangle(), SharpenEngine::run(), ColorBalanceEngine::run(), BlurEngine::run(), FileMOVThread::run(), screen_to_texture(), SetChannelsCanvas::SetChannelsCanvas(), ShiftInterlaceMain::shift_row(), TimeAvgMain::subtract_accum(), SelTempAvgMain::subtract_accum(), HistogramMain::tabulate_curve(), to_texture(), TimeAvgMain::transfer_accum(), SelTempAvgMain::transfer_accum(), VDeviceX11::write_buffer(), VDeviceLML::write_buffer(), VDeviceBUZ::write_buffer(), RecordMonitorThread::write_frame(), FileTIFF::write_frame(), FilePNG::write_frame(), FileJPEGList::write_frame(), FileJPEG::write_frame(), FileEXR::write_frame(), FileYUV::write_frames(), FileMPEG::write_frames(), FileMOV::write_frames(), FileDV::write_frames(), FileOGG::write_frames_theora(), and FileTGA::write_tga().

unsigned char * VFrame::get_data (  ) 

unsigned char ** VFrame::get_rows (  ) 

Definition at line 788 of file vframe.C.

References rows.

Referenced by FieldFrame::apply_field(), BC_Capture::capture_frame(), FFMPEG::convert_cmodel(), FFMPEG::convert_cmodel_transfer(), Playback3D::copy_from_sync(), PaletteWheel::create_objects(), AssetPicon::create_objects(), ResourceThread::do_video(), PaletteWheelValue::draw(), TitleUnit::draw_glyph(), VDeviceV4L::frame_to_vframe(), get_column(), BC_Theme::overlay(), Theme::overlay(), BC_DragWindow::prepare_frame(), PerspectiveMain::process_buffer(), LiveVideo::process_buffer(), FrameField::process_buffer(), ChromaKeyUnit::process_chromakey(), UnsharpUnit::process_package(), RotateScanUnit::process_package(), MotionScanUnit::process_package(), InterpolatePixelsUnit::process_package(), HoloClient::process_package(), DotClient::process_package(), BurnClient::process_package(), AgingClient::process_package(), BlendUnit::process_package(), ScaleTranslateUnit::process_package(), MaskUnit::process_package(), FadeUnit::process_package(), YUVEffect::process_realtime(), WhirlEffect::process_realtime(), WaveEffect::process_realtime(), VideoScopeEffect::process_realtime(), TranslateMain::process_realtime(), SvgMain::process_realtime(), SharpenMain::process_realtime(), PolarEffect::process_realtime(), OilEffect::process_realtime(), MotionBlurMain::process_realtime(), IVTCMain::process_realtime(), DownSampleMain::process_realtime(), BlurMain::process_realtime(), put_column(), BC_Bitmap::read_frame(), FileTIFF::read_frame(), FileThread::read_frame(), FilePNG::read_frame(), FileOGG::read_frame(), FileMPEG::read_frame(), FileMOV::read_frame(), FileList::read_frame(), FileJPEGList::read_frame(), FileJPEG::read_frame(), FileEXR::read_frame(), FileDV::read_frame(), FileCR2::read_frame(), File::read_frame(), read_png(), FileMOV::read_raw(), FileTGA::read_tga(), VideoScopeUnit::render_data(), ThresholdUnit::render_data(), RecVideoMJPGThread::render_frame(), FileMOVThread::run(), to_ram(), to_texture(), px_type< TYPE, COMPONENTS >::transfer(), VDeviceX11::write_buffer(), VDeviceBUZ::write_buffer(), FileTIFF::write_frame(), FilePNG::write_frame(), FileJPEGList::write_frame(), FileJPEG::write_frame(), FileEXR::write_frame(), FileMPEG::write_frames(), FileMOV::write_frames(), FileDV::write_frames(), FileOGG::write_frames_theora(), and FileTGA::write_tga().

unsigned char * VFrame::get_y (  ) 

unsigned char * VFrame::get_u (  )