![]() |
oneliner-image-to-ppm.rAuthor: Vincent Ecuyer Contents:1. Purpose2. Usage 3. Example 4. Commented Code 1. Purpose
2. Usageto-ppm value (image!) 3. Example
4. Commented Codeto-ppm: func [ "Converts an image to a PPM binary file format" value [image!] "Image source" ] [ ; equivalent to "to-binary rejoin" : we want a binary! resul join #{} [ ; the binary PPM file header, followed by a <space> "P6 " ; the image size, in the form width <space> height replace form value/size "x" " " ; a <space>, the max component value, and a <newline> " 255^(0A)" : the image data as RGB bytes sequences value/rgb ] ] |
![]() | MakeDoc2 by REBOL - 29-Jan-2013 |