2020-10-05 18:00:05 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
< html >
< head >
< meta http-equiv = "content-type" content = "text/html; charset=UTF-8" >
< title > Mu - apps/raytracing/color.mu< / title >
< meta name = "Generator" content = "Vim/8.1" >
< meta name = "plugin-version" content = "vim8.1_v1" >
< meta name = "syntax" content = "none" >
< meta name = "settings" content = "number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=" >
< meta name = "colorscheme" content = "minimal-light" >
< style type = "text/css" >
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #c6c6c6; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #c6c6c6; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.muComment { color: #005faf; }
.LineNr { }
.SpecialChar { color: #d70000; }
.Delimiter { color: #c000c0; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Constant { color: #008787; }
.PreProc { color: #c000c0; }
-->
< / style >
< script type = 'text/javascript' >
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
function JumpToLine()
{
var lineNum;
lineNum = window.location.hash;
lineNum = lineNum.substr(1); /* strip off '#' */
if (lineNum.indexOf('L') == -1) {
lineNum = 'L'+lineNum;
}
var lineElem = document.getElementById(lineNum);
/* Always jump to new location even if the line was hidden inside a fold, or
* we corrected the raw number to a line ID.
*/
if (lineElem) {
lineElem.scrollIntoView(true);
}
return true;
}
if ('onhashchange' in window) {
window.onhashchange = JumpToLine;
}
-->
< / script >
< / head >
< body onload = 'JumpToLine();' >
< a href = 'https://github.com/akkartik/mu/blob/master/apps/raytracing/color.mu' > https://github.com/akkartik/mu/blob/master/apps/raytracing/color.mu< / a >
< pre id = 'vimCodeElement' >
2020-11-17 04:44:02 +00:00
< span id = "L1" class = "LineNr" > 1 < / span > < span class = "PreProc" > type< / span > rgb < span class = "Delimiter" > {< / span >
2020-10-05 18:00:05 +00:00
< span id = "L2" class = "LineNr" > 2 < / span > < span class = "muComment" > # components normalized to within [0.0, 1.0]< / span >
< span id = "L3" class = "LineNr" > 3 < / span > r: float
< span id = "L4" class = "LineNr" > 4 < / span > g: float
< span id = "L5" class = "LineNr" > 5 < / span > b: float
< span id = "L6" class = "LineNr" > 6 < / span > < span class = "Delimiter" > }< / span >
< span id = "L7" class = "LineNr" > 7 < / span >
< span id = "L8" class = "LineNr" > 8 < / span > < span class = "muComment" > # print translating to [0, 256)< / span >
2020-11-17 04:44:02 +00:00
< span id = "L9" class = "LineNr" > 9 < / span > < span class = "PreProc" > fn< / span > < span class = "muFunction" > print-rgb< / span > < a href = '../../405screen.mu.html#L9' > screen< / a > : (addr < a href = '../../405screen.mu.html#L9' > screen< / a > ), _c: (addr rgb) < span class = "Delimiter" > {< / span >
< span id = "L10" class = "LineNr" > 10 < / span > < span class = "PreProc" > var< / span > c/< span class = "Constant" > esi< / span > : (addr rgb) < span class = "SpecialChar" > < -< / span > copy _c
2020-11-03 05:24:53 +00:00
< span id = "L11" class = "LineNr" > 11 < / span > < span class = "PreProc" > var< / span > xn: float
< span id = "L12" class = "LineNr" > 12 < / span > < span class = "PreProc" > var< / span > xn-addr/< span class = "Constant" > ecx< / span > : (addr float) < span class = "SpecialChar" > < -< / span > address xn
2020-11-29 21:36:32 +00:00
< span id = "L13" class = "LineNr" > 13 < / span > < a href = '../../408float.mu.html#L3' > fill-in-rational< / a > xn-addr, < span class = "Constant" > 0x3e7ff< / span > , < span class = "Constant" > 0x3e8< / span > < span class = "muComment" > # 255999 / 1000< / span >
2020-11-03 05:24:53 +00:00
< span id = "L14" class = "LineNr" > 14 < / span > < span class = "muComment" > # print 255.999 * c-> r< / span >
< span id = "L15" class = "LineNr" > 15 < / span > < span class = "PreProc" > var< / span > result/< span class = "Constant" > xmm0< / span > : float < span class = "SpecialChar" > < -< / span > copy xn
< span id = "L16" class = "LineNr" > 16 < / span > < span class = "PreProc" > var< / span > src-addr/< span class = "Constant" > eax< / span > : (addr float) < span class = "SpecialChar" > < -< / span > < a href = '../../131table.subx.html#L26' > get< / a > c, r
< span id = "L17" class = "LineNr" > 17 < / span > result < span class = "SpecialChar" > < -< / span > multiply *src-addr
< span id = "L18" class = "LineNr" > 18 < / span > < span class = "PreProc" > var< / span > result-int/< span class = "Constant" > edx< / span > : int < span class = "SpecialChar" > < -< / span > truncate result
2020-11-12 07:43:04 +00:00
< span id = "L19" class = "LineNr" > 19 < / span > < a href = '../../405screen.mu.html#L480' > print-int32-decimal< / a > < a href = '../../405screen.mu.html#L9' > screen< / a > , result-int
2020-11-03 05:24:53 +00:00
< span id = "L20" class = "LineNr" > 20 < / span > < a href = '../../405screen.mu.html#L169' > print-string< / a > < a href = '../../405screen.mu.html#L9' > screen< / a > , < span class = "Constant" > " " < / span >
< span id = "L21" class = "LineNr" > 21 < / span > < span class = "muComment" > # print 255.999 * c-> g< / span >
< span id = "L22" class = "LineNr" > 22 < / span > src-addr < span class = "SpecialChar" > < -< / span > < a href = '../../131table.subx.html#L26' > get< / a > c, g
< span id = "L23" class = "LineNr" > 23 < / span > result < span class = "SpecialChar" > < -< / span > copy xn
< span id = "L24" class = "LineNr" > 24 < / span > result < span class = "SpecialChar" > < -< / span > multiply *src-addr
< span id = "L25" class = "LineNr" > 25 < / span > result-int < span class = "SpecialChar" > < -< / span > truncate result
2020-11-12 07:43:04 +00:00
< span id = "L26" class = "LineNr" > 26 < / span > < a href = '../../405screen.mu.html#L480' > print-int32-decimal< / a > < a href = '../../405screen.mu.html#L9' > screen< / a > , result-int
2020-11-03 05:24:53 +00:00
< span id = "L27" class = "LineNr" > 27 < / span > < a href = '../../405screen.mu.html#L169' > print-string< / a > < a href = '../../405screen.mu.html#L9' > screen< / a > , < span class = "Constant" > " " < / span >
< span id = "L28" class = "LineNr" > 28 < / span > < span class = "muComment" > # print 255.999 * c-> b< / span >
< span id = "L29" class = "LineNr" > 29 < / span > src-addr < span class = "SpecialChar" > < -< / span > < a href = '../../131table.subx.html#L26' > get< / a > c, b
< span id = "L30" class = "LineNr" > 30 < / span > result < span class = "SpecialChar" > < -< / span > copy xn
< span id = "L31" class = "LineNr" > 31 < / span > result < span class = "SpecialChar" > < -< / span > multiply *src-addr
< span id = "L32" class = "LineNr" > 32 < / span > result-int < span class = "SpecialChar" > < -< / span > truncate result
2020-11-12 07:43:04 +00:00
< span id = "L33" class = "LineNr" > 33 < / span > < a href = '../../405screen.mu.html#L480' > print-int32-decimal< / a > < a href = '../../405screen.mu.html#L9' > screen< / a > , result-int
2020-11-03 05:24:53 +00:00
< span id = "L34" class = "LineNr" > 34 < / span > < a href = '../../405screen.mu.html#L169' > print-string< / a > < a href = '../../405screen.mu.html#L9' > screen< / a > , < span class = "Constant" > " \n" < / span >
< span id = "L35" class = "LineNr" > 35 < / span > < span class = "Delimiter" > }< / span >
2020-10-05 18:00:05 +00:00
< / pre >
< / body >
< / html >
<!-- vim: set foldmethod=manual : -->