proc imrcatv
	local	0,001000,imr1
	local	1,001000,imr2
	local	2,000020,imr
	local	3,000000,ImageRecord
	declend
	filen	imrutils.icn
	line	84
	colm	11
	mark	L1
	pnull
	var	2
	var	3
	line	87
	colm	22
	invoke	0
	line	87
	colm	8
	asgn
	unmark
lab L1
	mark	L2
	pnull
	pnull
	var	2
	line	88
	colm	7
	field	width
	pnull
	var	0
	line	88
	colm	21
	field	width
	line	88
	colm	14
	asgn
	unmark
lab L2
	mark	L3
	pnull
	pnull
	var	2
	line	89
	colm	7
	field	palette
	pnull
	var	0
	line	89
	colm	23
	field	palette
	line	89
	colm	16
	asgn
	unmark
lab L3
	mark	L4
	pnull
	pnull
	var	2
	line	90
	colm	7
	field	pixels
	pnull
	pnull
	var	0
	line	90
	colm	22
	field	pixels
	pnull
	var	1
	line	90
	colm	37
	field	pixels
	line	90
	colm	30
	cat
	line	90
	colm	15
	asgn
	unmark
lab L4
	mark	L5
	mark	L6
	var	2
	line	92
	colm	4
	pret
lab L6
	pfail
	unmark
lab L5
	pnull
	line	94
	colm	1
	pfail
	end
proc imrdraw
	local	0,001000,win
	local	1,001000,x
	local	2,001000,y
	local	3,001000,imr
	local	4,000000,type
	local	5,000000,runerr
	local	6,000000,DrawImage
	local	7,000000,imrtoims
	con	0,010000,6,167,151,156,144,157,167
	con	1,002000,3,140
	con	2,002000,1,0
	declend
	line	96
	colm	11
	mark	L1
	mark0
	pnull
	var	4
	var	0
	line	98
	colm	11
	invoke	1
	str	0
	line	98
	colm	17
	lexne
	unmark
	mark	L2
	pnull
	var	0
	pnull
	var	1
	pnull
	var	2
	var	3
	line	99
	colm	23
	swap
	line	99
	colm	17
	swap
	line	99
	colm	11
	swap
	unmark
lab L2
	pnull
	var	0
	mark	L3
	pnull
	line	100
	colm	15
	keywd	window
	line	100
	colm	14
	nonnull
	esusp
	goto	L4
lab L3
	var	5
	int	1
	line	100
	colm	37
	keywd	window
	line	100
	colm	31
	invoke	2
lab L4
	line	100
	colm	11
	asgn
	unmark
lab L1
	mark	L5
	pnull
	pnull
	var	1
	line	103
	colm	4
	null
	int	2
	line	103
	colm	7
	asgn
	unmark
lab L5
	mark	L6
	pnull
	pnull
	var	2
	line	104
	colm	4
	null
	int	2
	line	104
	colm	7
	asgn
	unmark
lab L6
	mark	L7
	mark	L8
	var	6
	var	0
	var	1
	var	2
	var	7
	var	3
	line	106
	colm	40
	invoke	1
	line	106
	colm	20
	invoke	4
	line	106
	colm	4
	pret
lab L8
	pfail
	unmark
lab L7
	pnull
	line	108
	colm	1
	pfail
	end
proc imrflipd
	local	0,001000,imr
	local	1,000020,height
	local	2,000020,columns
	local	3,000020,i
	local	4,000020,row
	local	5,000000,list
	local	6,000000,move
	con	0,010000,0
	con	1,002000,1,1
	declend
	line	110
	colm	11
	mark	L1
	pnull
	var	1
	pnull
	pnull
	pnull
	var	0
	line	113
	colm	18
	field	pixels
	line	113
	colm	14
	size
	pnull
	var	0
	line	113
	colm	31
	field	width
	line	113
	colm	26
	div
	line	113
	colm	11
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	2
	var	5
	var	1
	str	0
	line	114
	colm	19
	invoke	2
	line	114
	colm	12
	asgn
	unmark
lab L2
	mark	L3
	pnull
	var	0
	line	116
	colm	7
	field	pixels
	line	116
	colm	15
	bscan
lab L4
	mark0
	pnull
	var	4
	var	6
	pnull
	var	0
	line	117
	colm	28
	field	width
	line	117
	colm	24
	invoke	1
	line	117
	colm	17
	asgn
	unmark
	mark	L4
	mark0
	pnull
	var	3
	pnull
	int	1
	pnull
	var	0
	line	118
	colm	29
	field	width
	push1
	line	118
	colm	23
	toby
	line	118
	colm	18
	asgn
	pop
	mark0
	pnull
	pnull
	var	2
	var	3
	line	119
	colm	20
	subsc
	dup
	pnull
	var	4
	var	3
	line	119
	colm	32
	subsc
	line	119
	colm	24
	cat
	asgn
	unmark
lab L7
	efail
lab L8
lab L5
	unmark
	goto	L4
lab L6
	line	116
	colm	15
	escan
	unmark
lab L3
	mark	L9
	pnull
	pnull
	var	0
	line	122
	colm	7
	field	pixels
	str	0
	line	122
	colm	15
	asgn
	unmark
lab L9
	mark	L10
	mark0
	pnull
	pnull
	var	0
	line	124
	colm	13
	field	pixels
	dup
	pnull
	var	2
	line	124
	colm	26
	bang
	line	124
	colm	21
	cat
	asgn
	pop
lab L11
	efail
lab L12
	unmark
lab L10
	mark	L13
	pnull
	pnull
	var	0
	line	126
	colm	7
	field	width
	var	1
	line	126
	colm	14
	asgn
	unmark
lab L13
	mark	L14
	mark	L15
	var	0
	line	128
	colm	4
	pret
lab L15
	pfail
	unmark
lab L14
	pnull
	line	130
	colm	1
	pfail
	end
proc imrfliph
	local	0,001000,imr
	local	1,000020,pixels
	local	2,000000,reverse
	local	3,000000,move
	con	0,010000,0
	declend
	line	132
	colm	11
	mark	L1
	pnull
	var	1
	str	0
	line	135
	colm	11
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	0
	line	137
	colm	7
	field	pixels
	line	137
	colm	15
	bscan
lab L3
	mark0
	pnull
	var	1
	dup
	var	2
	var	3
	pnull
	var	0
	line	138
	colm	41
	field	width
	line	138
	colm	37
	invoke	1
	line	138
	colm	32
	invoke	1
	line	138
	colm	20
	cat
	asgn
lab L4
	unmark
	goto	L3
lab L5
	line	137
	colm	15
	escan
	unmark
lab L2
	mark	L6
	pnull
	pnull
	var	0
	line	141
	colm	7
	field	pixels
	var	1
	line	141
	colm	15
	asgn
	unmark
lab L6
	mark	L7
	mark	L8
	var	0
	line	143
	colm	4
	pret
lab L8
	pfail
	unmark
lab L7
	pnull
	line	145
	colm	1
	pfail
	end
proc imrflipv
	local	0,001000,imr
	local	1,000020,pixels
	local	2,000000,move
	con	0,010000,0
	declend
	line	147
	colm	11
	mark	L1
	pnull
	var	1
	str	0
	line	150
	colm	11
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	0
	line	152
	colm	7
	field	pixels
	line	152
	colm	15
	bscan
lab L3
	mark0
	pnull
	var	1
	pnull
	var	2
	pnull
	var	0
	line	153
	colm	31
	field	width
	line	153
	colm	27
	invoke	1
	var	1
	line	153
	colm	39
	cat
	line	153
	colm	20
	asgn
lab L4
	unmark
	goto	L3
lab L5
	line	152
	colm	15
	escan
	unmark
lab L2
	mark	L6
	pnull
	pnull
	var	0
	line	156
	colm	7
	field	pixels
	var	1
	line	156
	colm	15
	asgn
	unmark
lab L6
	mark	L7
	mark	L8
	var	0
	line	158
	colm	4
	pret
lab L8
	pfail
	unmark
lab L7
	pnull
	line	160
	colm	1
	pfail
	end
proc imrnegative
	local	0,001000,imr
	local	1,000020,chars
	local	2,000000,PaletteChars
	local	3,000000,map
	local	4,000000,reverse
	declend
	line	162
	colm	11
	mark	L1
	pnull
	var	1
	var	2
	pnull
	var	0
	line	165
	colm	29
	field	palette
	line	165
	colm	25
	invoke	1
	line	165
	colm	10
	asgn
	unmark
lab L1
	mark	L2
	pnull
	pnull
	var	0
	line	167
	colm	7
	field	pixels
	var	3
	pnull
	var	0
	line	167
	colm	25
	field	pixels
	var	1
	var	4
	var	1
	line	167
	colm	48
	invoke	1
	line	167
	colm	21
	invoke	3
	line	167
	colm	15
	asgn
	unmark
lab L2
	mark	L3
	mark	L4
	var	0
	line	169
	colm	4
	pret
lab L4
	pfail
	unmark
lab L3
	pnull
	line	171
	colm	1
	pfail
	end
proc imropen
	local	0,001000,imr
	local	1,000020,win
	local	2,000000,WOpen
	local	3,000000,imrdraw
	local	4,000000,WClose
	con	0,010000,13,143,141,156,166,141,163,075,150,151,144,144,145,156
	con	1,010000,5,163,151,172,145,075
	con	2,010000,1,054
	con	3,002000,1,0
	declend
	line	173
	colm	11
	mark	L1
	pnull
	var	1
	var	2
	str	0
	pnull
	pnull
	pnull
	str	1
	pnull
	var	0
	line	176
	colm	47
	field	width
	line	176
	colm	41
	cat
	str	2
	line	176
	colm	54
	cat
	pnull
	pnull
	pnull
	var	0
	line	177
	colm	11
	field	pixels
	line	177
	colm	7
	size
	pnull
	var	0
	line	177
	colm	24
	field	width
	line	177
	colm	19
	div
	line	176
	colm	61
	cat
	line	176
	colm	16
	invoke	2
	line	176
	colm	8
	asgn
	unmark
lab L1
	mark	L2
	mark	L3
	var	3
	var	1
	int	3
	int	3
	var	0
	line	179
	colm	11
	invoke	4
	esusp
	goto	L4
lab L3
	mark	L5
	var	4
	var	1
	line	180
	colm	13
	invoke	1
	unmark
lab L5
	line	181
	colm	7
	pfail
lab L4
	unmark
lab L2
	mark	L6
	mark	L7
	var	1
	line	184
	colm	4
	pret
lab L7
	pfail
	unmark
lab L6
	pnull
	line	186
	colm	1
	pfail
	end
proc imrpshift
	local	0,001000,imr
	local	1,001000,i
	local	2,000020,chars
	local	3,000000,PaletteChars
	local	4,000000,map
	local	5,000000,rotate
	declend
	line	188
	colm	11
	mark	L1
	pnull
	var	2
	var	3
	pnull
	var	0
	line	191
	colm	29
	field	palette
	line	191
	colm	25
	invoke	1
	line	191
	colm	10
	asgn
	unmark
lab L1
	mark	L2
	pnull
	pnull
	var	0
	line	193
	colm	7
	field	pixels
	var	4
	pnull
	var	0
	line	193
	colm	25
	field	pixels
	var	2
	var	5
	var	2
	var	1
	line	193
	colm	47
	invoke	2
	line	193
	colm	21
	invoke	3
	line	193
	colm	15
	asgn
	unmark
lab L2
	mark	L3
	mark	L4
	var	0
	line	195
	colm	4
	pret
lab L4
	pfail
	unmark
lab L3
	pnull
	line	197
	colm	1
	pfail
	end
proc imrrot180
	local	0,001000,imr
	local	1,000000,reverse
	declend
	line	199
	colm	11
	mark	L1
	pnull
	pnull
	var	0
	line	201
	colm	7
	field	pixels
	var	1
	pnull
	var	0
	line	201
	colm	29
	field	pixels
	line	201
	colm	25
	invoke	1
	line	201
	colm	15
	asgn
	unmark
lab L1
	mark	L2
	mark	L3
	var	0
	line	203
	colm	4
	pret
lab L3
	pfail
	unmark
lab L2
	pnull
	line	205
	colm	1
	pfail
	end
proc imrrot90cw
	local	0,001000,imr
	local	1,000020,height
	local	2,000020,columns
	local	3,000020,i
	local	4,000020,row
	local	5,000000,list
	local	6,000000,move
	con	0,010000,0
	con	1,002000,1,1
	declend
	line	207
	colm	11
	mark	L1
	pnull
	var	1
	pnull
	pnull
	pnull
	var	0
	line	210
	colm	18
	field	pixels
	line	210
	colm	14
	size
	pnull
	var	0
	line	210
	colm	31
	field	width
	line	210
	colm	26
	div
	line	210
	colm	11
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	2
	var	5
	pnull
	var	0
	line	211
	colm	23
	field	width
	str	0
	line	211
	colm	19
	invoke	2
	line	211
	colm	12
	asgn
	unmark
lab L2
	mark	L3
	pnull
	var	0
	line	213
	colm	7
	field	pixels
	line	213
	colm	15
	bscan
lab L4
	mark0
	pnull
	var	4
	var	6
	pnull
	var	0
	line	214
	colm	28
	field	width
	line	214
	colm	24
	invoke	1
	line	214
	colm	17
	asgn
	unmark
	mark	L4
	mark0
	pnull
	var	3
	pnull
	int	1
	pnull
	var	0
	line	215
	colm	29
	field	width
	push1
	line	215
	colm	23
	toby
	line	215
	colm	18
	asgn
	pop
	mark0
	pnull
	pnull
	var	2
	var	3
	line	216
	colm	20
	subsc
	pnull
	pnull
	var	4
	var	3
	line	216
	colm	30
	subsc
	pnull
	var	2
	var	3
	line	216
	colm	44
	subsc
	line	216
	colm	34
	cat
	line	216
	colm	24
	asgn
	unmark
lab L7
	efail
lab L8
lab L5
	unmark
	goto	L4
lab L6
	line	213
	colm	15
	escan
	unmark
lab L3
	mark	L9
	pnull
	pnull
	var	0
	line	219
	colm	7
	field	pixels
	str	0
	line	219
	colm	15
	asgn
	unmark
lab L9
	mark	L10
	mark0
	pnull
	pnull
	var	0
	line	221
	colm	13
	field	pixels
	dup
	pnull
	var	2
	line	221
	colm	26
	bang
	line	221
	colm	21
	cat
	asgn
	pop
lab L11
	efail
lab L12
	unmark
lab L10
	mark	L13
	pnull
	pnull
	var	0
	line	223
	colm	7
	field	width
	var	1
	line	223
	colm	14
	asgn
	unmark
lab L13
	mark	L14
	mark	L15
	var	0
	line	225
	colm	4
	pret
lab L15
	pfail
	unmark
lab L14
	pnull
	line	227
	colm	1
	pfail
	end
proc imrshifth
	local	0,001000,imr
	local	1,001000,i
	local	2,000000,rotate
	declend
	line	233
	colm	11
	mark	L1
	pnull
	pnull
	var	0
	line	235
	colm	7
	field	pixels
	var	2
	pnull
	var	0
	line	235
	colm	28
	field	pixels
	var	1
	line	235
	colm	24
	invoke	2
	line	235
	colm	15
	asgn
	unmark
lab L1
	mark	L2
	mark	L3
	var	0
	line	237
	colm	4
	pret
lab L3
	pfail
	unmark
lab L2
	pnull
	line	239
	colm	1
	pfail
	end
proc imrshiftv
	local	0,001000,imr
	local	1,001000,i
	local	2,000000,rotate
	con	0,002000,1,1
	declend
	line	243
	colm	11
	mark	L1
	pnull
	pnull
	var	1
	line	245
	colm	4
	null
	int	0
	line	245
	colm	7
	asgn
	unmark
lab L1
	mark	L2
	pnull
	pnull
	var	0
	line	247
	colm	7
	field	pixels
	var	2
	pnull
	var	0
	line	247
	colm	28
	field	pixels
	pnull
	var	1
	pnull
	var	0
	line	247
	colm	44
	field	width
	line	247
	colm	39
	mult
	line	247
	colm	24
	invoke	2
	line	247
	colm	15
	asgn
	unmark
lab L2
	mark	L3
	mark	L4
	var	0
	line	249
	colm	4
	pret
lab L4
	pfail
	unmark
lab L3
	pnull
	line	251
	colm	1
	pfail
	end
proc imrtoims
	local	0,001000,imr
	con	0,010000,1,054
	declend
	line	253
	colm	11
	mark	L1
	mark	L2
	pnull
	pnull
	pnull
	pnull
	pnull
	var	0
	line	255
	colm	14
	field	width
	str	0
	line	255
	colm	21
	cat
	pnull
	var	0
	line	255
	colm	34
	field	palette
	line	255
	colm	28
	cat
	str	0
	line	255
	colm	43
	cat
	pnull
	var	0
	line	255
	colm	56
	field	pixels
	line	255
	colm	50
	cat
	line	255
	colm	4
	pret
lab L2
	pfail
	unmark
lab L1
	pnull
	line	257
	colm	1
	pfail
	end
proc imstoimr
	local	0,001000,s
	local	1,000020,imr
	local	2,000000,ImageRecord
	local	3,000000,tab
	local	4,000000,upto
	local	5,000000,move
	con	0,020000,1,054
	con	1,002000,1,1
	con	2,002000,1,0
	declend
	line	259
	colm	11
	mark	L1
	pnull
	var	1
	var	2
	line	262
	colm	22
	invoke	0
	line	262
	colm	8
	asgn
	unmark
lab L1
	mark	L2
	var	0
	line	264
	colm	6
	bscan
	mark	L3
	pnull
	pnull
	var	1
	line	265
	colm	10
	field	width
	mark	L4
	var	3
	var	4
	cset	0
	line	265
	colm	28
	invoke	1
	line	265
	colm	23
	invoke	1
	esusp
	goto	L5
lab L4
	line	265
	colm	37
	pfail
lab L5
	line	265
	colm	17
	asgn
	unmark
lab L3
	mark	L6
	var	5
	int	1
	line	266
	colm	11
	invoke	1
	unmark
lab L6
	mark	L7
	pnull
	pnull
	var	1
	line	267
	colm	10
	field	palette
	mark	L8
	var	3
	var	4
	cset	0
	line	267
	colm	30
	invoke	1
	line	267
	colm	25
	invoke	1
	esusp
	goto	L9
lab L8
	line	267
	colm	39
	pfail
lab L9
	line	267
	colm	19
	asgn
	unmark
lab L7
	mark	L10
	var	5
	int	1
	line	268
	colm	11
	invoke	1
	unmark
lab L10
	pnull
	pnull
	var	1
	line	269
	colm	10
	field	pixels
	var	3
	int	2
	line	269
	colm	24
	invoke	1
	line	269
	colm	18
	asgn
	line	264
	colm	6
	escan
	unmark
lab L2
	mark	L11
	mark	L12
	var	1
	line	272
	colm	4
	pret
lab L12
	pfail
	unmark
lab L11
	pnull
	line	274
	colm	1
	pfail
	end
