help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Modify image.m to use bmpwrite.m on Mac OS X?


From: Paul Kienzle
Subject: Re: Modify image.m to use bmpwrite.m on Mac OS X?
Date: Thu, 24 Jun 2004 19:49:35 -0400

On the HPC build of octave 2.1.55, colormap returns the last colormap
set.  Try for example,

        colormap
        colormap(hot)
        colormap

There is a global variable for the current colormap, but please don't use it.

If you are writing a function which takes a colormap parameter,
be sure to say:

        c = colormap; colormap(newc);
        ...
        colormap(c);

Strictly speaking, you should be using unwind protect

        c = colormap;
        unwind_protect
                colormap(newc);
                ...
        unwind_protect_cleanup
                colormap(c);
        end

Paul Kienzle
address@hidden

On Jun 24, 2004, at 12:55 PM, Joe Koski wrote:

OK, I got my bmpwrite version image.m to work. I was not appending the .bmp extension to my tmpnam(), and Preview didn't want to open an unidentified
format. What I'm missing now is a way to pass the correct colormap to
image.m and then to bmpwrite. I tried getting

  colors=colormap();

in image.m which the help files says returns the current colormap, but it looks like I got the default gray scale instead. Is there an octave variable
that can be referenced to obtain the currently set colormap within a
function? Thanks.



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]