Subversion Repositories Kolibri OS

Rev

Rev 1921 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2388 dunkaist 1
proc	xcf._.blend_rgb
1921 dunkaist 2
 
2388 dunkaist 3
	xchg		al, bh
4
	mov		ah, bh
5
	neg		ax
6
	add		ax, 0xffff
7
	mul		ah
8
	neg		ah
9
	add		ah, 0xff
10
	xchg		ah, bh
1921 dunkaist 11
 
2388 dunkaist 12
	mov		al, 0xff
13
	cmp		ah, bh
14
	je		@f
15
	not		al
16
	div		bh
17
    @@:
1921 dunkaist 18
 
2388 dunkaist 19
	mov		ah, al
1921 dunkaist 20
 
2388 dunkaist 21
	movd		mm1, eax
22
	punpcklbw	mm1, mm1
23
	punpcklbw	mm1, mm0
1921 dunkaist 24
 
2388 dunkaist 25
	movq		mm7, mm1
26
	psrlw		mm7, 7
27
	paddw		mm1, mm7
1921 dunkaist 28
 
2388 dunkaist 29
	psubw		mm3, mm2
30
	pmullw		mm3, mm1
31
	psllw		mm2, 8
32
	paddw		mm3, mm2
33
	pinsrw		mm3, ebx, 3
34
	psrlw		mm3, 8
35
	packuswb	mm3, mm0
36
	movd		eax, mm3
37
 
38
	ret
1921 dunkaist 39
endp
40
 
41
 
2388 dunkaist 42
proc	xcf._.blend_gray
1921 dunkaist 43
 
2388 dunkaist 44
	xchg		al, bh
45
	mov		ah, bh
46
	neg		ax
47
	add		ax, 0xffff
48
	mul		ah
49
	neg		ah
50
	add		ah, 0xff
51
	xchg		ah, bh
1921 dunkaist 52
 
2388 dunkaist 53
	mov		al, 0xff
54
	cmp		ah, bh
55
	je		@f
56
	not		al
57
	div		bh
58
    @@:
1921 dunkaist 59
 
2388 dunkaist 60
	mov		ah, al
1921 dunkaist 61
 
2388 dunkaist 62
	movd		mm1, eax
63
	punpcklbw	mm1, mm1
64
	punpcklbw	mm1, mm0
1921 dunkaist 65
 
2388 dunkaist 66
	movq		mm7, mm1
67
	psrlw		mm7, 7
68
	paddw		mm1, mm7
1921 dunkaist 69
 
2388 dunkaist 70
	psubw		mm3, mm2
71
	pmullw		mm3, mm1
72
	psllw		mm2, 8
73
	paddw		mm3, mm2
74
	pinsrw		mm3, ebx, 1
75
	psrlw		mm3, 8
76
	packuswb	mm3, mm0
77
	movd		eax, mm3
78
 
79
	ret
1921 dunkaist 80
endp
81
 
82
 
2388 dunkaist 83
proc	xcf._.merge_32 _copy_width, _copy_height, _img_total_bpl, _bottom_total_bpl
84
  .rgb_line:
85
	mov		ecx, [_copy_width]
86
  .rgb_pixel:
87
	mov		ebx, [edi]
88
	lodsd
89
 
90
	movd		mm2, ebx
91
	movd		mm3, eax
92
	shr		eax, 24
93
	shr		ebx, 16
94
	cmp		al, bh
95
	jna		@f
96
	mov		al, bh
97
    @@:
98
	pxor		mm0, mm0
99
	call		edx
100
	call		xcf._.blend_rgb
101
	stosd
102
	dec		ecx
103
	jnz		.rgb_pixel
104
	add		esi, [_img_total_bpl]
105
	add		edi, [_bottom_total_bpl]
106
	dec		[_copy_height]
107
	jnz		.rgb_line
108
	emms
109
	ret
1921 dunkaist 110
endp
111
 
112
 
2388 dunkaist 113
proc	xcf._.merge_8a _copy_width, _copy_height, _img_total_bpl, _bottom_total_bpl
114
  .gray_line:
115
	mov		ecx, [_copy_width]
116
  .gray_pixel:
117
	mov		bx,  word[edi]
118
	lodsw
119
	movd		mm2, ebx
120
	movd		mm3, eax
121
	shr		eax, 8
122
	cmp		al, bh
123
	jna		@f
124
	mov		al, bh
125
    @@:
126
	pxor		mm0, mm0
127
	call		edx
128
	call		xcf._.blend_gray
129
	stosw
130
	dec		ecx
131
	jnz		.gray_pixel
132
	add		esi, [_img_total_bpl]
133
	add		edi, [_bottom_total_bpl]
134
	dec		[_copy_height]
135
	jnz		.gray_line
136
	emms
137
	ret
1921 dunkaist 138
endp
139
 
140
 
2388 dunkaist 141
proc	xcf._.composite_rgb_00 _copy_width, _copy_height, _bottom_total_bpl, _img_total_bpl
1921 dunkaist 142
 
2388 dunkaist 143
  .line:
144
	mov		ecx, [_copy_width]
145
  .pixel:
146
	mov		ebx, [edi]
147
	lodsd
148
	movd		mm2, ebx
149
	movd		mm3, eax
1921 dunkaist 150
 
2388 dunkaist 151
	shr		eax, 24
152
	shr		ebx, 16
1921 dunkaist 153
 
2388 dunkaist 154
	xchg		al, bh
155
	mov		ah, bh
156
	neg		ax
157
	add		ax, 0xffff
158
	mul		ah
159
	neg		ah
160
	add		ah, 0xff
161
	xchg		ah, bh
1921 dunkaist 162
 
2388 dunkaist 163
	mov		al, 0xff
164
	cmp		ah, bh
165
	je		@f
166
	not		al
167
	div		bh
168
    @@:
1921 dunkaist 169
 
2388 dunkaist 170
	mov		ah, al
1921 dunkaist 171
 
2388 dunkaist 172
	movd		mm1, eax
173
	pxor		mm0, mm0
174
	punpcklbw	mm1, mm1
175
	punpcklbw	mm1, mm0
176
	punpcklbw	mm2, mm0
177
	punpcklbw	mm3, mm0
1921 dunkaist 178
 
2388 dunkaist 179
	psubsw		mm3, mm2
180
	pmullw		mm3, mm1
181
	psllw		mm2, 8
182
	paddw		mm3, mm2
183
	pinsrw		mm3, ebx, 3
184
	psrlw		mm3, 8
185
	packuswb	mm3, mm0
186
	movd		eax, mm3
187
	stosd
188
 
189
	dec		ecx
190
	jnz		.pixel
191
	add		esi, [_img_total_bpl]
192
	add		edi, [_bottom_total_bpl]
193
	dec		[_copy_height]
194
	jnz		.line
195
 
196
	ret
1921 dunkaist 197
endp
198
 
199
 
2388 dunkaist 200
proc	xcf._.composite_gray_00 _copy_width, _copy_height, _bottom_total_bpl, _img_total_bpl
1921 dunkaist 201
 
2388 dunkaist 202
  .line:
203
	mov		ecx, [_copy_width]
204
  .pixel:
205
	mov		bx, [edi]
206
	lodsw
207
	movd		mm2, ebx
208
	movd		mm3, eax
1921 dunkaist 209
 
2388 dunkaist 210
	shr		eax, 8
1921 dunkaist 211
 
2388 dunkaist 212
	xchg		al, bh
213
	mov		ah, bh
214
	neg		ax
215
	add		ax, 0xffff
216
	mul		ah
217
	neg		ah
218
	add		ah, 0xff
219
	xchg		ah, bh
1921 dunkaist 220
 
2388 dunkaist 221
	mov		al, 0xff
222
	cmp		ah, bh
223
	je		@f
224
	not		al
225
	div		bh
226
    @@: