templeos-info/public/Wb/Home/Doc/GRFiles.DD.HTML

79 lines
6.2 KiB
HTML
Executable File

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="generator" content="TempleOS V5.03">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="/style/templeos.css">
<script src="/script/templeos.js"></script>
<style type="text/css">
.cF0{color:#000000;background-color:#ffffff;}
.cF1{color:#0000aa;background-color:#ffffff;}
.cF2{color:#00aa00;background-color:#ffffff;}
.cF3{color:#00aaaa;background-color:#ffffff;}
.cF4{color:#aa0000;background-color:#ffffff;}
.cF5{color:#aa00aa;background-color:#ffffff;}
.cF6{color:#aa5500;background-color:#ffffff;}
.cF7{color:#aaaaaa;background-color:#ffffff;}
.cF8{color:#555555;background-color:#ffffff;}
.cF9{color:#5555ff;background-color:#ffffff;}
.cFA{color:#55ff55;background-color:#ffffff;}
.cFB{color:#55ffff;background-color:#ffffff;}
.cFC{color:#ff5555;background-color:#ffffff;}
.cFD{color:#ff55ff;background-color:#ffffff;}
.cFE{color:#ffff55;background-color:#ffffff;}
.cFF{color:#ffffff;background-color:#ffffff;}
</style>
</head>
<body>
<pre id="content">
<a name="l1"></a><span class=cF0>GR graphics files are 8-bits-per-pixels but only 4-bits of color, with
<a name="l2"></a>transparency and no palette. Compression is the standard TempleOS LZW
<a name="l3"></a>compression.
<a name="l4"></a>
<a name="l5"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>DCF_COMPRESSED</span><span class=cF0> 1 </span><span class=cF2>//This is the only saved flag.</span><span class=cF0>
<a name="l6"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>DCF_PALETTE</span><span class=cF0> 2
<a name="l7"></a>
<a name="l8"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>TRANSPARENT</span><span class=cF0> 0xFF
<a name="l9"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>BLACK</span><span class=cF0> 0
<a name="l10"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>BLUE</span><span class=cF0> 1
<a name="l11"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>GREEN</span><span class=cF0> 2
<a name="l12"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>CYAN</span><span class=cF0> 3
<a name="l13"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>RED</span><span class=cF0> 4
<a name="l14"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>PURPLE</span><span class=cF0> 5
<a name="l15"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>BROWN</span><span class=cF0> 6
<a name="l16"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>LTGRAY</span><span class=cF0> 7
<a name="l17"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>DKGRAY</span><span class=cF0> 8
<a name="l18"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>LTBLUE</span><span class=cF0> 9
<a name="l19"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>LTGREEN</span><span class=cF0> 10
<a name="l20"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>LTCYAN</span><span class=cF0> 11
<a name="l21"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>LTRED</span><span class=cF0> 12
<a name="l22"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>LTPURPLE</span><span class=cF0> 13
<a name="l23"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>YELLOW</span><span class=cF0> 14
<a name="l24"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>WHITE</span><span class=cF0> 15
<a name="l25"></a>
<a name="l26"></a></span><span class=cF1>class</span><span class=cF0> </span><span class=cF9>CBGR48</span><span class=cF0>
<a name="l27"></a>{
<a name="l28"></a> </span><span class=cF9>U16</span><span class=cF0> r,g,b,pad;
<a name="l29"></a>};
<a name="l30"></a>
<a name="l31"></a></span><span class=cF9>CBGR48</span><span class=cF0> </span><span class=cFB>gr_palette_std</span><span class=cF0>[16]={
<a name="l32"></a>0x000000000000,0x00000000AAAA,0x0000AAAA0000,0x0000AAAAAAAA,
<a name="l33"></a>0xAAAA00000000,0xAAAA0000AAAA,0xAAAA55550000,0xAAAAAAAAAAAA,
<a name="l34"></a>0x555555555555,0x55555555FFFF,0x5555FFFF5555,0x5555FFFFFFFF,
<a name="l35"></a>0xFFFF55555555,0xFFFF5555FFFF,0xFFFFFFFF5555,0xFFFFFFFFFFFF};
<a name="l36"></a>
<a name="l37"></a></span><span class=cF1>class</span><span class=cF0> GRFile
<a name="l38"></a>{
<a name="l39"></a> </span><span class=cF9>I32</span><span class=cF0> width;
<a name="l40"></a> </span><span class=cF9>I32</span><span class=cF0> width_internal; </span><span class=cF2>//Rounded-up to multiple of 8.</span><span class=cF0>
<a name="l41"></a> </span><span class=cF9>I32</span><span class=cF0> height;
<a name="l42"></a> </span><span class=cF9>I32</span><span class=cF0> flags; </span><span class=cF2>//DCF_COMPRESSED? See </span><a href="/Wb/Kernel/Compress.HC.HTML#l1"><span class=cF4>::/Kernel/Compress.HC</span></a><span class=cF2>.</span><span class=cF0>
<a name="l43"></a> </span><span class=cF9>CBGR48</span><span class=cF0> palette[16]; </span><span class=cF2>//Included if DCF_PALETTE.</span><span class=cF0>
<a name="l44"></a> </span><span class=cF1>U8</span><span class=cF0> body[];
<a name="l45"></a>};
<a name="l46"></a>
<a name="l47"></a>See </span><a href="/Wb/Adam/Gr/GrDC.HC.HTML#l286"><span class=cF4>DCSave</span></a><span class=cF0>(), </span><a href="/Wb/Adam/Gr/GrDC.HC.HTML#l383"><span class=cF4>GRWrite</span></a><span class=cF0>(), </span><a href="/Wb/Adam/Gr/GrDC.HC.HTML#l338"><span class=cF4>DCLoad</span></a><span class=cF0>(), and </span><a href="/Wb/Adam/Gr/GrDC.HC.HTML#l394"><span class=cF4>GRRead</span></a><span class=cF0>().
</span></pre></body>
</html>