Subversion Repositories Kolibri OS

Rev

Rev 1653 | Rev 1717 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1653 Rev 1684
Line 90... Line 90...
90
		mov byte[esi+2],dl
90
		mov byte[esi+2],dl
91
		ror edx,16
91
		ror edx,16
92
	pop esi
92
	pop esi
93
	@@:
93
	@@:
94
	ret
94
	ret
-
 
95
 
95
;endp
96
;input:
-
 
97
; ebx = coord x
-
 
98
; ecx = coord y
-
 
99
; edi = pointer to buffer struct
-
 
100
;output:
-
 
101
; eax = 梥â â®çª¨
-
 
102
; ¢ á«ãç ¥ ®è¨¡ª¨ eax = 0xffffffff
-
 
103
align 4
-
 
104
get_pixel_24:
-
 
105
	mov eax,0xffffffff
-
 
106
 
-
 
107
	bt ebx,31
-
 
108
	jc @f
-
 
109
	bt ecx,31
-
 
110
	jc @f
-
 
111
	cmp ebx,buf2d_w
-
 
112
	jge @f
-
 
113
	cmp ecx,buf2d_h
-
 
114
	jge @f
-
 
115
	push esi
-
 
116
		mov esi,buf2d_w ;size x
-
 
117
		imul esi,ecx ;size_x*y
-
 
118
		add esi,ebx	 ;size_x*y+x
-
 
119
		lea esi,[esi+esi*2] ;(size_x*y+x)*3
-
 
120
		add esi,buf2d_data  ;ptr+(size_x*y+x)*3
-
 
121
 
-
 
122
		xor eax,eax
-
 
123
		mov ax,word[esi] ;copy pixel color
-
 
124
		ror eax,16
-
 
125
		mov al,byte[esi+2]
-
 
126
		ror eax,16
-
 
127
	pop esi
-
 
128
	@@:
-
 
129
	ret
-
 
130
 
Line 96... Line 131...
96
 
131
 
97
;ᮧ¤ ­¨¥ ¡ãä¥à 
132
;ᮧ¤ ­¨¥ ¡ãä¥à 
98
align 4
133
align 4
99
proc buf_create, buf_struc:dword
134
proc buf_create, buf_struc:dword
Line 1000... Line 1035...
1000
 
1035
 
1001
;à¨á®¢ ­¨¥ £®à¨§®­â «ì­®© «¨­¨¨, ¯®â®¬ã ­¥â ¯ à ¬¥âà  coord_y1
1036
;à¨á®¢ ­¨¥ £®à¨§®­â «ì­®© «¨­¨¨, ¯®â®¬ã ­¥â ¯ à ¬¥âà  coord_y1
1002
align 4
1037
align 4
1003
proc buf_line_h, buf_struc:dword, coord_x0:dword, coord_y0:dword, coord_x1:dword, color:dword
1038
proc buf_line_h, buf_struc:dword, coord_x0:dword, coord_y0:dword, coord_x1:dword, color:dword
1004
	pushad
-
 
1005
		mov edx,dword[color]
-
 
1006
 
-
 
1007
		mov eax,edi
1039
	pushad
1008
		mov edi,[buf_struc]
1040
		mov edi,[buf_struc]
1009
		cmp buf2d_bits,24
1041
		cmp buf2d_bits,24
Line 1010... Line 1042...
1010
		jne @f
1042
		jne .end24
1011
 
1043
 
-
 
1044
		mov ebx,dword[coord_x0]
1012
		mov ebx,dword[coord_x0]
1045
		mov ecx,dword[coord_y0]
Line 1013... Line 1046...
1013
		mov ecx,dword[coord_y0]
1046
		mov edx,dword[color]
1014
		mov esi,dword[coord_x1]
1047
		mov esi,dword[coord_x1]
1015
		
1048
		
1016
		@@: ;for (x=x0 ; x
1049
		@@: ;for (x=x0 ; x
1017
			call draw_pixel
1050
			call draw_pixel
1018
			inc ebx
1051
			inc ebx
1019
			cmp ebx,esi
1052
			cmp ebx,esi
-
 
1053
			jge @f
1020
			jge @f
1054
			jmp @b
1021
			jmp @b
1055
		@@:
1022
		@@:
1056
		.end24:
Line 1023... Line 1057...
1023
	popad
1057
	popad
Line 1137... Line 1171...
1137
 
1171
 
1138
	popad
1172
	popad
1139
	ret
1173
	ret
Line -... Line 1174...
-
 
1174
endp
-
 
1175
 
-
 
1176
;äã­ªæ¨ï ¤«ï § «¨¢ª¨ ®¡« á⨠¢ë¡à ­­ë¬ 梥⮬
-
 
1177
align 4
-
 
1178
proc buf_flood_fill, buf_struc:dword, coord_x:dword, coord_y:dword, mode:dword, color_f:dword, color_b:dword
-
 
1179
	pushad
-
 
1180
		mov edi,[buf_struc]
-
 
1181
		cmp buf2d_bits,24
-
 
1182
		jne .end24
-
 
1183
 
-
 
1184
			mov ebx,dword[coord_x]
-
 
1185
			mov ecx,dword[coord_y]
-
 
1186
			mov edx,dword[color_f]
-
 
1187
			mov esi,dword[color_b]
-
 
1188
 
-
 
1189
			cmp dword[mode],1 ;¢ § ¢¨á¨¬®á⨠®â 'mode' ®¯à¥¤¥«ï¥¬ ª ª¨¬  «£®à¨â¬®¬ ¡ã¤¥¬ ¯®«ì§®¢ âìáï
-
 
1190
			je @f
-
 
1191
				call buf_flood_fill_recurs_0 ;§ «¨¢ ¥¬ ¤® ¯¨ªá¥«¥© æ¢¥â  esi
-
 
1192
				jmp .end24
-
 
1193
			@@:
-
 
1194
				call buf_flood_fill_recurs_1 ;§ «¨¢ ¥¬ ¯¨ªá¥«¨ ¨¬¥î騥 梥â esi
-
 
1195
 
-
 
1196
		.end24:
-
 
1197
	popad
-
 
1198
	ret
-
 
1199
endp
-
 
1200
 
-
 
1201
;input:
-
 
1202
; ebx = coord_x
-
 
1203
; ecx = coord_y
-
 
1204
; edx = 梥⠧ «¨¢ª¨
-
 
1205
; esi = 梥⠣࠭¨æë, ¤® ª®â®à®© ¡ã¤¥â ¨â¨ § «¨¢ª 
-
 
1206
; edi = buf_struc
-
 
1207
;output:
-
 
1208
; eax = ¯®àâ¨âáï
-
 
1209
align 4
-
 
1210
buf_flood_fill_recurs_0:
-
 
1211
	call get_pixel_24
-
 
1212
	cmp eax,0xffffffff ;if error coords
-
 
1213
	je .end_fun
-
 
1214
	cmp eax,edx ;¥á«¨ 梥⠯¨ªá¥«ï ᮢ¯ « á 梥⮬ § «¨¢ª¨, §­ ç¨â § «¨¢ª  ¢ í⮩ ®¡« á⨠㦥 ¡ë«  ᤥ« ­ 
-
 
1215
	je .end_fun
-
 
1216
 
-
 
1217
		call draw_pixel
-
 
1218
 
-
 
1219
		dec ebx
-
 
1220
		call get_pixel_24
-
 
1221
		cmp eax,esi
-
 
1222
		je @f
-
 
1223
			call buf_flood_fill_recurs_0
-
 
1224
		@@:
-
 
1225
		inc ebx
-
 
1226
 
-
 
1227
 
-
 
1228
		inc ebx
-
 
1229
		call get_pixel_24
-
 
1230
		cmp eax,esi
-
 
1231
		je @f
-
 
1232
			call buf_flood_fill_recurs_0
-
 
1233
		@@:
-
 
1234
		dec ebx
-
 
1235
 
-
 
1236
		dec ecx
-
 
1237
		call get_pixel_24
-
 
1238
		cmp eax,esi
-
 
1239
		je @f
-
 
1240
			call buf_flood_fill_recurs_0
-
 
1241
		@@:
-
 
1242
		inc ecx
-
 
1243
 
-
 
1244
		inc ecx
-
 
1245
		call get_pixel_24
-
 
1246
		cmp eax,esi
-
 
1247
		je @f
-
 
1248
			call buf_flood_fill_recurs_0
-
 
1249
		@@:
-
 
1250
		dec ecx
-
 
1251
 
-
 
1252
	.end_fun:
-
 
1253
	ret
-
 
1254
 
-
 
1255
;input:
-
 
1256
; ebx = coord_x
-
 
1257
; ecx = coord_y
-
 
1258
; edx = 梥⠧ «¨¢ª¨
-
 
1259
; esi = 梥⠯¨ªá¥«¥©, ¯® ª®â®àë¬ ¡ã¤¥â ¨â¨ § «¨¢ª 
-
 
1260
; edi = buf_struc
-
 
1261
;output:
-
 
1262
; eax = ¯®àâ¨âáï
-
 
1263
align 4
-
 
1264
buf_flood_fill_recurs_1:
-
 
1265
	call get_pixel_24
-
 
1266
	cmp eax,0xffffffff ;if error coords
-
 
1267
	je .end_fun
-
 
1268
	cmp eax,edx ;¥á«¨ 梥⠯¨ªá¥«ï ᮢ¯ « á 梥⮬ § «¨¢ª¨, §­ ç¨â § «¨¢ª  ¢ í⮩ ®¡« á⨠㦥 ¡ë«  ᤥ« ­ 
-
 
1269
	je .end_fun
-
 
1270
	cmp eax,esi ;¥á«¨ 梥⠯¨ªá¥«ï ­¥ ᮢ¯ « á § «¨¢ ¥¬ë¬ 梥⮬ § «¨¢ª¨, â® ¯à¥ªà é ¥¬ § «¨¢ªã
-
 
1271
	jne .end_fun
-
 
1272
 
-
 
1273
		call draw_pixel
-
 
1274
 
-
 
1275
		dec ebx
-
 
1276
		call get_pixel_24
-
 
1277
		cmp eax,esi
-
 
1278
		jne @f
-
 
1279
			call buf_flood_fill_recurs_1
-
 
1280
		@@:
-
 
1281
		inc ebx
-
 
1282
 
-
 
1283
 
-
 
1284
		inc ebx
-
 
1285
		call get_pixel_24
-
 
1286
		cmp eax,esi
-
 
1287
		jne @f
-
 
1288
			call buf_flood_fill_recurs_1
-
 
1289
		@@:
-
 
1290
		dec ebx
-
 
1291
 
-
 
1292
		dec ecx
-
 
1293
		call get_pixel_24
-
 
1294
		cmp eax,esi
-
 
1295
		jne @f
-
 
1296
			call buf_flood_fill_recurs_1
-
 
1297
		@@:
-
 
1298
		inc ecx
-
 
1299
 
-
 
1300
		inc ecx
-
 
1301
		call get_pixel_24
-
 
1302
		cmp eax,esi
-
 
1303
		jne @f
-
 
1304
			call buf_flood_fill_recurs_1
-
 
1305
		@@:
-
 
1306
		dec ecx
-
 
1307
 
-
 
1308
	.end_fun:
1140
endp
1309
	ret
1141
 
1310
 
1142
align 4
1311
align 4
1143
proc buf_img_wdiv2, buf_struc:dword
1312
proc buf_img_wdiv2, buf_struc:dword
1144
	pushad
1313
	pushad
Line 2134... Line 2303...
2134
	dd sz_buf2d_cruve_bezier, buf_cruve_bezier
2303
	dd sz_buf2d_cruve_bezier, buf_cruve_bezier
2135
	dd sz_buf2d_convert_text_matrix, buf_convert_text_matrix
2304
	dd sz_buf2d_convert_text_matrix, buf_convert_text_matrix
2136
	dd sz_buf2d_draw_text, buf_draw_text
2305
	dd sz_buf2d_draw_text, buf_draw_text
2137
	dd sz_buf2d_crop_color, buf_crop_color
2306
	dd sz_buf2d_crop_color, buf_crop_color
2138
	dd sz_buf2d_offset_h, buf_offset_h
2307
	dd sz_buf2d_offset_h, buf_offset_h
-
 
2308
	dd sz_buf2d_flood_fill, buf_flood_fill
2139
	dd 0,0
2309
	dd 0,0
2140
	sz_lib_init db 'lib_init',0
2310
	sz_lib_init db 'lib_init',0
2141
	sz_buf2d_create db 'buf2d_create',0
2311
	sz_buf2d_create db 'buf2d_create',0
2142
	sz_buf2d_create_f_img db 'buf2d_create_f_img',0
2312
	sz_buf2d_create_f_img db 'buf2d_create_f_img',0
2143
	sz_buf2d_clear db 'buf2d_clear',0 ;®ç¨á⪠ ¡ãä¥à  㪠§ ­­ë¬ 梥⮬
2313
	sz_buf2d_clear db 'buf2d_clear',0 ;®ç¨á⪠ ¡ãä¥à  㪠§ ­­ë¬ 梥⮬
Line 2157... Line 2327...
2157
	sz_buf2d_cruve_bezier db 'buf2d_cruve_bezier',0
2327
	sz_buf2d_cruve_bezier db 'buf2d_cruve_bezier',0
2158
	sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
2328
	sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
2159
	sz_buf2d_draw_text db 'buf2d_draw_text',0
2329
	sz_buf2d_draw_text db 'buf2d_draw_text',0
2160
	sz_buf2d_crop_color db 'buf2d_crop_color',0
2330
	sz_buf2d_crop_color db 'buf2d_crop_color',0
2161
	sz_buf2d_offset_h db 'buf2d_offset_h',0
2331
	sz_buf2d_offset_h db 'buf2d_offset_h',0
-
 
2332
	sz_buf2d_flood_fill db 'buf2d_flood_fill',0
-
 
2333
;>