kopia lustrzana https://gitlab.com/sane-project/standard
Convert raw LaTeX tables to reStructured grid tables
This preserves the LaTeX formatting in the *.rst files but does not exactly lead to user-friendly tables in the HTML :-/ and restores table references.draft-2
rodzic
364d8460de
commit
d70a8380f0
485
sane.rst
485
sane.rst
|
@ -781,46 +781,36 @@ Option Value Type
|
|||
|
||||
Member :member:`type` specifies the type of the option value.
|
||||
The possible values for type :type:`SANE_Value_Type`
|
||||
are described in Table :raw-latex:`\ref{tab:valuetype}`.
|
||||
are described in Table :ref:`tab:valuetype`.
|
||||
|
||||
:raw-latex:`\leavevmode`
|
||||
.. table:: Option Value Types (:type:`SANE_Value_Type`)
|
||||
:name: tab:valuetype
|
||||
:align: center
|
||||
|
||||
.. raw:: latex
|
||||
|
||||
\begin{tabular}{|l|l|p{0.6\textwidth}|}
|
||||
\hline
|
||||
\multicolumn{1}{|c|}{\bf Symbol} &
|
||||
\multicolumn{1}{c|}{\bf Code} &
|
||||
\multicolumn{1}{c|}{\bf Description} \\
|
||||
\hline\hline
|
||||
|
||||
\code{\defn{SANE_TYPE_BOOL}} & 0 & Option value is of type
|
||||
\verb|SANE_Bool|. \\
|
||||
|
||||
\code{\defn{SANE_TYPE_INT}} & 1 & Option value is of type
|
||||
\verb|SANE_Int|. \\
|
||||
|
||||
\code{\defn{SANE_TYPE_FIXED}}&2 & Option value is of type
|
||||
\verb|SANE_Fixed|. \\
|
||||
|
||||
\code{\defn{SANE_TYPE_STRING}}&3 & Option value is of type
|
||||
\verb|SANE_String|. \\
|
||||
|
||||
\code{\defn{SANE_TYPE_BUTTON}} & 4 & An option of this type has no value.
|
||||
Instead, setting an option of this type has an option-specific
|
||||
side-effect. For example, a button-typed option could be used by a
|
||||
backend to provide a means to select default values or to the tell an
|
||||
automatic document feeder to advance to the next sheet of paper. \\
|
||||
|
||||
\code{\defn{SANE_TYPE_GROUP}} & 5 & An option of this type has no value.
|
||||
This type is used to group logically related options. A group option
|
||||
is in effect up to the point where another group option is encountered
|
||||
(or up to the end of the option list, if there are no other group
|
||||
options). For group options, only members \code{title} and
|
||||
\code{type} are valid in the option descriptor. \\
|
||||
|
||||
\hline
|
||||
\end{tabular}
|
||||
+-----------------------------+------+------------------------------------------------------------------------+
|
||||
| Symbol | Code | Description |
|
||||
+=============================+======+========================================================================+
|
||||
| .. macro:: SANE_TYPE_BOOL | 0 | Option value is of type :type:`SANE_Bool`. |
|
||||
+-----------------------------+------+------------------------------------------------------------------------+
|
||||
| .. macro:: SANE_TYPE_INT | 1 | Option value is of type :type:`SANE_Int`. |
|
||||
+-----------------------------+------+------------------------------------------------------------------------+
|
||||
| .. macro:: SANE_TYPE_FIXED | 2 | Option value is of type :type:`SANE_Fixed`. |
|
||||
+-----------------------------+------+------------------------------------------------------------------------+
|
||||
| .. macro:: SANE_TYPE_STRING | 3 | Option value is of type :type:`SANE_String`. |
|
||||
+-----------------------------+------+------------------------------------------------------------------------+
|
||||
| .. macro:: SANE_TYPE_BUTTON | 4 | An option of this type has no value. |
|
||||
| | | Instead, setting an option of this type has an option-specific |
|
||||
| | | side-effect. For example, a button-typed option could be used by a |
|
||||
| | | backend to provide a means to select default values or to the tell an |
|
||||
| | | automatic document feeder to advance to the next sheet of paper. |
|
||||
+-----------------------------+------+------------------------------------------------------------------------+
|
||||
| .. macro:: SANE_TYPE_GROUP | 5 | An option of this type has no value. |
|
||||
| | | This type is used to group logically related options. A group option |
|
||||
| | | is in effect up to the point where another group option is encountered |
|
||||
| | | (or up to the end of the option list, if there are no other group |
|
||||
| | | options). For group options, only members :member:`title` and |
|
||||
| | | :member:`type` are valid in the option descriptor. |
|
||||
+-----------------------------+------+------------------------------------------------------------------------+
|
||||
|
||||
.. index:: SANE_Unit
|
||||
|
||||
|
@ -830,35 +820,34 @@ Option Value Unit
|
|||
Member :member:`unit` specifies what the physical unit of the
|
||||
option value is. The possible values for type
|
||||
:type:`SANE_Unit` are described in Table
|
||||
:raw-latex:`\ref{tab:units}`. Note that the specified unit is what the
|
||||
:ref:`tab:units`. Note that the specified unit is what the
|
||||
SANE backend expects. It is entirely up to a frontend as to how these
|
||||
units a presented to the user. For example, SANE expresses all lengths
|
||||
in millimeters. A frontend is generally expected to provide appropriate
|
||||
conversion routines so that a user can express quantities in a customary
|
||||
unit (e.g., inches or centimeters).
|
||||
|
||||
:raw-latex:`\leavevmode`
|
||||
.. table:: Physical Units (:type:`SANE_Unit`)
|
||||
:name: tab:units
|
||||
:align: center
|
||||
|
||||
.. raw:: latex
|
||||
|
||||
\begin{tabular}{|l|l|l|}
|
||||
\hline
|
||||
\multicolumn{1}{|c|}{\bf Symbol} &
|
||||
\multicolumn{1}{|c|}{\bf Code} &
|
||||
\multicolumn{1}{|c|}{\bf Description} \\
|
||||
|
||||
\hline\hline
|
||||
|
||||
\code{\defn{SANE_UNIT_NONE}} & 0 & Value is unit-less (e.g., page count).\\
|
||||
\code{\defn{SANE_UNIT_PIXEL}} & 1 & Value is in number of pixels. \\
|
||||
\code{\defn{SANE_UNIT_BIT}} & 2 & Value is in number of bits. \\
|
||||
\code{\defn{SANE_UNIT_MM}} & 3 & Value is in millimeters. \\
|
||||
\code{\defn{SANE_UNIT_DPI}} & 4 & Value is a resolution in dots/inch. \\
|
||||
\code{\defn{SANE_UNIT_PERCENT}}& 5 & Value is a percentage. \\
|
||||
\code{\defn{SANE_UNIT_MICROSECOND}}& 6 & Value is time in $\mu$-seconds. \\
|
||||
|
||||
\hline
|
||||
\end{tabular}
|
||||
+----------------------------------+------+----------------------------------------+
|
||||
| Symbol | Code | Description |
|
||||
+==================================+======+========================================+
|
||||
| .. macro:: SANE_UNIT_NONE | 0 | Value is unit-less (e.g., page count). |
|
||||
+----------------------------------+------+----------------------------------------+
|
||||
| .. macro:: SANE_UNIT_PIXEL | 1 | Value is in number of pixels. |
|
||||
+----------------------------------+------+----------------------------------------+
|
||||
| .. macro:: SANE_UNIT_BIT | 2 | Value is in number of bits. |
|
||||
+----------------------------------+------+----------------------------------------+
|
||||
| .. macro:: SANE_UNIT_MM | 3 | Value is in millimeters. |
|
||||
+----------------------------------+------+----------------------------------------+
|
||||
| .. macro:: SANE_UNIT_DPI | 4 | Value is a resolution in dots/inch. |
|
||||
+----------------------------------+------+----------------------------------------+
|
||||
| .. macro:: SANE_UNIT_PERCENT | 5 | Value is a percentage. |
|
||||
+----------------------------------+------+----------------------------------------+
|
||||
| .. macro:: SANE_UNIT_MICROSECOND | 6 | Value is time in :math:`\mu`-seconds. |
|
||||
+----------------------------------+------+----------------------------------------+
|
||||
|
||||
Option Value Size
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
@ -890,7 +879,7 @@ Option Capabilities
|
|||
|
||||
Member :member:`cap` describes what capabilities the option
|
||||
posseses. This is a bitset that is formed as the inclusive logical OR of
|
||||
the capabilities described in Table :raw-latex:`\ref{tab:capabilities}`.
|
||||
the capabilities described in Table :ref:`tab:capabilities`.
|
||||
The SANE API provides the following to macros to test certain features
|
||||
of a given capability bitset:
|
||||
|
||||
|
@ -906,63 +895,56 @@ of a given capability bitset:
|
|||
the option with the capability set :data:`cap` is
|
||||
software settable.
|
||||
|
||||
:raw-latex:`\leavevmode`
|
||||
.. table:: Option Capabilities
|
||||
:name: tab:capabilities
|
||||
:align: center
|
||||
|
||||
.. raw:: latex
|
||||
|
||||
\begin{tabular}{|l|r|p{0.59\textwidth}|}
|
||||
\hline
|
||||
\multicolumn{1}{|c|}{\bf Symbol} &
|
||||
\multicolumn{1}{c|}{\bf Code} &
|
||||
\multicolumn{1}{c|}{\bf Description} \\
|
||||
\hline\hline
|
||||
|
||||
\code{\defn{SANE_CAP_SOFT_SELECT}} & 1 & The option
|
||||
value can be set by a call to \code{sane_control_option()}.\\
|
||||
|
||||
\code{\defn{SANE_CAP_HARD_SELECT}} & 2 & The option value can be set by
|
||||
user-intervention (e.g., by flipping a switch). The user-interface
|
||||
should prompt the user to execute the appropriate action to set such
|
||||
an option. This capability is mutually exclusive with
|
||||
SANE_CAP_SOFT_SELECT (either one of them can be set, but not both
|
||||
simultaneously). \\
|
||||
|
||||
\code{\defn{SANE_CAP_SOFT_DETECT}} & 4 & The option
|
||||
value can be detected by software. If
|
||||
\code{SANE_CAP_SOFT_SELECT} is set, this capability {\em must\/}
|
||||
be set. If \code{SANE_CAP_HARD_SELECT} is set, this capability
|
||||
may or may not be set. If this capability is set but neither
|
||||
\code{SANE_CAP_SOFT_SELECT} nor \code{SANE_CAP_HARD_SELECT}
|
||||
are, then there is no way to control the option. That is, the
|
||||
option provides read-out of the current value only. \\
|
||||
|
||||
\code{\defn{SANE_CAP_EMULATED}} & 8 & If set, this capability indicates
|
||||
that an option is not directly supported by the device and is
|
||||
instead emulated in the backend. A sophisticated frontend may
|
||||
elect to use its own (presumably better) emulation in lieu of an emulated
|
||||
option. \\
|
||||
|
||||
\code{\defn{SANE_CAP_AUTOMATIC}} & 16 & If set, this capability indicates
|
||||
that the backend (or the device) is capable to picking a reasonable
|
||||
option value automatically. For such options, it is possible to
|
||||
select automatic operation by calling \code{sane_control_option()}
|
||||
with an action value of \code{SANE_ACTION_SET_AUTO}. \\
|
||||
|
||||
\code{\defn{SANE_CAP_INACTIVE}} & 32 & If set, this capability indicates
|
||||
that the option is not currently active (e.g., because it's
|
||||
meaningful only if another option is set to some other value). \\
|
||||
|
||||
\code{\defn{SANE_CAP_ADVANCED}} & 64 &
|
||||
If set, this capability indicates that the option should be
|
||||
considered an ``advanced user option.'' A frontend typically
|
||||
displays such options in a less conspicuous way than regular options
|
||||
(e.g., a command line interface may list such options last or a
|
||||
graphical interface may make them available in a seperate ``advanced
|
||||
settings'' dialog).
|
||||
\\
|
||||
|
||||
\hline
|
||||
\end{tabular}
|
||||
+---------------------------------+------+---------------------------------------------------------------------------+
|
||||
| Symbol | Code | Description |
|
||||
+=================================+======+===========================================================================+
|
||||
| .. macro:: SANE_CAP_SOFT_SELECT | 1 | The option |
|
||||
| | | value can be set by a call to :func:`sane_control_option()`. |
|
||||
+---------------------------------+------+---------------------------------------------------------------------------+
|
||||
| .. macro:: SANE_CAP_HARD_SELECT | 2 | The option value can be set by |
|
||||
| | | user-intervention (e.g., by flipping a switch). The user-interface |
|
||||
| | | should prompt the user to execute the appropriate action to set such |
|
||||
| | | an option. This capability is mutually exclusive with |
|
||||
| | | SANE_CAP_SOFT_SELECT (either one of them can be set, but not both |
|
||||
| | | simultaneously). |
|
||||
+---------------------------------+------+---------------------------------------------------------------------------+
|
||||
| .. macro:: SANE_CAP_SOFT_DETECT | 4 | The option |
|
||||
| | | value can be detected by software. If |
|
||||
| | | :macro:`SANE_CAP_SOFT_SELECT` is set, this capability *must* |
|
||||
| | | be set. If :macro:`SANE_CAP_HARD_SELECT` is set, this capability |
|
||||
| | | may or may not be set. If this capability is set but neither |
|
||||
| | | :macro:`SANE_CAP_SOFT_SELECT` nor :macro:`SANE_CAP_HARD_SELECT` |
|
||||
| | | are, then there is no way to control the option. That is, the |
|
||||
| | | option provides read-out of the current value only. |
|
||||
+---------------------------------+------+---------------------------------------------------------------------------+
|
||||
| .. macro:: SANE_CAP_EMULATED | 8 | If set, this capability indicates |
|
||||
| | | that an option is not directly supported by the device and is |
|
||||
| | | instead emulated in the backend. A sophisticated frontend may |
|
||||
| | | elect to use its own (presumably better) emulation in lieu of an emulated |
|
||||
| | | option. |
|
||||
+---------------------------------+------+---------------------------------------------------------------------------+
|
||||
| .. macro:: SANE_CAP_AUTOMATIC | 16 | If set, this capability indicates |
|
||||
| | | that the backend (or the device) is capable to picking a reasonable |
|
||||
| | | option value automatically. For such options, it is possible to |
|
||||
| | | select automatic operation by calling :func:`sane_control_option()` |
|
||||
| | | with an action value of :macro:`SANE_ACTION_SET_AUTO`. |
|
||||
+---------------------------------+------+---------------------------------------------------------------------------+
|
||||
| .. macro:: SANE_CAP_INACTIVE | 32 | If set, this capability indicates |
|
||||
| | | that the option is not currently active (e.g., because it's |
|
||||
| | | meaningful only if another option is set to some other value). |
|
||||
+---------------------------------+------+---------------------------------------------------------------------------+
|
||||
| .. macro:: SANE_CAP_ADVANCED | 64 | |
|
||||
| | | If set, this capability indicates that the option should be |
|
||||
| | | considered an "advanced user option." A frontend typically |
|
||||
| | | displays such options in a less conspicuous way than regular options |
|
||||
| | | (e.g., a command line interface may list such options last or a |
|
||||
| | | graphical interface may make them available in a seperate "advanced |
|
||||
| | | settings" dialog). |
|
||||
+---------------------------------+------+---------------------------------------------------------------------------+
|
||||
|
||||
.. index:: SANE_Constraint_Type
|
||||
|
||||
|
@ -977,68 +959,62 @@ values that are allowed for the option are described by one of the union
|
|||
members of member :member:`constraint`. The possible values of
|
||||
type :type:`SANE_Constraint_Type` and the
|
||||
interpretation of the :member:`constraint` union is described
|
||||
in Table :raw-latex:`\ref{tab:constraints}`.
|
||||
in Table :ref:`tab:constraints`.
|
||||
|
||||
:raw-latex:`\leavevmode`
|
||||
.. table:: Option Value Constraints
|
||||
:name: tab:constraints
|
||||
:align: center
|
||||
|
||||
.. raw:: latex
|
||||
|
||||
\begin{tabular}{|l|r|p{0.5\textwidth}|}
|
||||
\hline
|
||||
\multicolumn{1}{|c|}{\bf Symbol} &
|
||||
\multicolumn{1}{|c|}{\bf Code} &
|
||||
\multicolumn{1}{|c|}{\bf Description} \\
|
||||
|
||||
\hline\hline
|
||||
|
||||
\code{\defn{SANE_CONSTRAINT_NONE}} & 0 & The value is unconstrained.
|
||||
The option can take any of the values possible for the option's
|
||||
type. \\
|
||||
|
||||
\code{\defn{SANE_CONSTRAINT_RANGE}} & 1 & This constraint is
|
||||
applicable to integer and fixed-point valued options only. It
|
||||
constrains the option value to a possibly quantized range of
|
||||
numbers. Option descriptor member \code{constraint.range} points to
|
||||
a range of the type \code{\defn{SANE_Range}}. This type is illustrated
|
||||
below:
|
||||
\begin{quote}
|
||||
\begin{verbatim}
|
||||
typedef struct
|
||||
{
|
||||
SANE_Word min;
|
||||
SANE_Word max;
|
||||
SANE_Word quant;
|
||||
}
|
||||
SANE_Range;
|
||||
\end{verbatim}
|
||||
\end{quote}
|
||||
All three members in this structure are interpreted according to the
|
||||
option value type (\verb|SANE_TYPE_INT| or \verb|SANE_TYPE_FIXED|).
|
||||
Members \code{min} and \code{max} specify the minimum and maximum
|
||||
values, respectively. If member \code{quant} is non-zero, it
|
||||
specifies the quantization value. If $l$ is the minimum value, $u$
|
||||
the maximum value and $q$ the (non-zero) quantization of a range,
|
||||
then the legal values are $v=k\cdot q+l$ for all non-negative
|
||||
integer values of $k$ such that $v<=u$. \\
|
||||
|
||||
\code{\defn{SANE_CONSTRAINT_WORD_LIST}} & 2 & This constraint is applicable
|
||||
to integer and fixed-point valued options only. It constrains the
|
||||
option value to a list of numeric values. Option descriptor member
|
||||
\code{constraint.word_list} points to a list of words that
|
||||
enumerates the legal values. The first element in that list is an
|
||||
integer (\verb|SANE_Int|) that specifies the length of the list (not
|
||||
counting the length itself). The remaining elements in the list are
|
||||
interpreted according to the type of the option value
|
||||
(\verb|SANE_TYPE_INT| or \verb|SANE_TYPE_FIXED|). \\
|
||||
|
||||
\code{\defn{SANE_CONSTRAINT_STRING_LIST}} & 3 & This constraint is
|
||||
applicable to string-valued options only. It constrains the option
|
||||
value to a list of strings. The option descriptor member
|
||||
\code{constraint.string_list} points to a \code{NULL} terminated
|
||||
list of strings that enumerate the legal values for the option
|
||||
value.
|
||||
\\\hline
|
||||
\end{tabular}
|
||||
+----------------------------------------+------+--------------------------------------------------------------------------------+
|
||||
| Symbol | Code | Description |
|
||||
+========================================+======+================================================================================+
|
||||
| .. macro:: SANE_CONSTRAINT_NONE | 0 | The value is unconstrained. |
|
||||
| | | The option can take any of the values possible for the option's |
|
||||
| | | type. |
|
||||
+----------------------------------------+------+--------------------------------------------------------------------------------+
|
||||
| .. macro:: SANE_CONSTRAINT_RANGE | 1 | This constraint is |
|
||||
| | | applicable to integer and fixed-point valued options only. It |
|
||||
| | | constrains the option value to a possibly quantized range of |
|
||||
| | | numbers. Option descriptor member :member:`constraint.range` points to |
|
||||
| | | a range of the type :type:`SANE_Range`. This type is illustrated |
|
||||
| | | below: |
|
||||
| | | |
|
||||
| | | :: |
|
||||
| | | |
|
||||
| | | typedef struct |
|
||||
| | | { |
|
||||
| | | SANE_Word min; |
|
||||
| | | SANE_Word max; |
|
||||
| | | SANE_Word quant; |
|
||||
| | | } |
|
||||
| | | SANE_Range; |
|
||||
| | | |
|
||||
| | | All three members in this structure are interpreted according to the |
|
||||
| | | option value type (:macro:`SANE_TYPE_INT` or :macro:`SANE_TYPE_FIXED`). |
|
||||
| | | Members :member:`min` and :member:`max` specify the minimum and maximum |
|
||||
| | | values, respectively. If member :member:`quant` is non-zero, it |
|
||||
| | | specifies the quantization value. If :math:`l` is the minimum value, :math:`u`|
|
||||
| | | the maximum value and :math:`q` the (non-zero) quantization of a range, |
|
||||
| | | then the legal values are :math:`v=k\cdot q+l` for all non-negative |
|
||||
| | | integer values of :math:`k` such that :math:`v<=u`. |
|
||||
+----------------------------------------+------+--------------------------------------------------------------------------------+
|
||||
| .. macro:: SANE_CONSTRAINT_WORD_LIST | 2 | This constraint is applicable |
|
||||
| | | to integer and fixed-point valued options only. It constrains the |
|
||||
| | | option value to a list of numeric values. Option descriptor member |
|
||||
| | | :member:`constraint.word_list` points to a list of words that |
|
||||
| | | enumerates the legal values. The first element in that list is an |
|
||||
| | | integer (:type:`SANE_Int`) that specifies the length of the list (not |
|
||||
| | | counting the length itself). The remaining elements in the list are |
|
||||
| | | interpreted according to the type of the option value |
|
||||
| | | (:macro:`SANE_TYPE_INT` or :macro:`SANE_TYPE_FIXED`). |
|
||||
+----------------------------------------+------+--------------------------------------------------------------------------------+
|
||||
| .. macro:: SANE_CONSTRAINT_STRING_LIST | 3 | This constraint is |
|
||||
| | | applicable to string-valued options only. It constrains the option |
|
||||
| | | value to a list of strings. The option descriptor member |
|
||||
| | | :member:`constraint.string_list` points to a :macro:`NULL` terminated |
|
||||
| | | list of strings that enumerate the legal values for the option |
|
||||
| | | value. |
|
||||
+----------------------------------------+------+--------------------------------------------------------------------------------+
|
||||
|
||||
Operations
|
||||
----------
|
||||
|
@ -1258,82 +1234,68 @@ of this argument is described in more detail below.
|
|||
The way the option is affected by a call to this function is controlled
|
||||
by parameter :data:`a` which is a value of type
|
||||
:type:`SANE_Action`. The possible values and their
|
||||
meaning is described in Table :raw-latex:`\ref{tab:actions}`.
|
||||
meaning is described in Table :ref:`tab:actions`.
|
||||
|
||||
:raw-latex:`\leavevmode`
|
||||
.. table:: Action Values (:type:`SANE_Action`)
|
||||
:name: tab:actions
|
||||
:align: center
|
||||
|
||||
.. raw:: latex
|
||||
|
||||
\begin{tabular}{|l|r|p{0.5\textwidth}|}
|
||||
\hline
|
||||
\multicolumn{1}{|c|}{\bf Symbol} &
|
||||
\multicolumn{1}{|c|}{\bf Code} &
|
||||
\multicolumn{1}{|c|}{\bf Description} \\
|
||||
|
||||
\hline\hline
|
||||
|
||||
\code{\defn{SANE_ACTION_GET_VALUE}} & 0 & Get current option value. \\
|
||||
|
||||
\code{\defn{SANE_ACTION_SET_VALUE}} & 1 & Set option value. The
|
||||
option value passed through argument \code{v} may be modified by the
|
||||
backend if the value cannot be set exactly. \\
|
||||
|
||||
\code{\defn{SANE_ACTION_SET_AUTO}} & 2 & Turn on automatic mode. Backend
|
||||
or device will automatically select an appropriate value. This mode
|
||||
remains effective until overridden by an explicit set value request.
|
||||
The value of parameter \code{v} is completely ignored in this case and
|
||||
may be \code{NULL}. \\
|
||||
|
||||
\hline
|
||||
\end{tabular}
|
||||
+----------------------------------+------+-------------------------------------------------------------------------+
|
||||
| Symbol | Code | Description |
|
||||
+==================================+======+=========================================================================+
|
||||
| .. macro:: SANE_ACTION_GET_VALUE | 0 | Get current option value. |
|
||||
+----------------------------------+------+-------------------------------------------------------------------------+
|
||||
| .. macro:: SANE_ACTION_SET_VALUE | 1 | Set option value. The |
|
||||
| | | option value passed through argument :data:`v` may be modified by the |
|
||||
| | | backend if the value cannot be set exactly. |
|
||||
+----------------------------------+------+-------------------------------------------------------------------------+
|
||||
| .. macro:: SANE_ACTION_SET_AUTO | 2 | Turn on automatic mode. Backend |
|
||||
| | | or device will automatically select an appropriate value. This mode |
|
||||
| | | remains effective until overridden by an explicit set value request. |
|
||||
| | | The value of parameter :data:`v` is completely ignored in this case and |
|
||||
| | | may be :macro:`NULL`. |
|
||||
+----------------------------------+------+-------------------------------------------------------------------------+
|
||||
|
||||
After setting a value via an action value of :macro:`SANE_ACTION_SET_VALUE`,
|
||||
additional information on how well the request has been met is returned
|
||||
in :data:`*i` (if :data:`i` is
|
||||
non-:macro:`NULL`). The returned value is a bitset that may
|
||||
contain any combination of the values described in
|
||||
Table :raw-latex:`\ref{tab:info}`.
|
||||
Table :ref:`tab:info`.
|
||||
|
||||
:raw-latex:`\leavevmode`
|
||||
.. table:: Additional Information Returned When Setting an Option
|
||||
:name: tab:info
|
||||
:align: center
|
||||
|
||||
.. raw:: latex
|
||||
|
||||
\begin{tabular}{|l|r|p{0.5\textwidth}|}
|
||||
\hline
|
||||
\multicolumn{1}{|c|}{\bf Symbol} &
|
||||
\multicolumn{1}{|c|}{\bf Code} &
|
||||
\multicolumn{1}{|c|}{\bf Description} \\
|
||||
|
||||
\hline\hline
|
||||
|
||||
\code{\defn{SANE_INFO_INEXACT}} & 1 & This value is returned when
|
||||
setting an option value resulted in a value being selected that does
|
||||
not exactly match the requested value. For example, if a scanner
|
||||
can adjust the resolution in increments of 30dpi only, setting the
|
||||
resolution to 307dpi may result in an actual setting of 300dpi.
|
||||
When this happens, the bitset returned in \code{*i} has this member
|
||||
set. In addition, the option value is modified to reflect the
|
||||
actual (rounded) value that was used by the backend. Note that
|
||||
inexact values are admissible for strings as well. A backend may
|
||||
choose to ``round'' a string to the closest matching legal string
|
||||
for a constrained string value. \\
|
||||
|
||||
\code{\defn{SANE_INFO_RELOAD_OPTIONS}} & 2 & The setting of an
|
||||
option may affect the value or availability of one or more {\em
|
||||
other\/} options. When this happens, the SANE backend sets this
|
||||
member in \code{*i} to indicate that the application should reload
|
||||
all options. This member may be set if and only if at least one
|
||||
option changed. \\
|
||||
|
||||
\code{\defn{SANE_INFO_RELOAD_PARAMS}} & 4 & The setting of an option may
|
||||
affect the parameter values (see \code{sane_get_parameters()}).
|
||||
If setting an option affects the parameter values, this member will
|
||||
be set in \code{*i}. Note that this member may be set even if the
|
||||
parameters did not actually change. However, it is guaranteed that
|
||||
the parameters never change without this member being set. \\
|
||||
|
||||
\hline
|
||||
\end{tabular}
|
||||
+-------------------------------------+------+----------------------------------------------------------------------+
|
||||
| Symbol | Code | Description |
|
||||
+=====================================+======+======================================================================+
|
||||
| .. macro:: SANE_INFO_INEXACT | 1 | This value is returned when |
|
||||
| | | setting an option value resulted in a value being selected that does |
|
||||
| | | not exactly match the requested value. For example, if a scanner |
|
||||
| | | can adjust the resolution in increments of 30dpi only, setting the |
|
||||
| | | resolution to 307dpi may result in an actual setting of 300dpi. |
|
||||
| | | When this happens, the bitset returned in :data:`*i` has this member |
|
||||
| | | set. In addition, the option value is modified to reflect the |
|
||||
| | | actual (rounded) value that was used by the backend. Note that |
|
||||
| | | inexact values are admissible for strings as well. A backend may |
|
||||
| | | choose to "round" a string to the closest matching legal string |
|
||||
| | | for a constrained string value. |
|
||||
+-------------------------------------+------+----------------------------------------------------------------------+
|
||||
| .. macro:: SANE_INFO_RELOAD_OPTIONS | 2 | The setting of an |
|
||||
| | | option may affect the value or availability of one or more |
|
||||
| | | *other* options. When this happens, the SANE backend sets this |
|
||||
| | | member in :data:`*i` to indicate that the application should reload |
|
||||
| | | all options. This member may be set if and only if at least one |
|
||||
| | | option changed. |
|
||||
+-------------------------------------+------+----------------------------------------------------------------------+
|
||||
| .. macro:: SANE_INFO_RELOAD_PARAMS | 4 | The setting of an option may |
|
||||
| | | affect the parameter values (see :func:`sane_get_parameters()`). |
|
||||
| | | If setting an option affects the parameter values, this member will |
|
||||
| | | be set in :data:`*i`. Note that this member may be set even if the |
|
||||
| | | parameters did not actually change. However, it is guaranteed that |
|
||||
| | | the parameters never change without this member being set. |
|
||||
+-------------------------------------+------+----------------------------------------------------------------------+
|
||||
|
||||
This function may fail with one of the following status codes.
|
||||
|
||||
|
@ -1401,29 +1363,26 @@ structure is given below.
|
|||
Member :member:`format` specifies the format of the next frame
|
||||
to be returned. The possible values for type
|
||||
:type:`SANE_Frame` are described in
|
||||
Table :raw-latex:`\ref{tab:frameformat}`. The meaning of these values is
|
||||
Table :ref:`tab:frameformat`. The meaning of these values is
|
||||
described in more detail in Section :raw-latex:`\ref{sec:imageformat}`.
|
||||
|
||||
:raw-latex:`\leavevmode`
|
||||
.. table:: Frame Format (:type:`SANE_Frame`)
|
||||
:name: tab:frameformat
|
||||
:align: center
|
||||
|
||||
.. raw:: latex
|
||||
|
||||
\begin{tabular}{|l|r|l|}
|
||||
\hline
|
||||
\multicolumn{1}{|c|}{\bf Symbol} &
|
||||
\multicolumn{1}{|c|}{\bf Code} &
|
||||
\multicolumn{1}{|c|}{\bf Description} \\
|
||||
|
||||
\hline\hline
|
||||
|
||||
\code{\defn{SANE_FRAME_GRAY}} & 0 & Band covering human visual range. \\
|
||||
\code{\defn{SANE_FRAME_RGB}} & 1 & Pixel-interleaved red/green/blue bands. \\
|
||||
\code{\defn{SANE_FRAME_RED}} & 2 & Red band of a red/green/blue image. \\
|
||||
\code{\defn{SANE_FRAME_GREEN}} & 3 & Green band of a red/green/blue image. \\
|
||||
\code{\defn{SANE_FRAME_BLUE}} & 4 & Blue band of a red/green/blue image. \\
|
||||
|
||||
\hline
|
||||
\end{tabular}
|
||||
+-----------------------------+------+-----------------------------------------+
|
||||
| Symbol | Code | Description |
|
||||
+=============================+======+=========================================+
|
||||
| .. macro:: SANE_FRAME_GRAY | 0 | Band covering human visual range. |
|
||||
+-----------------------------+------+-----------------------------------------+
|
||||
| .. macro:: SANE_FRAME_RGB | 1 | Pixel-interleaved red/green/blue bands. |
|
||||
+-----------------------------+------+-----------------------------------------+
|
||||
| .. macro:: SANE_FRAME_RED | 2 | Red band of a red/green/blue image. |
|
||||
+-----------------------------+------+-----------------------------------------+
|
||||
| .. macro:: SANE_FRAME_GREEN | 3 | Green band of a red/green/blue image. |
|
||||
+-----------------------------+------+-----------------------------------------+
|
||||
| .. macro:: SANE_FRAME_BLUE | 4 | Blue band of a red/green/blue image. |
|
||||
+-----------------------------+------+-----------------------------------------+
|
||||
|
||||
Member :member:`last_frame` is set to
|
||||
:macro:`SANE_TRUE` if and only if the frame that is currently
|
||||
|
|
Ładowanie…
Reference in New Issue