libsc480.so Specifications

Contents
1  Outline
2  API Function
    2.1 libprt_init
    2.2 libprt_page_init
    2.3 libprt_out
    2.4 libprt_page_end
    2.5 libprt_end
3 Error Codes


1 Outline

libsc480.so is a library that converts the RGB data into the ESC/P data.
The user is able to write the codes using this library.


2  API Function

2.1 libprt_init

Initialization of the library.

int
libprt_init (
           HANDLE*,            The pointer to HANDLE used in the internal library.
           LP_LIBPRT_INIT      Initialization structure of the library.
        );

    Return value : Error Code

    Structure :
        typedef struct _LIBPRT_INIT_STRUCT
        {
          FILE* output;         The pointer to output.
          char* paper;          Paper
                                    "A4"        :A4  210x297 mm
                                    "B5"        :B5  182x257 mm
                                    "A5"        :A5 148x210 mm
                                    "LT"        :Letter  8 1/2x11 in
                                    "LGL"       :Legal  8 1/2x14 in
                                    "EXE"       :Executive  7 1/4x10 1/2 in
                                    "HLT"       :Half Letter  5 1/2x8 1/2 in
                                    "A6"        :A6  105x148 mm
                                    "INDEX5"    :Index card  5x8 in
                                    "INDEX8"    :Index card  8x10 in
                                    "ENV10"     :Envelope #10  4 1/8x9 1/2
                                    "ENVDL"     :Envelope DL  110x220 mm
                                    "ENVC6"     :Envelope C6  114x162 mm
                                    "ENV5X8"    :Envelope 132x220 mm
                                    "PHOTO"     :Photo Paper  4x6 in
                                    "PANORAM"   :Panoramic 210x594 mm

          char* format;         Print format
                                    "MONO"  :Black print
                                    "COLOR" :Color print

          char* resol;          Resolution
                                    "120"   :120dpi
                                    "240"   :240dpi
                                    "360"   :360dpi
                                    "720"   :720dpi

          char* high_speed;     High Speed Print
                                    "ON"    :Bi-directional Print
                                    "OFF"   :Simplex Print

          char* bin_id;         Paper Source
                                    "AUTO"  :Auto Sheet Feeder

          char* media_type;     Media Type
                                    "PLAIN"  :Plain Paper
                                    "FINE"   :360dpi Ink Jet Paper
                                    "SFINE"  :Photo Quality Ink Jet Paper
                                    "GPAPER" :Photo Paper
									"PMMATT" :Matte Paper - Heavyweight
                                    "GFILM"  :Photo Quality Glossy Film
                                    "OHP"    :Ink Jet Transparencies

          char* qlevel;         Quality Level
                                    "DRAFT" :Draft Print
                                    "STD"   :Standard Print
                                    "FINE"  :Fine Print
                                    "PHOTO" :High Print

          POINT margin;         Margin
                                    x = Top Margin[0 - bottom(maximum) value](pixel)
                                    y = Left Margin[0 - right(maximum) value](pixel)

          POINT paper_size;     Paper Size
                                    x = Width(pixel)
                                    y = Length(pixel)

          POINT paper_area;     Print Area
                                    x = Width of printable area(pixel)
                                    y = Length of printable area(pixel)

          void* reserved;       reserved
                                    blank

        } LIBPRT_INIT, *LP_LIBPRT_INIT;



2.2 libprt_page_init

Initialization of the printing.


int
libprt_page_init (
        HANDLE,                 The variable used in the internal library.
        LP_LIBPRT_PAGE          Initialization structure of the page print.
        );

    Return value : Error code

    Structure : 
        typedef struct _LIBPRT_PAGE_STRUCT
        {
          char* color_mode;     Color mode adjustment
                                    "PHOTO" :Photo - realistic
                                    "GRAPH" :Vivid color
                                    "NONE"  :No adjustment

          char* halftone_type;  Halftone Type
                                    "ED"    :High Quality Halftoning

          int brightness;       Brightness                 = [-50 - 50]
          int contrast;         Contrast                   = [-50 - 50]
          int saturation;       Saturation                 = [-50 - 50]
          int r_strength;       Red color compensation     = [-50 - 50]
          int g_strength;       Green color compensation   = [-50 - 50]
          int b_strength;       Blue color compensation    = [-50 - 50]
          void* reserved;       reserved

        } LIBPRT_PAGE, *LP_LIBPRT_PAGE;


2.3  libprt_out

Conversion of RGB data into Printer code.


int
libprt_out (
        HANDLE,                 The variable used in the internal library.
        LP_LIBPRT_BAND          Initialization structure of the print data.
        );

    Return value : Error code

    Structure : 
        typedef struct _LIBPRT_BAND_STRUCT
        {
          long width_pixel;             Values of the raster's pixel
          long width_bytes;             Values of the raster's byte
          unsigned char* byte_data;     Image of raster
          void* reserved;               Reserved
                                            Blank
        } LIBPRT_BAND, *LP_LIBPRT_BAND;


2.4  libprt_page_end

It terminates the printing operation and also sends interruption to the printing operation.


int
libprt_page_end (
        HANDLE,                 The variable used in the internal library.
        int                     Cancel flag
                                    When the process is interrupted by some reasons,
                                    it sets the cancel flag to TRUE.
                                    The cancel flag is normally set at FALSE.
        );

    Return value : Error code


2.5  libprt_end

Terminates the library process.


int
libprt_end (
        HANDLE                   The variable used in the internal library.
        );

    Return value : Error code


3  Error Code

The meaning of the returned value is shown below.

        0   Normal termination
        1   Failed to keep the Memory space
        2   Wrong parameter was given into the input
        3   The function was called in the wrong order
        4   The cause of the error cannot be specified

[EOF]
