Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0838e25
commit 52ecadf
Showing
6 changed files
with
46 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
function outflag = hasipt() | ||
% FLAG = HASIPT() | ||
% Check whether the current installation has Image Processing Toolbox installed. | ||
% State is persistent to reduce cost of repeated calls. | ||
% Output is a logical scalar. | ||
|
||
% for testing purposes | ||
enable = true; | ||
|
||
persistent hasIPT | ||
if isempty(hasIPT) | ||
hasIPT = license('test', 'image_toolbox'); | ||
end | ||
|
||
if enable | ||
outflag = hasIPT; | ||
else | ||
outflag = false; %#ok<UNRCH> | ||
quietwarning('HASIPT(): license checking is disabled for testing!') | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function yeahitis = isimageclass(inpict) | ||
% ISIMAGECLASS(INPICT) | ||
% Check if an array is of a standard image class. | ||
% Returns true for the following datatypes: | ||
% 'double','single','uint8','uint16','int16','logical' | ||
% | ||
% See also: ismono, issolidcolor, isopaque | ||
|
||
% yes, ~isempty(find(strcmp())) is faster than ismember() | ||
% about 50x as fast in R2009b; about 2x-4x as fast in R2015b | ||
% it's also very slightly faster than any(strcmp()) or summation in newer versions | ||
yeahitis = strismember(class(inpict),{'double','single','uint8','uint16','int16','logical'}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
function quietwarning(varargin) | ||
% QUIETWARNING(MESSAGE) | ||
% Print a simple warning message with backtrace momentarily disabled. | ||
% That's all this does; other functionality of warning() not supported. | ||
|
||
S = warning('query','backtrace'); | ||
warning off backtrace | ||
warning(varargin{:}) | ||
warning(S.state,'backtrace') |