Code covered by the BSD License  

Highlights from
Gamma Adjustment GUI

image thumbnail
from Gamma Adjustment GUI by Eric Johnson
RGBGUI is an interactive gamma adjustment tool for grayscale and RGB (true color) images.

rgbgui.bgChannelSelect(h,e)
function bgChannelSelect(h,e)
%BGCHANNELSELECT Switches color channels.

% Copyright 2010 The MathWorks, Inc.

data = guidata(h);

hSelected = get(h,'SelectedObject');
switch hSelected 
    case data.rbRed
        k = 1;
    case data.rbGreen
        k = 2;
    case data.rbBlue
        k = 3;
    case data.rbGray
        k = 1;
end
data.k = k;
guidata(h,data);

rgbgui.adjGamma(h,e);

Contact us