home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Python 1.1 / Doc / librgbimg.tex < prev    next >
LaTeX Document  |  1994-01-02  |  1.8 KB  |  [TEXT/R*ch]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: LaTeX Document (document/latex).

You can browse this item here: librgbimg.tex

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file LaTeX document text default
99% file LaTeX document, ASCII text, with CR line terminators default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/281 LaTeX (Subdocument) default
100% detectItEasy Format: plain text[CR] default (weak)


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[R*ch]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 73 65 63 74 69 6f 6e | 7b 42 75 69 6c 74 2d 69 |\section|{Built-i|
|00000010| 6e 20 6d 6f 64 75 6c 65 | 20 5c 73 65 63 74 63 6f |n module| \sectco|
|00000020| 64 65 7b 72 67 62 69 6d | 67 7d 7d 0d 5c 62 69 6d |de{rgbim|g}}.\bim|
|00000030| 6f 64 69 6e 64 65 78 7b | 72 67 62 69 6d 67 7d 0d |odindex{|rgbimg}.|
|00000040| 0d 54 68 65 20 72 67 62 | 69 6d 67 20 6d 6f 64 75 |.The rgb|img modu|
|00000050| 6c 65 20 61 6c 6c 6f 77 | 73 20 70 79 74 68 6f 6e |le allow|s python|
|00000060| 20 70 72 6f 67 72 61 6d | 73 20 74 6f 20 61 63 63 | program|s to acc|
|00000070| 65 73 73 20 53 47 49 20 | 69 6d 67 6c 69 62 20 69 |ess SGI |imglib i|
|00000080| 6d 61 67 65 0d 66 69 6c | 65 73 20 28 61 6c 73 6f |mage.fil|es (also|
|00000090| 20 6b 6e 6f 77 6e 20 61 | 73 20 5c 66 69 6c 65 7b | known a|s \file{|
|000000a0| 2e 72 67 62 7d 20 66 69 | 6c 65 73 29 2e 20 20 54 |.rgb} fi|les). T|
|000000b0| 68 65 20 6d 6f 64 75 6c | 65 20 69 73 20 66 61 72 |he modul|e is far|
|000000c0| 20 66 72 6f 6d 0d 63 6f | 6d 70 6c 65 74 65 2c 20 | from.co|mplete, |
|000000d0| 62 75 74 20 69 73 20 70 | 72 6f 76 69 64 65 64 20 |but is p|rovided |
|000000e0| 61 6e 79 77 61 79 20 73 | 69 6e 63 65 20 74 68 65 |anyway s|ince the|
|000000f0| 20 66 75 6e 63 74 69 6f | 6e 61 6c 69 74 79 20 74 | functio|nality t|
|00000100| 68 61 74 20 74 68 65 72 | 65 20 69 73 0d 69 73 20 |hat ther|e is.is |
|00000110| 65 6e 6f 75 67 68 20 69 | 6e 20 73 6f 6d 65 20 63 |enough i|n some c|
|00000120| 61 73 65 73 2e 20 20 43 | 75 72 72 65 6e 74 6c 79 |ases. C|urrently|
|00000130| 2c 20 63 6f 6c 6f 72 6d | 61 70 20 66 69 6c 65 73 |, colorm|ap files|
|00000140| 20 61 72 65 20 6e 6f 74 | 20 73 75 70 70 6f 72 74 | are not| support|
|00000150| 65 64 2e 0d 0d 54 68 65 | 20 6d 6f 64 75 6c 65 20 |ed...The| module |
|00000160| 64 65 66 69 6e 65 73 20 | 74 68 65 20 66 6f 6c 6c |defines |the foll|
|00000170| 6f 77 69 6e 67 20 76 61 | 72 69 61 62 6c 65 73 20 |owing va|riables |
|00000180| 61 6e 64 20 66 75 6e 63 | 74 69 6f 6e 73 3a 0d 0d |and func|tions:..|
|00000190| 5c 72 65 6e 65 77 63 6f | 6d 6d 61 6e 64 7b 5c 69 |\renewco|mmand{\i|
|000001a0| 6e 64 65 78 73 75 62 69 | 74 65 6d 7d 7b 28 69 6e |ndexsubi|tem}{(in|
|000001b0| 20 6d 6f 64 75 6c 65 20 | 72 67 62 69 6d 67 29 7d | module |rgbimg)}|
|000001c0| 0d 5c 62 65 67 69 6e 7b | 65 78 63 64 65 73 63 7d |.\begin{|excdesc}|
|000001d0| 7b 65 72 72 6f 72 7d 0d | 54 68 69 73 20 65 78 63 |{error}.|This exc|
|000001e0| 65 70 74 69 6f 6e 20 69 | 73 20 72 61 69 73 65 64 |eption i|s raised|
|000001f0| 20 6f 6e 20 61 6c 6c 20 | 65 72 72 6f 72 73 2c 20 | on all |errors, |
|00000200| 73 75 63 68 20 61 73 20 | 75 6e 73 75 70 70 6f 72 |such as |unsuppor|
|00000210| 74 65 64 20 66 69 6c 65 | 20 74 79 70 65 2c 20 65 |ted file| type, e|
|00000220| 74 63 2e 0d 5c 65 6e 64 | 7b 65 78 63 64 65 73 63 |tc..\end|{excdesc|
|00000230| 7d 0d 0d 5c 62 65 67 69 | 6e 7b 66 75 6e 63 64 65 |}..\begi|n{funcde|
|00000240| 73 63 7d 7b 73 69 7a 65 | 6f 66 69 6d 61 67 65 7d |sc}{size|ofimage}|
|00000250| 7b 66 69 6c 65 7d 0d 54 | 68 69 73 20 66 75 6e 63 |{file}.T|his func|
|00000260| 74 69 6f 6e 20 72 65 74 | 75 72 6e 73 20 61 20 74 |tion ret|urns a t|
|00000270| 75 70 6c 65 20 5c 63 6f | 64 65 7b 28 5c 76 61 72 |uple \co|de{(\var|
|00000280| 7b 78 7d 2c 20 5c 76 61 | 72 7b 79 7d 29 7d 20 77 |{x}, \va|r{y})} w|
|00000290| 68 65 72 65 0d 5c 76 61 | 72 7b 78 7d 20 61 6e 64 |here.\va|r{x} and|
|000002a0| 20 5c 76 61 72 7b 79 7d | 20 61 72 65 20 74 68 65 | \var{y}| are the|
|000002b0| 20 73 69 7a 65 20 6f 66 | 20 74 68 65 20 69 6d 61 | size of| the ima|
|000002c0| 67 65 20 69 6e 20 70 69 | 78 65 6c 73 2e 0d 4f 6e |ge in pi|xels..On|
|000002d0| 6c 79 20 34 20 62 79 74 | 65 20 52 47 42 41 20 70 |ly 4 byt|e RGBA p|
|000002e0| 69 78 65 6c 73 2c 20 33 | 20 62 79 74 65 20 52 47 |ixels, 3| byte RG|
|000002f0| 42 20 70 69 78 65 6c 73 | 2c 20 61 6e 64 20 31 20 |B pixels|, and 1 |
|00000300| 62 79 74 65 20 67 72 65 | 79 73 63 61 6c 65 20 70 |byte gre|yscale p|
|00000310| 69 78 65 6c 73 0d 61 72 | 65 20 63 75 72 72 65 6e |ixels.ar|e curren|
|00000320| 74 6c 79 20 73 75 70 70 | 6f 72 74 65 64 2e 0d 5c |tly supp|orted..\|
|00000330| 65 6e 64 7b 66 75 6e 63 | 64 65 73 63 7d 0d 0d 5c |end{func|desc}..\|
|00000340| 62 65 67 69 6e 7b 66 75 | 6e 63 64 65 73 63 7d 7b |begin{fu|ncdesc}{|
|00000350| 6c 6f 6e 67 69 6d 61 67 | 65 64 61 74 61 7d 7b 66 |longimag|edata}{f|
|00000360| 69 6c 65 7d 0d 54 68 69 | 73 20 66 75 6e 63 74 69 |ile}.Thi|s functi|
|00000370| 6f 6e 20 72 65 61 64 73 | 20 61 6e 64 20 64 65 63 |on reads| and dec|
|00000380| 6f 64 65 73 20 74 68 65 | 20 69 6d 61 67 65 20 6f |odes the| image o|
|00000390| 6e 20 74 68 65 20 73 70 | 65 63 69 66 69 65 64 20 |n the sp|ecified |
|000003a0| 66 69 6c 65 2c 20 61 6e | 64 0d 72 65 74 75 72 6e |file, an|d.return|
|000003b0| 73 20 69 74 20 61 73 20 | 61 20 70 79 74 68 6f 6e |s it as |a python|
|000003c0| 20 73 74 72 69 6e 67 2e | 20 54 68 65 20 73 74 72 | string.| The str|
|000003d0| 69 6e 67 20 68 61 73 20 | 34 20 62 79 74 65 20 52 |ing has |4 byte R|
|000003e0| 47 42 41 20 70 69 78 65 | 6c 73 2e 0d 54 68 65 20 |GBA pixe|ls..The |
|000003f0| 62 6f 74 74 6f 6d 20 6c | 65 66 74 20 70 69 78 65 |bottom l|eft pixe|
|00000400| 6c 20 69 73 20 74 68 65 | 20 66 69 72 73 74 20 69 |l is the| first i|
|00000410| 6e 0d 74 68 65 20 73 74 | 72 69 6e 67 2e 20 54 68 |n.the st|ring. Th|
|00000420| 69 73 20 66 6f 72 6d 61 | 74 20 69 73 20 73 75 69 |is forma|t is sui|
|00000430| 74 61 62 6c 65 20 74 6f | 20 70 61 73 73 20 74 6f |table to| pass to|
|00000440| 20 5c 63 6f 64 65 7b 67 | 6c 2e 6c 72 65 63 74 77 | \code{g|l.lrectw|
|00000450| 72 69 74 65 7d 2c 0d 66 | 6f 72 20 69 6e 73 74 61 |rite},.f|or insta|
|00000460| 6e 63 65 2e 0d 5c 65 6e | 64 7b 66 75 6e 63 64 65 |nce..\en|d{funcde|
|00000470| 73 63 7d 0d 0d 5c 62 65 | 67 69 6e 7b 66 75 6e 63 |sc}..\be|gin{func|
|00000480| 64 65 73 63 7d 7b 6c 6f | 6e 67 73 74 6f 69 6d 61 |desc}{lo|ngstoima|
|00000490| 67 65 7d 7b 64 61 74 61 | 5c 2c 20 78 5c 2c 20 79 |ge}{data|\, x\, y|
|000004a0| 5c 2c 20 7a 5c 2c 20 66 | 69 6c 65 7d 0d 54 68 69 |\, z\, f|ile}.Thi|
|000004b0| 73 20 66 75 6e 63 74 69 | 6f 6e 20 77 72 69 74 65 |s functi|on write|
|000004c0| 73 20 74 68 65 20 52 47 | 42 41 20 64 61 74 61 20 |s the RG|BA data |
|000004d0| 69 6e 20 5c 76 61 72 7b | 64 61 74 61 7d 20 74 6f |in \var{|data} to|
|000004e0| 20 69 6d 61 67 65 0d 66 | 69 6c 65 20 5c 76 61 72 | image.f|ile \var|
|000004f0| 7b 66 69 6c 65 7d 2e 20 | 5c 76 61 72 7b 78 7d 20 |{file}. |\var{x} |
|00000500| 61 6e 64 20 5c 76 61 72 | 7b 79 7d 20 67 69 76 65 |and \var|{y} give|
|00000510| 20 74 68 65 20 73 69 7a | 65 20 6f 66 20 74 68 65 | the siz|e of the|
|00000520| 20 69 6d 61 67 65 2e 0d | 5c 76 61 72 7b 7a 7d 20 | image..|\var{z} |
|00000530| 69 73 20 31 20 69 66 20 | 74 68 65 20 73 61 76 65 |is 1 if |the save|
|00000540| 64 20 69 6d 61 67 65 20 | 73 68 6f 75 6c 64 20 62 |d image |should b|
|00000550| 65 20 31 20 62 79 74 65 | 20 67 72 65 79 73 63 61 |e 1 byte| greysca|
|00000560| 6c 65 2c 20 33 20 69 66 | 20 74 68 65 0d 73 61 76 |le, 3 if| the.sav|
|00000570| 65 64 20 69 6d 61 67 65 | 20 73 68 6f 75 6c 64 20 |ed image| should |
|00000580| 62 65 20 33 20 62 79 74 | 65 20 52 47 42 20 64 61 |be 3 byt|e RGB da|
|00000590| 74 61 2c 20 6f 72 20 34 | 20 69 66 20 74 68 65 20 |ta, or 4| if the |
|000005a0| 73 61 76 65 64 20 69 6d | 61 67 65 73 20 73 68 6f |saved im|ages sho|
|000005b0| 75 6c 64 0d 62 65 20 34 | 20 62 79 74 65 20 52 47 |uld.be 4| byte RG|
|000005c0| 42 41 20 64 61 74 61 2e | 20 20 54 68 65 20 69 6e |BA data.| The in|
|000005d0| 70 75 74 20 64 61 74 61 | 20 61 6c 77 61 79 73 20 |put data| always |
|000005e0| 63 6f 6e 74 61 69 6e 73 | 20 34 20 62 79 74 65 73 |contains| 4 bytes|
|000005f0| 20 70 65 72 20 70 69 78 | 65 6c 2e 0d 54 68 65 73 | per pix|el..Thes|
|00000600| 65 20 61 72 65 20 74 68 | 65 20 66 6f 72 6d 61 74 |e are th|e format|
|00000610| 73 20 72 65 74 75 72 6e | 65 64 20 62 79 20 5c 63 |s return|ed by \c|
|00000620| 6f 64 65 7b 67 6c 2e 6c | 72 65 63 74 72 65 61 64 |ode{gl.l|rectread|
|00000630| 7d 2e 0d 5c 65 6e 64 7b | 66 75 6e 63 64 65 73 63 |}..\end{|funcdesc|
|00000640| 7d 0d 0d 5c 62 65 67 69 | 6e 7b 66 75 6e 63 64 65 |}..\begi|n{funcde|
|00000650| 73 63 7d 7b 74 74 6f 62 | 7d 7b 66 6c 61 67 7d 0d |sc}{ttob|}{flag}.|
|00000660| 54 68 69 73 20 66 75 6e | 63 74 69 6f 6e 20 73 65 |This fun|ction se|
|00000670| 74 73 20 61 20 67 6c 6f | 62 61 6c 20 66 6c 61 67 |ts a glo|bal flag|
|00000680| 20 77 68 69 63 68 20 64 | 65 66 69 6e 65 73 20 77 | which d|efines w|
|00000690| 68 65 74 68 65 72 20 74 | 68 65 20 73 63 61 6e 20 |hether t|he scan |
|000006a0| 6c 69 6e 65 73 0d 6f 66 | 20 74 68 65 20 69 6d 61 |lines.of| the ima|
|000006b0| 67 65 20 61 72 65 20 72 | 65 61 64 20 6f 72 20 77 |ge are r|ead or w|
|000006c0| 72 69 74 74 65 6e 20 66 | 72 6f 6d 20 62 6f 74 74 |ritten f|rom bott|
|000006d0| 6f 6d 20 74 6f 20 74 6f | 70 20 28 66 6c 61 67 20 |om to to|p (flag |
|000006e0| 69 73 20 7a 65 72 6f 2c | 0d 63 6f 6d 70 61 74 69 |is zero,|.compati|
|000006f0| 62 6c 65 20 77 69 74 68 | 20 53 47 49 20 47 4c 29 |ble with| SGI GL)|
|00000700| 20 6f 72 20 66 72 6f 6d | 20 74 6f 70 20 74 6f 20 | or from| top to |
|00000710| 62 6f 74 74 6f 6d 28 66 | 6c 61 67 20 69 73 20 6f |bottom(f|lag is o|
|00000720| 6e 65 2c 0d 63 6f 6d 70 | 61 74 69 62 6c 65 20 77 |ne,.comp|atible w|
|00000730| 69 74 68 20 58 29 2e 20 | 20 54 68 65 20 64 65 66 |ith X). | The def|
|00000740| 61 75 6c 74 20 69 73 20 | 7a 65 72 6f 2e 0d 5c 65 |ault is |zero..\e|
|00000750| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 0d |nd{funcd|esc}. |
+--------+-------------------------+-------------------------+--------+--------+