application front ends communicate with driver back ends through an intermediary known as libsane.so--a symbolic link (symlink, for short) to a driver back end that controls a specific image-acquisition device. when an application communicates with libsane.so, its actually communicating with whatever driver is represented by libsane.so.
figure 2. a sane driver hierarchy 【程序编程相关:Java源码解读之util.ArrayL】
changing symlinks is convenient for changing drivers without needing to relink applications. however, that is not convenient whenever you want to dynamically switch image-acquisition devices. sane overcomes this problem by providing the pseudo-drivers dll and net. those pseudo-drivers talk to other sane drivers instead of physical devices: dll talks to other sane drivers on the same machine and net talks to other sane drivers across a network. figure 2 presents an example of a sane driver hierarchy involving dll and net. this example is based on, but isnt identical to, an example found in the sane documentation. 【推荐阅读:CLR和JRE的运行机制的初步总结】
net provides network access to machine b, by connecting machine a to the sane daemon (saned) that runs on machine b. the daemon communicates with dll, which dynamically loads the hp scanner driver. as a result, an application that runs on machine a can access machine bs hp scanner. 【扩展信息:用BeanShell实现公式管理】
figure 2 reveals two machines: a and b. machine as libsane.so is a symlink to the dll pseudo-driver. that pseudo-driver uses dynamically linked libraries to access both the mustek scanner driver (which controls the local mustek scanner) and the net pseudo-driver.
of course, figure 2 is just one example. on machine a, libsane.so could be a symlink to the net pseudo-driver, or a real driver (such as the mustek scanner driver). system administrators have lots of flexibility in how they set up the sane driver hierarchy.
perhaps the most important part of the sane environment is the format used to represent acquired images. sane regards an image as a rectangular area that is subdivided into rows and columns. sane refers to the intersection of a row and column as a quadratic pixel. this pixel consists of one or more sample values, where a sample value represents a color channel (red, green, blue) or a shade of gray. each sample also has a bit depth: one, 8, and 16 bits per sample are valid bit depths.
sane transmits an image as a sequence of frames. each frame covers the entire rectangular area but may only contain a subset of the channels. for example, a frame may only contain the red sample values, or the green sample values. alternatively, a frame could consist of the sample values of all three color channels. more information on sanes image data format and image transmission can be found in the document mentioned earlier.
... 下一页