Home > chronux > fly_track > videoIO > videoIO_2006b > @videoReader > step.m

step

PURPOSE ^

WORKED=STEP(VR,DELTA)

SYNOPSIS ^

function fn = step(vr, delta)

DESCRIPTION ^

WORKED=STEP(VR,DELTA)
  Moves the frame counter by DELTA frames for video VR.  This is a 
  generalization of NEXT.  Returns 0 on an unsuccessful STEP.  Note that 
  not all plugins support stepping, especially with negative numbers.  In 
  the following example, both IM1 and IM2 should be the same for most 
  plugins.
    vr = videoReader(...myurl...);
    if (~next(vr)), error('couldn''t read first frame'); end
    im1 = getframe(vr);
    if (~step(vr,-1)), error('could not step back to frame 0'); end
    im2 = getframe(vr);
    if (any(im1 ~= im2)), 
      error('first frame and frame 0 are not the same'); 
    end
    vr = close(vr);
  FNUM should be an integer.

  After the videoReader constructor is called, NEXT, SEEK, or STEP should
  be called at least once before GETFRAME is called. 

  See videoReader/getinfo for more details on how many frames can be read
  from a video. 

SEE ALSO
  videoReader

Copyright (c) 2006 Gerald Dalley
See "MIT.txt" in the installation directory for licensing details (especially
when using this library on GNU/Linux).

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function fn = step(vr, delta)
0002 %WORKED=STEP(VR,DELTA)
0003 %  Moves the frame counter by DELTA frames for video VR.  This is a
0004 %  generalization of NEXT.  Returns 0 on an unsuccessful STEP.  Note that
0005 %  not all plugins support stepping, especially with negative numbers.  In
0006 %  the following example, both IM1 and IM2 should be the same for most
0007 %  plugins.
0008 %    vr = videoReader(...myurl...);
0009 %    if (~next(vr)), error('couldn''t read first frame'); end
0010 %    im1 = getframe(vr);
0011 %    if (~step(vr,-1)), error('could not step back to frame 0'); end
0012 %    im2 = getframe(vr);
0013 %    if (any(im1 ~= im2)),
0014 %      error('first frame and frame 0 are not the same');
0015 %    end
0016 %    vr = close(vr);
0017 %  FNUM should be an integer.
0018 %
0019 %  After the videoReader constructor is called, NEXT, SEEK, or STEP should
0020 %  be called at least once before GETFRAME is called.
0021 %
0022 %  See videoReader/getinfo for more details on how many frames can be read
0023 %  from a video.
0024 %
0025 %SEE ALSO
0026 %  videoReader
0027 %
0028 %Copyright (c) 2006 Gerald Dalley
0029 %See "MIT.txt" in the installation directory for licensing details (especially
0030 %when using this library on GNU/Linux).
0031 
0032 fn = feval(vr.plugin, 'step', vr.handle, delta);
0033

Generated on Fri 28-Sep-2012 12:34:30 by m2html © 2005