📄 padrgbtomakepowof2.m
字号:
% % if required then add padvalue (defualt 0)
% % to make size of rgbimg power of 2.
% % e.g. if initiall size of rgbimg is 7x5x3
% % the after padding, size of rgbimg would be
% % 8x8x3
function rgbimgnew =padrgbtomakepowof2(rgbimg,varargin)
% % % Default Values
padvalue=0;
defaultValues = {padvalue};
% % % Assign Values
nonemptyIdx = ~cellfun('isempty',varargin);
defaultValues(nonemptyIdx) = varargin(nonemptyIdx);
[padvalue] = deal(defaultValues{:});
% % % --------------
IR=padtomakepowof2(rgbimg(:,:,1),padvalue);
IG=padtomakepowof2(rgbimg(:,:,2),padvalue);
IB=padtomakepowof2(rgbimg(:,:,3),padvalue);
rgbimgnew(:,:,1)=IR;
rgbimgnew(:,:,2)=IG;
rgbimgnew(:,:,3)=IB;
% % -------------------------------------------------------------------------
% % This program or any other program(s) supplied with it does not provide any
% % warranty direct or implied. This program is free to use/share for
% % non-commercial purpose only, for any other usage contact with author.
% % Kindly reference author.
% % Thanking you.
% % @ Copyright M Khan
% % Email: mak2000sw@yahoo.com
% % mak2000@GameBox.net
% % http://www.geocities.com/mak2000sw
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -