Rev 2188 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2188 | Rev 2236 | ||
---|---|---|---|
Line 41... | Line 41... | ||
41 | mcall |
41 | mcall |
42 | .end: |
42 | .end: |
43 | ret |
43 | ret |
44 | ;--------------------------------------------------------------------- |
44 | ;--------------------------------------------------------------------- |
45 | .stretch_crop: |
45 | .stretch_crop: |
46 | ; cmp [bgrmode],dword 3 |
46 | cmp [bgrmode],dword 3 |
47 | ; jne .stretch_inscribe |
47 | jne .stretch_inscribe |
48 | xor eax,eax |
48 | xor eax,eax |
49 | mov [stretch_start_coordinates],eax |
49 | mov [stretch_start_coordinates],eax |
Line 50... | Line 50... | ||
50 | 50 | ||
Line 118... | Line 118... | ||
118 | push dword image_file ; eax - convert data table |
118 | push dword image_file ; eax - convert data table |
Line 119... | Line 119... | ||
119 | 119 | ||
120 | call [Scaling_Start] |
120 | call [Scaling_Start] |
121 | call background_1 |
121 | call background_1 |
- | 122 | ret |
|
- | 123 | ;--------------------------------------------------------------------- |
|
- | 124 | .stretch_inscribe: |
|
- | 125 | xor eax,eax |
|
- | 126 | mov [stretch_start_coordinates],eax |
|
- | 127 | ||
- | 128 | mcall 14 |
|
- | 129 | ||
- | 130 | mov ebx,eax |
|
- | 131 | and eax,0xffff |
|
- | 132 | inc eax |
|
- | 133 | mov [screen_high],eax |
|
- | 134 | shr ebx,16 |
|
- | 135 | inc ebx |
|
- | 136 | mov [screen_width],ebx |
|
- | 137 | ||
- | 138 | xchg eax,ebx |
|
- | 139 | call calculate_relation |
|
Line -... | Line 140... | ||
- | 140 | mov [screen_relation],eax |
|
- | 141 | ||
- | 142 | mov eax,[img_width] |
|
- | 143 | mov ebx,[img_high] |
|
- | 144 | call calculate_relation |
|
- | 145 | mov [picture_relation],eax |
|
- | 146 | ||
- | 147 | cmp eax,[screen_relation] |
|
- | 148 | ja @f |
|
- | 149 | ; Y = Yimg |
|
- | 150 | ; X = Yimg*Xscreen/Yscreen |
|
- | 151 | mov eax,[screen_high] ;[img_high] |
|
- | 152 | mov [stretch_img_high],eax |
|
- | 153 | mov eax,[screen_high] ;[img_high] |
|
- | 154 | imul eax,dword [img_width] ;[screen_width] |
|
- | 155 | mov ebx,[img_high] ;[screen_high] |
|
- | 156 | call integer_division |
|
- | 157 | mov [stretch_img_width],eax |
|
- | 158 | jmp .continue_1 |
|
- | 159 | @@: |
|
- | 160 | ; X = Ximg |
|
- | 161 | ; Y = Ximg*Yscreen/Xscreen |
|
- | 162 | mov eax,[screen_width] ;[img_width] |
|
- | 163 | mov [stretch_img_width],eax |
|
- | 164 | mov eax,[screen_width] ;[img_width] |
|
- | 165 | imul eax,dword [img_high] ;[screen_high] |
|
- | 166 | mov ebx,[img_width] ;[screen_width] |
|
- | 167 | call integer_division |
|
- | 168 | mov [stretch_img_high],eax |
|
- | 169 | .continue_1: |
|
- | 170 | ; mov ebx,[screen_width] |
|
- | 171 | ; shl ebx,16 |
|
- | 172 | ; add ebx,[screen_high] |
|
- | 173 | ||
- | 174 | mov ebx,[stretch_img_width] |
|
- | 175 | shl ebx,16 |
|
- | 176 | add ebx,[stretch_img_high] |
|
- | 177 | ||
- | 178 | ||
- | 179 | push dword 0 ; eax - crop size |
|
- | 180 | push dword 0 ; edi - background color |
|
- | 181 | push dword 1 ; esi - filtering |
|
- | 182 | push dword 0 ; edx - scaling mode |
|
- | 183 | push dword [stretch_start_coordinates] ; ecx - start_coordinates |
|
- | 184 | push ebx ; ebx - new_size |
|
- | 185 | push dword image_file ; eax - convert data table |
|
- | 186 | ||
- | 187 | call [Scaling_Start] |
|
- | 188 | ||
- | 189 | mov eax,[raw_pointer_2] |
|
- | 190 | mov [crop_raw_pointer],eax |
|
- | 191 | mov [crop_raw_pointer_2],eax |
|
- | 192 | ||
- | 193 | mov eax,[raw_pointer_2] |
|
- | 194 | mov eax,[eax+12] ;overall depth of the pixel |
|
- | 195 | cmp al,24 |
|
- | 196 | je @f |
|
- | 197 | ||
- | 198 | push dword crop_image_file |
|
- | 199 | call [convert_Conv_24b] |
|
- | 200 | ||
- | 201 | mov ecx,[raw_pointer_2] |
|
- | 202 | mcall 68,13 |
|
- | 203 | @@: |
|
- | 204 | mov ecx,[screen_width] |
|
- | 205 | imul ecx,[screen_high] |
|
- | 206 | lea ecx,[ecx*3] |
|
- | 207 | add ecx,44 |
|
- | 208 | ||
- | 209 | ; mcall 68,20,,[crop_raw_pointer_2] |
|
- | 210 | ; mov [crop_raw_pointer_2],eax |
|
- | 211 | mov eax,[crop_raw_pointer_2] |
|
- | 212 | mov [crop_raw_pointer],eax |
|
- | 213 | ||
- | 214 | mcall 68,12 |
|
- | 215 | mov [crop_raw_pointer_2],eax |
|
- | 216 | ||
- | 217 | ; fill of color |
|
- | 218 | sub ecx,44 |
|
- | 219 | mov edi,eax |
|
- | 220 | add edi,44 |
|
- | 221 | mov eax,0xaaaaaa |
|
- | 222 | cld |
|
- | 223 | @@: |
|
- | 224 | stosb |
|
- | 225 | ror eax,8 |
|
- | 226 | stosb |
|
- | 227 | ror eax,8 |
|
- | 228 | stosb |
|
- | 229 | rol eax,16 |
|
- | 230 | sub ecx,2 |
|
- | 231 | loop @b |
|
- | 232 | ||
- | 233 | ; copy of data |
|
- | 234 | mov eax,[screen_width] |
|
- | 235 | sub eax,[stretch_img_width] |
|
- | 236 | mov ebx,eax |
|
- | 237 | lea eax,[eax*3] |
|
- | 238 | shr ebx,1 |
|
- | 239 | lea ebx,[ebx*3] |
|
- | 240 | ||
- | 241 | mov edi,[screen_high] |
|
- | 242 | sub edi,[stretch_img_high] |
|
- | 243 | shr edi,1 |
|
- | 244 | imul edi,[screen_width] |
|
- | 245 | lea edi,[edi*3] |
|
- | 246 | add edi,[crop_raw_pointer_2] |
|
- | 247 | add edi,44 |
|
- | 248 | add edi,ebx |
|
- | 249 | ||
- | 250 | mov esi,[crop_raw_pointer] |
|
- | 251 | add esi,44 |
|
- | 252 | ||
- | 253 | mov ebx,[stretch_img_width] |
|
- | 254 | lea ebx,[ebx*3] |
|
- | 255 | ||
- | 256 | mov ecx,[stretch_img_high] |
|
- | 257 | @@: |
|
- | 258 | push ecx |
|
- | 259 | mov ecx,ebx |
|
- | 260 | rep movsb |
|
- | 261 | pop ecx |
|
- | 262 | add edi,eax |
|
- | 263 | loop @b |
|
- | 264 | ||
- | 265 | ; header |
|
- | 266 | mov esi,[crop_raw_pointer] |
|
- | 267 | mov edi,[crop_raw_pointer_2] |
|
- | 268 | mov ecx,44/4 |
|
- | 269 | rep stosd |
|
- | 270 | ||
- | 271 | mcall 68,13,[crop_raw_pointer] |
|
- | 272 | ;set the background |
|
- | 273 | mov eax,[crop_raw_pointer_2] |
|
- | 274 | mov ebx,[screen_width] |
|
- | 275 | mov [eax+4],ebx |
|
- | 276 | mov ebx,[screen_high] |
|
- | 277 | mov [eax+8],ebx |
|
- | 278 | ||
- | 279 | mov ecx,[screen_width] ; øèðèíà |
|
- | 280 | test ecx,ecx |
|
- | 281 | jz @f |
|
- | 282 | mov edx,[screen_high] ; âûñîòà |
|
- | 283 | test edx,edx |
|
- | 284 | jz @f |
|
- | 285 | mcall 15,1 ; set size |
|
- | 286 | ||
- | 287 | mov esi,ecx |
|
- | 288 | imul esi,edx |
|
- | 289 | lea esi,[esi*3] |
|
- | 290 | ||
- | 291 | xor edx,edx |
|
- | 292 | mov ecx,[crop_raw_pointer_2] |
|
- | 293 | add ecx,44 |
|
- | 294 | mcall 15,5 ;15,5 set data |
|
- | 295 | xor ecx,ecx |
|
- | 296 | inc ecx |
|
- | 297 | mcall 15,4 ; 15,4 set mode |
|
- | 298 | dec ebx ; 15,3 redraw background |
|
- | 299 | mcall |
|
- | 300 | @@: |
|
122 | ret |
301 | mcall 68,13,[crop_raw_pointer_2] |
123 | 302 | ret |
|
124 | ;--------------------------------------------------------------------- |
303 | ;--------------------------------------------------------------------- |
125 | call_to_calculate_stretch_start_coordinates_X: |
304 | call_to_calculate_stretch_start_coordinates_X: |
126 | dd calculate_stretch_start_coordinates_XL |
305 | dd calculate_stretch_start_coordinates_XL |
Line 166... | Line 345... | ||
166 | calculate_stretch_start_coordinates_YD: |
345 | calculate_stretch_start_coordinates_YD: |
167 | xor ecx,ecx |
346 | xor ecx,ecx |
168 | inc ecx |
347 | inc ecx |
169 | jmp calculate_stretch_start_coordinates_YC.1 |
348 | jmp calculate_stretch_start_coordinates_YC.1 |
170 | ;--------------------------------------------------------------------- |
349 | ;--------------------------------------------------------------------- |
171 | ;.stretch_inscribe: |
- | |
172 | ; ret |
- | |
173 | ;--------------------------------------------------------------------- |
- | |
174 | background_1: |
350 | background_1: |
175 | mov ecx,[screen_width] ;[crop_img_width] ; øèðèíà |
351 | mov ecx,[screen_width] ;[crop_img_width] ; øèðèíà |
176 | test ecx,ecx |
352 | test ecx,ecx |
177 | jz .end |
353 | jz .end |
178 | mov edx,[screen_high] ;[crop_img_high] ; âûñîòà |
354 | mov edx,[screen_high] ;[crop_img_high] ; âûñîòà |
179 | test edx,edx |
355 | test edx,edx |
180 | jz .end |
356 | jz .end |
181 | mcall 15,1 ; set size |
357 | mcall 15,1 ; set size |
182 | 358 | .1: |
|
183 | mov esi,ecx |
359 | mov esi,ecx |
184 | imul esi,edx |
360 | imul esi,edx |
185 | lea esi,[esi*3] |
361 | lea esi,[esi*3] |
186 | mov ecx,[raw_pointer_2] ;[soi] |
362 | mov ecx,[raw_pointer_2] ;[soi] |
187 | mov eax,[ecx+28] |
363 | mov eax,[ecx+28] |