time | Calls | line |
---|
| | 185 | function data = leavingCell(iCell, data, doCapture)
|
| | 186 |
|
| | 187 | % Leave a divider in the output stream.
|
0.001 | 5 | 188 | fprintf('%s%iZ%iX',data.marker,iCell,data.counter())
|
| | 189 |
|
< 0.001 | 5 | 190 | if doCapture
|
< 0.001 | 5 | 191 | for iPlugins = 1:numel(data.plugins)
|
0.070 | 10 | 192 | if data.plugins(iPlugins).check() && ...
|
| 5 | 193 | (exist(data.plugins(iPlugins).classname,'class') == 8)
|
< 0.001 | 5 | 194 | if isempty(data.plugins(iPlugins).instance)
|
| | 195 | data.plugins(iPlugins).instance = feval(data.plugins(iPlugins).classname,data.options);
|
| | 196 | end
|
0.087 | 5 | 197 | newFiles = data.plugins(iPlugins).instance.leavingCell(iCell);
|
< 0.001 | 5 | 198 | for iNewFiles = 1:numel(newFiles)
|
| | 199 | if isfield(data,'append')
|
| | 200 | % Undocumented prototype code for creating animated GIFs.
|
| | 201 | X = imread(newFiles{iNewFiles});
|
| | 202 | delete(newFiles{iNewFiles})
|
| | 203 | [im,map] = rgb2ind(X,512,'nodither');
|
| | 204 | gifExists = numel(data.pictureList) > 0 && ...
|
| | 205 | ~isempty(regexp(data.pictureList{end},'\.gif$','once'));
|
| | 206 | if gifExists
|
| | 207 | if isinf(data.append)
|
| | 208 | imwrite(im,map,data.pictureList{end},'gif', ...
|
| | 209 | 'WriteMode','append');
|
| | 210 | else
|
| | 211 | imwrite(im,map,data.pictureList{end},'gif', ...
|
| | 212 | 'WriteMode','append','DelayTime',data.append);
|
| | 213 | end
|
| | 214 | else
|
| | 215 | newFilename = regexprep(newFiles{iNewFiles},'\.\w+$','.gif');
|
| | 216 | imwrite(im,map,newFilename,'gif','LoopCount',Inf);
|
| | 217 | data.pictureList{end+1} = newFilename;
|
| | 218 | data.placeList(end+1) = iCell;
|
| | 219 | data.placeList(end+1) = data.counter();
|
| | 220 | end
|
| | 221 | else
|
| | 222 | data.pictureList{end+1} = newFiles{iNewFiles};
|
| | 223 | data.placeList(end+1) = iCell;
|
| | 224 | data.placeList(end+1) = data.counter();
|
| | 225 | end
|
| | 226 | end
|
< 0.001 | 5 | 227 | end
|
< 0.001 | 10 | 228 | end
|
< 0.001 | 5 | 229 | end
|
| | 230 |
|
< 0.001 | 5 | 231 | end
|
Other subfunctions in this file are not included in this listing.