#define jpg_center &h10000000

'renders from file to screen
declare sub jpeg2screen(jpg_file as string,x0 as integer=jpg_center,_
                        y0 as integer=jpg_center,x1 as integer=0,_
                        y1 as integer=0,x2 as integer=-1,y2 as integer=-1)

'creates a PUT buffer and renders a secttion of the file to it
declare function jpegget(jpg_file as string,x as integer=-1,y as integer=-1,_
                         x0 as integer=jpg_center,y0 as integer=jpg_center) as any ptr

'creates a put buffer and renders a section of a jpeg stored in a buffer  to it
declare function jpeggetmem(jpegptr as ubyte ptr, jpegsize as uinteger,x as integer=-1,_
                            y as integer =-1,x0 as integer =jpg_center,_
                            y0 as integer=jpg_center) as any ptr

'prints a string from the error number returned from the renderer
declare FUNCTION printerror as string

'reads the frame size from a jpeg file *****
declare sub jpegframesize (byval jpg_file as string, byref sizex as integer, byref sizey as integer,_
                           byref components as integer, byref fmt as integer)

'error codes
#define err_ok        0
#define err_escpress  100  
#define err_nogfxlib  101
#define err_palmode   102
#define err_nofile    103
#define err_fnotfound 104 
#define err_fnotexist 105
#define err_fnojpeg   106
#define err_fnoframe  107
#define err_progframe 108
#define err_diffframe 109
#define err_arithcode 110
#define err_quantprec 111
#define err_mt2huff   112
#define err_soimispl  113
#define err_smplsz    114
#define err_mt3comp   115 
#define err_notalltbl 116
#define err_mt2qtbl   117
#define err_a0notjfif 118
#define err_markunk   119
#define err_putbuff   120
#define err_scrbuff   121 
#define err_getoutl   122

common shared jpegerr as integer ',errtxt as string
