Home > polypedal > video > srcCollectRAttr.m

srcCollectRAttr

PURPOSE ^

strCollectAttr collect frame attribute from a framesource

SYNOPSIS ^

function attr = srcCollectAttr( src, varargin )

DESCRIPTION ^

strCollectAttr collect frame attribute from a framesource

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function attr = srcCollectAttr( src, varargin )
0002 
0003 %strCollectAttr collect frame attribute from a framesource
0004 
0005 %  attr = srcCollectAttr( src, attrnames... )
0006 
0007 %    src -- frame source
0008 
0009 %    attrnames -- names of attributes
0010 
0011 %    attr -- struct with fields corresponding to the attributes
0012 
0013 
0014 
0015   if ischar(src)
0016 
0017       src = evalin(src,'caller');
0018 
0019   end
0020 
0021   sdcr = srcGetDcr(src);
0022 
0023   for k=1:sdcr.N
0024 
0025       imgs = srcGetFr( src, k );
0026 
0027       res = struct;
0028 
0029       for fi=1:length(varargin)
0030 
0031         fn = varargin{fi};
0032 
0033         res = setfield( res, fn, getfield( imgs{end}.imgs(1), fn ) );
0034 
0035       end
0036 
0037       attr(k)=res;
0038 
0039   end

Generated on Mon 02-Aug-2010 16:44:38 by m2html © 2003