Re: [R] [OT] two question about color space.

2009-03-16 Thread Thomas Lumley
The XYZ to RGB conversion is already in convertColor(), and also in the colorspace package. -thomas On Sun, 15 Mar 2009, baptiste auguie wrote: I've put together a rough R port of that C code [*] in a package on r-forge:

Re: [R] [OT] two question about color space.

2009-03-16 Thread baptiste auguie
Thanks for pointing this out, i did check the available packages before dwelling on this but i was focussed on the first part of the problem (spectrum to xyz). The available convertColor() function is especially welcome that it was the most inefficient part of the code I produced yesterday.

Re: [R] [OT] two question about color space.

2009-03-16 Thread Jinsong Zhao
Thanks for pointing this out, i did check the available packages before dwelling on this but i was focussed on the first part of the problem (spectrum to xyz). The available convertColor() function is especially welcome that it was the most inefficient part of the code I produced yesterday.

Re: [R] [OT] two question about color space.

2009-03-15 Thread baptiste auguie
I've put together a rough R port of that C code [*] in a package on r- forge: http://r-forge.r-project.org/plugins/scmsvn/viewcvs.php/pkg/spectral/?root=photonics http://r-forge.r-project.org/R/?group_id=160 ( package spectral, will be built overnight ) There is a lot of optimization and

[R] [OT] two question about color space.

2009-03-14 Thread Jinsong Zhao
Hi there, I try to plot visible light spectrum (380nm~780nm) with color corresponding to the specific wavelength. However, I don't find a function that could do this. Another question, it's possible to plot a color space chromaticity diagram like this:

Re: [R] [OT] two question about color space.

2009-03-14 Thread baptiste auguie
Hi, For a good discussion of the link between colour and spectra I would suggest, http://www.fourmilab.ch/documents/specrend/ which provides an open-source C code to perform the conversion you ask for. I asked for some advice on how to wrap a R function around this code last week but

Re: [R] [OT] two question about color space.

2009-03-14 Thread Jinsong Zhao
Hi, For a good discussion of the link between colour and spectra I would suggest, http://www.fourmilab.ch/documents/specrend/ which provides an open-source C code to perform the conversion you ask for. I asked for some advice on how to wrap a R function around this code last week but

Re: [R] [OT] two question about color space.

2009-03-14 Thread baptiste auguie
On 14 Mar 2009, at 13:08, Jinsong Zhao wrote: Hi, For a good discussion of the link between colour and spectra I would suggest, http://www.fourmilab.ch/documents/specrend/ which provides an open-source C code to perform the conversion you ask for. I asked for some advice on how to wrap a

Re: [R] [OT] two question about color space.

2009-03-14 Thread Jinsong Zhao
if you don't mind about the efficiency of your program, just use ? sapply on a range of wavelengths. I'm not particularly keen on the implementation of the FORTRAN program you used compared to the one I suggested, it seems like a very crude convolution. Thank you very much for your