Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Flipper 6.0 Help File - <b>hps_setup()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
HPS_SETUP()
   Sets a scanner parameter.

   Syntax
         nStatus = HPS_SETUP(nItem,nParam1,nParam2,nParam3,nParam4)

   Arguments
         nItem       The scanner parameter you wish to set.
               +-----------------------------------------------------+
               |Value|nItem        |Parameters                       |
               |-----+-------------+---------------------------------|
               |   1 |SCALE        |nXScaleFacter,nYScaleFactor      |
               |   2 |DECI_WIN     |XDeci,YDeci,XOffset,YOffset      |
               |   3 |PEL_WIN      |XPixel,YPixel,XOffset,YOffset    |
               |   4 |RESOLUTION   |nXresolution,nYresolution        |
               |   5 |DO_DITHER    |nDither                          |
               |   6 |DO_GRAY_SCALE|nBits                            |
               |  16 |INTENSITY    |nIntensity                       |
               |  17 |CONTRAST     |nContrast (-127 to 127)          |
               |  18 |NEGATIVE     |nInverse (0,1)                   |
               |  19 |MIRROR       |nMirror (0,1)                    |
               |  20 |AUTO_BGRND   |nAutoback (0-off, 1-on)          |
               |  21 |DATA_TYPE    |nType (0-4)                      |
               |  22 |BITS_PER_P   |nBitsPerPixel (1 or 4)           |
               |  23 |DITHER_PAT   |nDitherPat                       |
               +-----------------------------------------------------+

         nValue1-4   The number of arguments is dependent on the parameter you
                     wish to change.

   Returns
         nStatus
               +----------------------------------------------+
               |nStatus|Description       |Type               |
               |-------+------------------+-------------------|
               |    0  |OKAY              |No Error           |
               --------+------------------+-------------------|
               |    1  |NO_ACCESS         |Communication Error|
               |    2  |BAD_ACCESS        |                   |
               |    3  |BAD_COMMAND       |                   |
               |    4  |BAD_RESPONSE      |                   |
               |    5  |NULL_RESPONSE     |                   |
               --------+------------------+-------------------|
               |    6  |BAD_CMD_FORMAT    |Scanner Error      |
               |    7  |ILLEGAL_CMD       |                   |
               |    8  |ILLEGAL_WND       |                   |
               |    9  |PARAM_ERR         |                   |
               |   10  |SCALE_ERR         |                   |
               |   11  |DITHER_ERR        |                   |
               |   12  |TONE_MAP_ERR      |                   |
               |   13  |LAMP_ERR          |                   |
               |   14  |ADF_JAM           |                   |
               |   15  |HOME_MISSING      |                   |
               |   16  |SCAN_ERR          |                   |
               |   17  |HPS_FILE_OPEN_ERR |                   |
               |   18  |HPS_FILE_WRITE_ERR|                   |
               |   19  |OUT_OF_MEM_ERR    |                   |
               +----------------------------------------------+

   Description
         HPS_SETUP() is a general function that allows you to set scanner
         parameters.

         16 Set Intensity Level controls the "lightness" or "darkness"
            of the scanned image. The nIntensity parameter is in the
            range from -1 (dark), 0 (normal), to +1 (light) for the ScanJet,
            and -127 to +127 for the ScanJetplus. This command works only
            in threshold and dither modes. It has no effect in grayscale
            mode nor for black or white data types.

         17 Controls the difference between light and dark in the scanned
            image. nContrast can be in the range from -127 to 127 for a
            total of 255 contrast levels. The default contrast level is
            0 (normal). A positive value results in a larger difference
            and a negative value results in a smaller difference. This
            command affects dithered and grayscale data types when tone
            map 0 is used.

         18 nInverse inverts the sense of the data from the current
            window. A value of 0 causes the ScanJet to return higher data
            values for higher optical densities. A value of 1 causes
            ScanJet to invert the data. The default value is 0.

         19 Turns the "mirror image" feature on and off. When nMirror
            is 1, the order of the data is reversed in the primary
            scanning direction. When nMirror is 0, the feature is set
            to normal. The default value is 0.

         20 Set Automatic Background Control turns the automatic background
            control feature on or off. A value of 0 is interpreted as off;
            a value of 1 turns it on. The default is off. This commands works
            only in thresholded mode. It has no effect in other modes. When
            Automatic Background Control is on, the intensity and contrast are
            disabled.

         21 The following command controls the type of data the scanner
            will return.
               0 - Threshold (default)
                   Black and white data represented as one bit per pixel.
                   The data for a given pixel is defined to be 1 if the
                   image optical density at that location is above a
                   threshold.
               1 - White
               2 - Black
               3 - Dithered Data
                   Grayscale data represents the reflected image at each
                   pixel with a 4-bit number (0 to 15). The number represents
                   image optical density from 0 (white) to 15 (black). Flipper
                   will not return an 8-bit number yet.
               4 - Grayscale (Dithered data)
                   Represents multi-level grayscale data in a 1-bit-per-pixel
                   form. The ScanJet supports four pre-defined dither
                   patterns. Dither patterns supported are 8x8 Fatting, 4x4
                   Fatting, 4x4 Bayer, and 4x4 vertical line. Each dither
                   pattern has its own advantages and disadvantages. 8x8
                   Fatting photocopies best but sacrifices resolution. 4x4
                   Bayer has the best resolution but produces poor
                   photocopies. 4x4 Fatting and 4x4 vertical line result in
                   average resolution and photocopy abilities.

         22 Selects the format in which data are sent to the host. A value of
            4 for nBitsPerPixel sends the data in two 4-bits-per-pixel bytes.
            A value of 1 sends the data as eight, 1-bit-per-pixel words.

         23 Selects the dither pattern associated with the current window.
            Each dither pattern has an associated number. Dither patterns
            supported are:
                  0: 8x8 Fatting
                  1: 4x4 Fatting
                  2: 4x4 Bayer
                  3: 4x4 vertical line

   Examples
         nStatus = HPS_SETUP(1,nXScaleFacter,nYScaleFactor)
         nStatus = HPS_SETUP(2,nXDeci,nYDeci,nXOffset,nYOffset)
         nStatus = HPS_SETUP(3,nXPixel,nYPixel,nXOffset,nYOffset)

See Also: HPS_INQ() HPS_PRINT() HPS_RESET() HPS_SCAN() HPS_STATE()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson