📄 pcxread.m
字号:
function [X,map]=pcxread(filename);
%PCXREAD Read a PCX (ZSoft Paint Format) file from disk.
% Note: PCXREAD has been grandfathered; use IMREAD instead.
%
% [X,MAP]=PCXREAD('filename') reads the file 'filename' and returns
% the indexed image X and associated colormap MAP. The image
% is not displayed. If no extension is given for the filename,
% the extension '.pcx' is assumed.
%
% Note: Only 256 color PCX files are supported.
%
% See also IMFINFO, IMREAD, IMWRITE.
% Mounil Patel 7/20/93
% updated to call IMREAD by Chris Griffin 8/15/96
% Copyright 1993-1998 The MathWorks, Inc. All Rights Reserved.
% $Revision: 5.6 $ $Date: 1997/11/24 15:36:03 $
if (nargin~=1)
error('Requires a filename as an argument.');
end;
if (isstr(filename)~=1)
error('Requires a string filename as an argument.');
end;
if (isempty(findstr(filename,'.'))==1)
filename=[filename,'.pcx'];
end;
[info,msg] = imfinfo(filename,'pcx');
if ~isempty(msg),
error(msg);
end
[X,map] = imread(filename, 'pcx');
if isempty(map) & ndims(X)==3 % RGB Truecolor image
error('pcxread doesn''t read 24 bit PCX image files, use IMREAD instead');
end
X=double(X)+1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -