function ret=gotframe(timage)
%
% IVCCLIB: Intel Video Capture Card Library
% Written by Jeff Norris, jnorris@alum.mit.edu
%
% File: gotframe.m
%
% Description: This file is a template matlab IVCC callback.  
% When the command attachgrabber(0,'gotframe') is executed, images
% from grabber 0 are passed into this function as they become
% available.  A good way to get started is to start filling in code
% in this callback.  Untouched, it displays the images it is passed.
%

% LEAVE THE FOLLOWING 3 LINES OF CODE ALONE- THEY ALLOW IVCCLIB
% TO ERROR-CHECK YOUR CODE BEFORE STARTING THE OBSERVER
if (timage==-1)
  return;
end
%

try

% Put your callback code here
image(timage); % display the image
drawnow; % force image update

% You probably don't need to edit any code past this point
catch
disp('Last error caught:')
lasterr
return
end
