function [portLabels hwnd] = vipiowvo(action,varargin) %#ok
% VIPIOWVO Mask helper function for To Video Display block

% Copyright 1995-2006 The MathWorks, Inc.
% $Revision: 1.1.6.1 $ $Date: 2010/08/30 03:23:18 $

blk = gcbh;
if nargin==0, action='dynamic'; end

switch action
    case 'init'
        portLabels = struct([]);
        oldVerObsolete = strcmp(get_param(blk, 'inputType'), 'Obsolete') == 1;
        if (oldVerObsolete)
            isSinglePort = strcmp(get_param(blk, 'imagePorts'), 'One multidimensional signal') == 1;
        else
            isSinglePort = strcmp(get_param(blk, 'inputType'), 'Intensity') == 1;
        end
        inputColorFormat = get_param(blk, 'inputColorFormat');
        if strcmp(inputColorFormat, 'RGB')
            if isSinglePort
                [portLabels(1:3).port] = deal(1,1,1);
                [portLabels(1:3).txt]  = deal('Image','','');
            else
                [portLabels(1:3).port] = deal(1,2,3);
                [portLabels(1:3).txt]  = deal('R','G','B');
            end
        else % YCbCr 4:2:2
            [portLabels(1:3).port] = deal(1,2,3);
            [portLabels(1:3).txt]  = deal('Y','Cb','Cr');            
        end
end
end
