function mat = PasteImage
% mat = PasteImage
% 
% Paste the clipboard into matrix mat. The clipboard should contain a PICT.
% "mat" will have dimensions mxnx3. The values are integer pixels, [0 255], as 
% used by Screen 'PutImage' and 'GetImage'.
% 
% Also see CopyImage and Screen 'PutImage' and 'GetImage'.

% BUG & WORK AROUND:
% As of 5/5/02, Neither we nor Geoff Loftus can replicate this bug report. There no
% longer seems to be any problem.
% 
% PasteImage fails with some, but not all, images copied to the clipboard
% from Adobe Photoshop. Copying the image from the clipboard into another
% application (e.g. Microsoft Word) and then from that application to the
% clipboard, usually works. (Guessing as to the cause, it's possible that
% Photoshop is embedding the picture's ICC profile into the picture's
% comment, making the picture odd in a way that PasteImage ought to but
% doesn't cope with, and that Word is stripping the profile out. Embedding
% the ICC profile is generally considered a good thing, enhancing the
% reproducibility of the image, but, if this diagnosis is right,
% PasteImage isn't coping with it.) Reported by Geoff Loftus 8/1/00.

% 8/19/94		dhb		Link in new pixmap handling code.
% 8/4/00		dgp		Mention Photoshop-related bug, and tentative diagnosis.
