![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <39a1d84c@news.povray.org>, "Halbert" <hha### [at] capital net>
wrote:
> Psuedocode plagerized from Computer Graphics and Principals 2nd Edition:
...snip...
> This should be easily converted into a macro (assumming I haven't
> made too many typing errors.)
Whee, Pascal...the last time I read Pascal I was trying to convert a
demo program written in it to C. It was surprisingly easy, actually...
Here is an untested attempt at a straight conversion to POV:
#macro RGB2HSV(RGB)
#local Max = max(RGB.r, max(RGB.g, RGB.b));
#local Min = min(RGB.r, min(RGB.g, RGB.b));
#local V = Max;
#if(Max != 0)
#local S = (Max - Min)/Max;
#else
#local S = 0;
#end
#if(S = 0)
#local H = 0;
#else
#local Delta = Max - Min;
#if(RGB.r = Max)
#local H = (RGB.g - RGB.b)/Delta;
#else
#if(RGB.g = Max)
#local H = 2 + (RGB.b - RGB.r)/Delta;
#else
#if(RGB.b = Max)
#local H = 4 + (RGB.r - RGB.g)/Delta;
#end
#end
#end
#local H = H*60;
#if(H < 0)
#local H = H + 360;
#end
#end
(< H, S, V>)
#end
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Chris Huff wrote:
> In article <39A1A7FA.53ED54C8@faricy.net>, David Fontaine
> <dav### [at] faricy net> wrote:
>
> > I wrote a macro to do RGB<->HLS...
>
> And I have it on my system. :-)
> I just haven't reverse engineered it and written a POV conversion
> function yet. And it only takes care of one color space.
I know... The only others I know of are CMYK and spectra, what is HSV?
--
David Fontaine <dav### [at] faricy net> ICQ 55354965
Please visit my website: http://davidf.faricy.net/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
David Fontaine wrote:
> I know... The only others I know of are CMYK and spectra, what is HSV?
http://www.inforamp.net/~poynton/Poynton-colour.html
--
Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Chris Huff wrote:
>
> In article <39A1A7FA.53ED54C8@faricy.net>, David Fontaine
> <dav### [at] faricy net> wrote:
>
> > I wrote a macro to do RGB<->HLS...
>
> And I have it on my system. :-)
> I just haven't reverse engineered it and written a POV conversion
> function yet. And it only takes care of one color space.
>
> --
> Christopher James Huff
I've written conversion between RGB and HSV, HSL XYZ, xyY, YIQ color
spaces as C function in colour.c. (I've not tested it very much, hope I
haven't made too much mistakes in entering marrix constants). If someone
wants to add coversion support for POV-Ray language, then I can send
source code.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Ken wrote:
> David Fontaine wrote:
>
> > I know... The only others I know of are CMYK and spectra, what is HSV?
>
> http://www.inforamp.net/~poynton/Poynton-colour.html
>
> --
> Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
> http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/
Man, a person could spend their entire life studying color! I looked in my
encyclopedia too and found several pages on the Purkinje shift and
Bezold-Brucke effect, simultaneous and successive chromatic adaption,
tristimulus, etc, even the human brain's adjustments in percieved color and
color psychology...
--
David Fontaine <dav### [at] faricy net> ICQ 55354965
Please visit my website: http://davidf.faricy.net/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <39A2221F.B8F2E0D2@aetec.ee>, Vahur Krouverk
<vah### [at] aetec ee> wrote:
> I've written conversion between RGB and HSV, HSL XYZ, xyY, YIQ color
> spaces as C function in colour.c. (I've not tested it very much, hope I
> haven't made too much mistakes in entering marrix constants). If someone
> wants to add coversion support for POV-Ray language, then I can send
> source code.
Sounds interesting...could you post the conversion functions to
povray.programming or povray.binaries.programming?
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Go to my raytracing page at:
http://www.crosswinds.net/~robertsc/raytrac2.htm . I have a link
for converting from RGB to spectra there.
Remco Poelstra wrote:
>
> Hi,
>
> I saw in a message from Peter Popov in reply to Feature request for
> pov3.5 (08/09/00 16:55), that rgb can be converted to spectra. That's
> what I need., since I want to convert the rgb value to a corresponding
> audio frequentie, and audio is spectra. Where can I find more
> information on doing so? (I'm a newbie on complex math, so it should be
> a little bit easy explained.)
>
> Remco Poelstra
--
See my Free stuff page. It compares free website providers, and
lists free internet access providers.
http://www.crosswinds.net/~robertsc/free.htm
Win98 help file loaded with hints and tips, including securing a
Win 95/98 PC in a classroom setting. VB4 help file with lots of
code and hints.
At http://www.crosswinds.net/~robertsc/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Chris Huff wrote:
>
> In article <39A2221F.B8F2E0D2@aetec.ee>, Vahur Krouverk
> <vah### [at] aetec ee> wrote:
>
> > I've written conversion between RGB and HSV, HSL XYZ, xyY, YIQ color
> > spaces as C function in colour.c. (I've not tested it very much, hope I
> > haven't made too much mistakes in entering marrix constants). If someone
> > wants to add coversion support for POV-Ray language, then I can send
> > source code.
>
> Sounds interesting...could you post the conversion functions to
> povray.programming or povray.binaries.programming?
>
Ok, I'll do it after I complete this message.
povray.binaries.programming will be the group. I've made tests for
ensuring their correctness and I believe, that HSV, HSL and YIQ
conversions are correct (at least BMRT gave same output). Hopefully XYZ
and xyY are correct too, as they involve only matrix multiplication.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <39A62132.B898A45A@aetec.ee>, Vahur Krouverk
<vah### [at] aetec ee> wrote:
> Ok, I'll do it after I complete this message.
> povray.binaries.programming will be the group. I've made tests for
> ensuring their correctness and I believe, that HSV, HSL and YIQ
> conversions are correct (at least BMRT gave same output). Hopefully XYZ
> and xyY are correct too, as they involve only matrix multiplication.
I downloaded it and will take a look at these. It would also help if you
had a link to pages explaining what they *are*, but I can probably find
that somewhere myself...do the XYZ and xyZ ones use a color matrix
similar to my post_process filter?
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Remco Poelstra wrote:
>
> All right, I'll, but what is hue exactly? I thought it's the 'rotation'
> of the colorcircle.
You're right. And as the rotation (or angle) in the colorcircle it
corresponds directly to frequency.
Markus
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |