[Index for tmp_for_tar/imgio]
[Return to Master Index]
gray2rgb
(tmp_for_tar/imgio/gray2rgb.m)
Function Synopsis
rgb = gray2rgb( gr )
Help text
rgb = gray2rgb( gr ) - convert graylevel to rgb
Convert a graylevel pixmap or image structure to rgb
gr : H x W or image structure
rgb : H x 3W or image structure
Last modified: Setembro 2002
Listing of function file tmp_for_tar/imgio/gray2rgb.m
## rgb = gray2rgb( gr ) - convert graylevel to rgb
##
## Convert a graylevel pixmap or image structure to rgb
##
## gr : H x W or image structure
## rgb : H x 3W or image structure
## Author: Etienne Grossmann <etienne@isr.ist.utl.pt>
## Last modified: Setembro 2002
function rgb = gray2rgb( gr )
if ! is_struct (gr),
rgb = kron (gr, [1,1,1]);
else # Don't convert rgb ims
if ! gr.rgb,
if ! struct_contains(gr,"colormap"),
rgb.im = gray2rgb (gr.im) ;
else
rgb.im = colorize (gr.im, gr.colormap);
end
else
rgb.im = gr.im ;
end
rgb.rgb = 1 ;
rgb.maxval = gr.maxval;
end
Produced by oct2html on Sat Sep 14 9:47:03 2002
Cross-Directory links are: ON