1 ;---------------------------------------------------------------------
\r
2 invert_left_to_right:
\r
4 jmp rotate_counter_clockwise.1
\r
5 ;---------------------------------------------------------------------
\r
8 jmp rotate_counter_clockwise.1
\r
9 ;---------------------------------------------------------------------
\r
12 jmp rotate_counter_clockwise.1
\r
13 ;---------------------------------------------------------------------
\r
14 rotate_counter_clockwise:
\r
21 mov eax,[RAW1_pointer]
\r
24 cmp [Total_Repeat_N],1
\r
29 call proc_position_correct
\r
30 mov eax,[vertical_position_coorect]
\r
31 mov ebx,[horizontal_position_coorect]
\r
32 mov [horizontal_position_coorect],eax
\r
33 mov [vertical_position_coorect],ebx
\r
35 ; mov eax,image_file
\r
37 ; 1 - clockwise, 2 - counter clockwise
\r
38 ; 3 - Left&Right, 4 - Up&Down
\r
40 push dword image_file
\r
41 ; call [plugin_rotate]
\r
43 mov ebx,[raw_pointer]
\r
48 call convert.img_resolution_ok
\r
50 ;---------------------------------------------------------------------
\r
51 calculate_arrows_offset:
\r
52 mov eax,[arrows_offset]
\r
53 imul eax,[scaling_mode]
\r
57 mov [scroll_bar_data_vertical.ar_offset],eax
\r
58 mov [scroll_bar_data_horizontal.ar_offset],eax
\r
60 ;---------------------------------------------------------------------
\r
62 mov eax,scaling_mode
\r
67 mov [zoom_factors],dword zoom_factors.100
\r
70 ;---------------------------------------------------------------------
\r
75 mov eax,scaling_mode
\r
77 cmp [eax],ebx ;dword 0
\r
79 mov [eax],ebx ;dword 0
\r
80 mov [zoom_factors],dword zoom_factors.1
\r
82 call draw_zoom_factors
\r
84 ;---------------------------
\r
93 ;---------------------------
\r
103 ;---------------------------
\r
105 mov ebx,[raw_pointer]
\r
109 ;---------------------------
\r
114 mov ebx,[image_start_coordinates]
\r
119 mcall 13,,,[fill_color] ;0xffffff
\r
123 add bx,[wa_width_2]
\r
124 mov ax,[wa_width_1]
\r
128 mcall 13,,,[fill_color] ;0xffffff
\r
132 ;---------------------------
\r
137 mov ebx,[image_start_coordinates]
\r
141 mov bx,[wa_width_1]
\r
142 mcall 13,,,[fill_color] ;0xffffff
\r
152 mcall 13,,,[fill_color] ;0xffffff
\r
156 ;---------------------------
\r
161 ;---------------------------
\r
167 mov [wa_width_2],ax
\r
172 ;---------------------------
\r
175 cmp ax,[wa_width_1]
\r
181 mov [wa_width_2],ax
\r
182 ;---------------------------
\r
184 mov bx,[wa_width_2]
\r
207 ; mov eax,image_file
\r
208 ; mov edx,[scaling_mode]
\r
209 movzx esi,byte [filtering_flag]
\r
210 ; mov edi,[background_color]
\r
212 push dword 0 ; eax - crop size
\r
213 push dword [background_color] ; edi - background color
\r
214 push esi ; esi - filtering
\r
215 push dword [scaling_mode] ; edx - scaling mode
\r
216 push ecx ; ecx - start_coordinates
\r
217 push ebx ; ebx - new_size
\r
218 push dword image_file ; eax - convert data table
\r
225 call [Scaling_Start]
\r
244 mov edx,[image_start_coordinates]
\r
249 mov [scroll_bar_data_vertical.y],eax
\r
255 mov [scroll_bar_data_horizontal.x],eax
\r
257 ; call correct_cur_area
\r
259 ; movzx eax,[wa_width_1]
\r
261 ; movzx eax,[wa_width_2]
\r
264 ; movzx eax,[wa_high_1]
\r
266 ; movzx eax,[wa_high_2]
\r
270 mov ax,[wa_width_1]
\r
271 sub ax,[wa_width_2]
\r
288 ; mov esi,[img_resolution]
\r
289 ; cmp [img_resolution_2],15
\r
293 mov eax,[raw_pointer_2]
\r
296 mov eax,[raw_pointer]
\r
299 ; mov edi,[img_palette]
\r
303 mov ebx,[raw_pointer_2]
\r
314 ; cmp [filtering_flag],0
\r
338 call draw_file_name_to_work_area
\r
339 mcall 68,13,[raw_pointer_2]
\r
343 mov ax,[wa_width_2]
\r
345 mov ebx,[img_width]
\r
347 call calculate_relation
\r
348 mov [zoom_auto_factor],eax
\r
351 ;---------------------------------------------------------------------
\r
352 calculate_relation:
\r
353 ; relation = X*100/Y
\r
354 ; eax = eax*100/ebx
\r
356 shl eax,2 ; óìíîæåíèå íà 4
\r
357 lea eax,[eax+eax*4] ; óìíîæåíèå íà 5
\r
358 lea eax,[eax+eax*4] ; óìíîæåíèå íà 5
\r
373 ;---------------------------------------------------------------------
\r
374 calculation_next_value_plus:
\r
375 mov ebx,[zoom_auto_factor]
\r
376 mov ecx,zoom_factors.min
\r
380 cmp ecx,dword zoom_factors.max
\r
386 mov eax,zoom_factors
\r
391 mov ecx,dword zoom_factors.max
\r
393 ;---------------------------------------------------------------------
\r
394 calculation_next_value_minus:
\r
395 mov ebx,[zoom_auto_factor]
\r
396 mov ecx,zoom_factors.max
\r
400 cmp ecx,dword zoom_factors.min
\r
406 mov eax,zoom_factors
\r
411 mov ecx,dword zoom_factors.min
\r
413 ;---------------------------------------------------------------------
\r
414 proc_position_correct:
\r
415 mov [position_coorect],1
\r
416 mov eax,[scroll_bar_data_vertical.max_area]
\r
421 add ebx,[scroll_bar_data_vertical.position]
\r
428 mov [vertical_position_coorect],eax
\r
430 mov eax,[scroll_bar_data_horizontal.max_area]
\r
432 mov bx,[wa_width_1]
\r
435 add ebx,[scroll_bar_data_horizontal.position]
\r
442 mov [horizontal_position_coorect],eax
\r
444 ;---------------------------------------------------------------------
\r
446 ; cmp [scaling_mode],dword 0
\r
447 mov eax,[scaling_mode]
\r
450 ; jz calculation_next_value_plus
\r
452 call calculation_next_value_plus
\r
456 ; mov [scaling_mode],dword 100
\r
457 ; mov [zoom_factors],dword zoom_factors.100
\r
458 ; call draw_zoom_factors
\r
461 mov eax,zoom_factors
\r
462 cmp [eax],dword zoom_factors.max
\r
469 mov [scaling_mode],eax
\r
471 mov [correct_scrollbar_100_flag],1
\r
472 call calculate_arrows_offset
\r
474 call proc_position_correct
\r
478 call set_draw_scrollbar_all
\r
479 call draw_scrollbars
\r
480 call set_nodraw_scrollbar_all
\r
482 call draw_zoom_factors
\r
486 ;******************************
\r
493 ;******************************
\r
494 cmp [position_coorect],0
\r
496 mov [position_coorect],0
\r
497 mov eax,[scroll_bar_data_vertical.max_area]
\r
499 ; mov bx,[wa_high_1]
\r
501 ; add eax,ebx ;[scroll_bar_data_vertical.cur_area]
\r
503 mov ebx,[vertical_position_coorect]
\r
517 jmp .position_vertical_correct
\r
520 .position_vertical_correct:
\r
521 mov [scroll_bar_data_vertical.position],eax
\r
523 mov eax,[scroll_bar_data_horizontal.max_area]
\r
525 ; mov bx,[wa_width_1]
\r
527 ; add eax,ebx ;[scroll_bar_data_horizontal.cur_area]
\r
529 mov ebx,[horizontal_position_coorect]
\r
538 mov bx,[wa_width_1]
\r
543 jmp .position_horizontal_correct
\r
546 .position_horizontal_correct:
\r
547 mov [scroll_bar_data_horizontal.position],eax
\r
551 ;****************************************************************************
\r
552 ; Vertical SCROLLBAR
\r
553 ; At a case of resizing of the window
\r
554 ; Check the position of a runner has crossed a limit
\r
555 ;****************************************************************************
\r
556 mov eax,[scroll_bar_data_vertical.max_area]
\r
564 sub eax,ebx ;[scroll_bar_data_vertical.cur_area]
\r
565 cmp eax,[scroll_bar_data_vertical.position]
\r
568 mov [scroll_bar_data_vertical.position],eax
\r
570 ;****************************************************************************
\r
571 ; Horizontal SCROLLBAR
\r
572 ; At a case of resizing of the window
\r
573 ; Check the position of a runner has crossed a limit
\r
574 ;****************************************************************************
\r
575 mov eax,[scroll_bar_data_horizontal.max_area]
\r
577 mov bx,[wa_width_1]
\r
583 sub eax,ebx ;[scroll_bar_data_horizontal.cur_area]
\r
584 cmp eax,[scroll_bar_data_horizontal.position]
\r
587 mov [scroll_bar_data_horizontal.position],eax
\r
589 ;****************************************************************************
\r
591 mov eax,[scroll_bar_data_horizontal.max_area]
\r
592 mov ebx,[scroll_bar_data_vertical.max_area]
\r
595 sub eax,[scroll_bar_data_horizontal.position] ;100
\r
596 sub ebx,[scroll_bar_data_vertical.position] ;100
\r
599 mov cx,word [wa_width_1]
\r
603 mov ax,[wa_width_1]
\r
605 mov [wa_width_2],ax
\r
611 mov dx,word [wa_high_1]
\r
620 call correct_cur_area
\r
625 mov eax,[scroll_bar_data_vertical.max_area]
\r
626 cmp eax,[scroll_bar_data_vertical.cur_area]
\r
627 jbe .horizontal ;@f
\r
628 mov ax,[wa_width_1]
\r
629 sub ax,[scroll_bar_data_vertical.size_x]
\r
630 mov [wa_width_1],ax
\r
631 cmp ax,[wa_width_2]
\r
633 mov [wa_width_2],ax
\r
635 mov eax,[scroll_bar_data_horizontal.max_area]
\r
636 cmp eax,[scroll_bar_data_horizontal.cur_area]
\r
639 sub ax,[scroll_bar_data_horizontal.size_y]
\r
647 mov cx,[wa_width_2]
\r
651 call correct_cur_area
\r
655 mov eax,[scroll_bar_data_horizontal.position]
\r
659 shl eax,2 ; óìíîæåíèå íà 4
\r
660 lea eax,[eax+eax*4] ; óìíîæåíèå íà 5
\r
661 lea eax,[eax+eax*4] ; óìíîæåíèå íà 5
\r
663 mov ebx,[scaling_mode]
\r
678 mov eax,[scroll_bar_data_vertical.position]
\r
682 shl eax,2 ; óìíîæåíèå íà 4
\r
683 lea eax,[eax+eax*4] ; óìíîæåíèå íà 5
\r
684 lea eax,[eax+eax*4] ; óìíîæåíèå íà 5
\r
686 mov ebx,[scaling_mode]
\r
701 ;******************************
\r
709 ;******************************
\r
712 ;---------------------------------------------------------------------
\r
714 ; cmp [scaling_mode],dword 0
\r
715 mov eax,[scaling_mode]
\r
718 ; jz calculation_next_value_minus
\r
720 call calculation_next_value_minus
\r
725 ; mov [scaling_mode],dword 100
\r
726 ; mov [zoom_factors],dword zoom_factors.100
\r
727 ; call draw_zoom_factors
\r
730 mov eax,zoom_factors
\r
731 cmp [eax],dword zoom_factors.min
\r
735 ;---------------------------------------------------------------------