41msico Module
41.1Overview
The msico
module provides measures to read/write image data in Microsoft Icon file format. To utilize it, import the msico
module using import
function.
Below is an example to read an ICO file:
import(msico)
img = image('foo.ico')
This module has been implemented referring to the specification: http://msdn.microsoft.com/en-us/library/ms997538.aspx.
41.2Exntension to Function's Capability
This module extends the capability of function image()
and instance method image#write()
so that they can read/write ICO files.
When function image()
is provided with a stream that satisfies the following conditions, it would recognize the stream as a ICO file.
- The identifier of the stream ends with a suffix "
.ico
".
When instance method image#write()
is provided with a stream that satisfies the following condition, it would write image data in ICO format.
- The identifier of the stream ends with a suffix "
.ico
".
41.3msico.content Class
41.3.1Constructor
msico.content(stream?:stream:r, format:symbol => `rgba) {block?}
41.3.2Method
msico.content#write(stream:stream:w):reduce
msico.content#addimage(image:image):map:reduce
41.4Extension to image Class
This module extends the image
class with methods described here.
image#read@msico(stream:stream:r, idx:number => 0):reduce