Merge branch 'main' of https://git.kolibrios.org/KolibriOS/kolibrios
This commit is contained in:
@@ -1,76 +0,0 @@
|
||||
match =MMX, COMPOSITE_MODE {include 'blend_mmx.asm'}
|
||||
match =SSE, COMPOSITE_MODE {include 'blend_sse.asm'}
|
||||
|
||||
;;============================================================================;;
|
||||
proc img.blend uses ebx esi edi, _bottom, _top, _xbottom, _ybottom, \ ;///////;;
|
||||
_xtop, _ytop, _width, _height ;//////////////;;
|
||||
;;----------------------------------------------------------------------------;;
|
||||
;? Alpha blend _top image to _bottom one (both must be of type Image.bpp32) ;;
|
||||
;;----------------------------------------------------------------------------;;
|
||||
;> _bottom = pointer to bottom image (will be changed) ;;
|
||||
;> _top = pointer to top image (unchanged) ;;
|
||||
;> _xbottom = x coord inside _bottom image where to put _top image ;;
|
||||
;> _ybottom = y coord inside _bottom image where to put _top image ;;
|
||||
;> _xtop = x coord inside _top image to start from ;;
|
||||
;> _ytop = y coord inside _top image to start from ;;
|
||||
;> _width = width of _top image area to put to _bottom image ;;
|
||||
;> _height = height of _top image area to put to _bottom image ;;
|
||||
;;----------------------------------------------------------------------------;;
|
||||
;< eax = 0 (fail) / _bottom (ok) ;;
|
||||
;;============================================================================;;
|
||||
mov esi, [_top]
|
||||
mov edi, [_bottom]
|
||||
|
||||
mov eax, [esi+Image.Width]
|
||||
sub eax, [_width]
|
||||
shl eax, 2
|
||||
push eax
|
||||
|
||||
mov eax, [edi+Image.Width]
|
||||
sub eax, [_width]
|
||||
shl eax, 2
|
||||
push eax
|
||||
|
||||
mov eax, [_ytop]
|
||||
imul eax, [esi+Image.Width]
|
||||
add eax, [_xtop]
|
||||
shl eax, 2
|
||||
mov esi, [esi+Image.Data]
|
||||
add esi, eax
|
||||
|
||||
mov eax, [_ybottom]
|
||||
imul eax, [edi+Image.Width]
|
||||
add eax, [_xbottom]
|
||||
shl eax, 2
|
||||
mov edi, [edi+Image.Data]
|
||||
add edi, eax
|
||||
stdcall xcf._.composite_rgb_00, [_width], [_height]
|
||||
mov eax, [_bottom]
|
||||
ret
|
||||
endp
|
||||
|
||||
|
||||
xcf._.composite_table.begin:
|
||||
.p00 dd 00, xcf._.composite_rgb_00, xcf._.composite_gray_00, xcf._.composite_indexed_00 ; Normal
|
||||
.p01 dd 01, xcf._.composite_rgb_01, xcf._.composite_gray_01, xcf._.composite_gray_01 ; Dissolve : random dithering to discrete alpha
|
||||
; .p02 dd 02, xcf._.composite_rgb_02, 0, xcf._.composite_indexed_02 ; Behind : not selectable in the GIMP UI. not implemented
|
||||
.p03 dd 03, xcf._.composite_rgb_03, xcf._.composite_rgb_03, xcf._.composite_indexed_00 ; Multiply
|
||||
.p04 dd 04, xcf._.composite_rgb_04, xcf._.composite_rgb_04, xcf._.composite_indexed_00 ; Screen
|
||||
.p05 dd 05, xcf._.composite_rgb_05, xcf._.composite_rgb_05, xcf._.composite_indexed_00 ; Overlay
|
||||
.p06 dd 06, xcf._.composite_rgb_06, xcf._.composite_rgb_06, xcf._.composite_indexed_00 ; Difference
|
||||
.p07 dd 07, xcf._.composite_rgb_07, xcf._.composite_rgb_07, xcf._.composite_indexed_00 ; Addition
|
||||
.p08 dd 08, xcf._.composite_rgb_08, xcf._.composite_rgb_08, xcf._.composite_indexed_00 ; Subtract
|
||||
.p09 dd 09, xcf._.composite_rgb_09, xcf._.composite_rgb_09, xcf._.composite_indexed_00 ; Darken Only
|
||||
.p10 dd 10, xcf._.composite_rgb_10, xcf._.composite_rgb_10, xcf._.composite_indexed_00 ; Lighten Only
|
||||
.p11 dd 11, xcf._.composite_rgb_11, xcf._.composite_gray_00, xcf._.composite_indexed_00 ; Hue (H of HSV)
|
||||
.p12 dd 12, xcf._.composite_rgb_12, xcf._.composite_gray_00, xcf._.composite_indexed_00 ; Saturation (S of HSV)
|
||||
.p13 dd 13, xcf._.composite_rgb_13, xcf._.composite_gray_00, xcf._.composite_indexed_00 ; Color (H and S of HSL)
|
||||
.p14 dd 14, xcf._.composite_rgb_14, xcf._.composite_gray_00, xcf._.composite_indexed_00 ; Value (V of HSV)
|
||||
.p15 dd 15, xcf._.composite_rgb_15, xcf._.composite_rgb_15, xcf._.composite_indexed_00 ; Divide
|
||||
.p16 dd 16, xcf._.composite_rgb_16, xcf._.composite_rgb_16, xcf._.composite_indexed_00 ; Dodge
|
||||
.p17 dd 17, xcf._.composite_rgb_17, xcf._.composite_rgb_17, xcf._.composite_indexed_00 ; Burn
|
||||
.p18 dd 18, xcf._.composite_rgb_18, xcf._.composite_rgb_18, xcf._.composite_indexed_00 ; Hard Light
|
||||
.p19 dd 19, xcf._.composite_rgb_05, xcf._.composite_rgb_05, xcf._.composite_indexed_00 ; Soft Light : XCF >= 2 only ('soft light' == 'overlay')
|
||||
.p20 dd 20, xcf._.composite_rgb_20, xcf._.composite_rgb_20, xcf._.composite_indexed_00 ; Grain Extract : XCF >= 2 only
|
||||
.p21 dd 21, xcf._.composite_rgb_21, xcf._.composite_rgb_21, xcf._.composite_indexed_00 ; Grain Merge : XCF >= 2 only
|
||||
xcf._.composite_table.end:
|
@@ -17,6 +17,56 @@
|
||||
;; ;;
|
||||
;;================================================================================================;;
|
||||
|
||||
;;============================================================================;;
|
||||
proc img.blend uses ebx esi edi, _bottom, _top, _xbottom, _ybottom, \ ;///////;;
|
||||
_xtop, _ytop, _width, _height ;//////////////;;
|
||||
;;----------------------------------------------------------------------------;;
|
||||
;? Alpha blend _top image to _bottom one (both must be of type Image.bpp32) ;;
|
||||
;;----------------------------------------------------------------------------;;
|
||||
;> _bottom = pointer to bottom image (will be changed) ;;
|
||||
;> _top = pointer to top image (unchanged) ;;
|
||||
;> _xbottom = x coord inside _bottom image where to put _top image ;;
|
||||
;> _ybottom = y coord inside _bottom image where to put _top image ;;
|
||||
;> _xtop = x coord inside _top image to start from ;;
|
||||
;> _ytop = y coord inside _top image to start from ;;
|
||||
;> _width = width of _top image area to put to _bottom image ;;
|
||||
;> _height = height of _top image area to put to _bottom image ;;
|
||||
;;----------------------------------------------------------------------------;;
|
||||
;< eax = 0 (fail) / _bottom (ok) ;;
|
||||
;;============================================================================;;
|
||||
mov esi, [_top]
|
||||
mov edi, [_bottom]
|
||||
|
||||
mov eax, [esi+Image.Width]
|
||||
sub eax, [_width]
|
||||
shl eax, 2
|
||||
push eax
|
||||
|
||||
mov eax, [edi+Image.Width]
|
||||
sub eax, [_width]
|
||||
shl eax, 2
|
||||
push eax
|
||||
|
||||
mov eax, [_ytop]
|
||||
imul eax, [esi+Image.Width]
|
||||
add eax, [_xtop]
|
||||
shl eax, 2
|
||||
mov esi, [esi+Image.Data]
|
||||
add esi, eax
|
||||
|
||||
mov eax, [_ybottom]
|
||||
imul eax, [edi+Image.Width]
|
||||
add eax, [_xbottom]
|
||||
shl eax, 2
|
||||
mov edi, [edi+Image.Data]
|
||||
add edi, eax
|
||||
stdcall img._.composite_rgb_00, [_width], [_height]
|
||||
mov eax, [_bottom]
|
||||
emms
|
||||
ret
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.blend_rgb
|
||||
|
||||
xchg al, bh
|
||||
@@ -158,7 +208,7 @@ proc xcf._.merge_8a _copy_width, _copy_height, _img_total_bpl, _bottom_total_bpl
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_00 _copy_width, _copy_height, _bottom_total_bpl, _img_total_bpl
|
||||
proc img._.composite_rgb_00 _copy_width, _copy_height, _bottom_total_bpl, _img_total_bpl
|
||||
|
||||
.line:
|
||||
mov ecx, [_copy_width]
|
||||
@@ -219,7 +269,7 @@ proc xcf._.composite_rgb_00 _copy_width, _copy_height, _bottom_total_bpl, _img_t
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_gray_00 _copy_width, _copy_height, _bottom_total_bpl, _img_total_bpl
|
||||
proc img._.composite_gray_00 _copy_width, _copy_height, _bottom_total_bpl, _img_total_bpl
|
||||
|
||||
.line:
|
||||
mov ecx, [_copy_width]
|
||||
@@ -277,7 +327,7 @@ proc xcf._.composite_gray_00 _copy_width, _copy_height, _bottom_total_bpl, _img_
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_indexed_00 _copy_width, _copy_height, _bottom_total_bpl, _img_total_bpl
|
||||
proc img._.composite_indexed_00 _copy_width, _copy_height, _bottom_total_bpl, _img_total_bpl
|
||||
|
||||
.line:
|
||||
mov ecx, [_copy_width]
|
||||
@@ -302,7 +352,7 @@ proc xcf._.composite_indexed_00 _copy_width, _copy_height, _bottom_total_bpl, _i
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_01 _copy_width, _copy_height, _bottom_total_bpl, _img_total_bpl
|
||||
proc img._.composite_rgb_01 _copy_width, _copy_height, _bottom_total_bpl, _img_total_bpl
|
||||
pushad
|
||||
|
||||
pxor mm4, mm4
|
||||
@@ -349,7 +399,7 @@ proc xcf._.composite_rgb_01 _copy_width, _copy_height, _bottom_total_bpl, _img_t
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_gray_01 _copy_width, _copy_height, _bottom_total_bpl, _img_total_bpl
|
||||
proc img._.composite_gray_01 _copy_width, _copy_height, _bottom_total_bpl, _img_total_bpl
|
||||
pushad
|
||||
|
||||
pxor mm4, mm4
|
||||
@@ -394,7 +444,7 @@ proc xcf._.composite_gray_01 _copy_width, _copy_height, _bottom_total_bpl, _img_
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_03 ; Multiply
|
||||
proc img._.composite_rgb_03 ; Multiply
|
||||
|
||||
punpcklbw mm2, mm0
|
||||
punpcklbw mm3, mm0
|
||||
@@ -405,7 +455,7 @@ proc xcf._.composite_rgb_03 ; Multiply
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_04 ; Screen
|
||||
proc img._.composite_rgb_04 ; Screen
|
||||
|
||||
punpcklbw mm2, mm0
|
||||
punpcklbw mm3, mm0
|
||||
@@ -422,7 +472,7 @@ proc xcf._.composite_rgb_04 ; Screen
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_05 ; Overlay
|
||||
proc img._.composite_rgb_05 ; Overlay
|
||||
|
||||
punpcklbw mm2, mm0
|
||||
punpcklbw mm3, mm0
|
||||
@@ -438,7 +488,7 @@ proc xcf._.composite_rgb_05 ; Overlay
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_06 ; Difference
|
||||
proc img._.composite_rgb_06 ; Difference
|
||||
|
||||
movq mm4, mm3
|
||||
pminub mm4, mm2
|
||||
@@ -451,7 +501,7 @@ proc xcf._.composite_rgb_06 ; Difference
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_07 ; Addition
|
||||
proc img._.composite_rgb_07 ; Addition
|
||||
|
||||
paddusb mm3, mm2
|
||||
punpcklbw mm2, mm0
|
||||
@@ -461,7 +511,7 @@ proc xcf._.composite_rgb_07 ; Addition
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_08 ; Subtract
|
||||
proc img._.composite_rgb_08 ; Subtract
|
||||
|
||||
movq mm4, mm2
|
||||
psubusb mm4, mm3
|
||||
@@ -473,7 +523,7 @@ proc xcf._.composite_rgb_08 ; Subtract
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_09 ; Darken Only
|
||||
proc img._.composite_rgb_09 ; Darken Only
|
||||
|
||||
pminub mm3, mm2
|
||||
punpcklbw mm2, mm0
|
||||
@@ -483,7 +533,7 @@ proc xcf._.composite_rgb_09 ; Darken Only
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_10 ; Lighten Only
|
||||
proc img._.composite_rgb_10 ; Lighten Only
|
||||
|
||||
pmaxub mm3, mm2
|
||||
punpcklbw mm2, mm0
|
||||
@@ -493,7 +543,7 @@ proc xcf._.composite_rgb_10 ; Lighten Only
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_11 ; Hue (H of HSV)
|
||||
proc img._.composite_rgb_11 ; Hue (H of HSV)
|
||||
push eax ebx ecx edx
|
||||
|
||||
movd eax, mm3
|
||||
@@ -527,7 +577,7 @@ proc xcf._.composite_rgb_11 ; Hue (H of HSV)
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_12 ; Saturation (S of HSV)
|
||||
proc img._.composite_rgb_12 ; Saturation (S of HSV)
|
||||
push eax ebx ecx edx
|
||||
|
||||
movd eax, mm3
|
||||
@@ -559,7 +609,7 @@ proc xcf._.composite_rgb_12 ; Saturation (S of HSV)
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_13 ; Color (H and S of HSL)
|
||||
proc img._.composite_rgb_13 ; Color (H and S of HSL)
|
||||
push eax ebx ecx edx
|
||||
|
||||
movd eax, mm3
|
||||
@@ -586,7 +636,7 @@ proc xcf._.composite_rgb_13 ; Color (H and S of HSL)
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_14 ; Value (V of HSV)
|
||||
proc img._.composite_rgb_14 ; Value (V of HSV)
|
||||
push eax ebx ecx edx
|
||||
|
||||
movd eax, mm3
|
||||
@@ -617,7 +667,7 @@ proc xcf._.composite_rgb_14 ; Value (V of HSV)
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_15 ; Divide
|
||||
proc img._.composite_rgb_15 ; Divide
|
||||
push eax ebx ecx
|
||||
|
||||
movd eax, mm3
|
||||
@@ -665,7 +715,7 @@ proc xcf._.composite_rgb_15 ; Divide
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_16 ; Dodge
|
||||
proc img._.composite_rgb_16 ; Dodge
|
||||
push eax ebx ecx
|
||||
|
||||
movd eax, mm3
|
||||
@@ -715,7 +765,7 @@ proc xcf._.composite_rgb_16 ; Dodge
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_17 ; Burn
|
||||
proc img._.composite_rgb_17 ; Burn
|
||||
push eax ebx ecx
|
||||
|
||||
movd eax, mm3
|
||||
@@ -767,7 +817,7 @@ proc xcf._.composite_rgb_17 ; Burn
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_18 ; Hard Light
|
||||
proc img._.composite_rgb_18 ; Hard Light
|
||||
push eax ebx ecx
|
||||
|
||||
movd eax, mm3
|
||||
@@ -809,7 +859,7 @@ proc xcf._.composite_rgb_18 ; Hard Light
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_20 ; Grain Extract
|
||||
proc img._.composite_rgb_20 ; Grain Extract
|
||||
|
||||
punpcklbw mm2, mm0
|
||||
punpcklbw mm3, mm0
|
||||
@@ -823,7 +873,7 @@ proc xcf._.composite_rgb_20 ; Grain Extract
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_21 ; Grain Merge
|
||||
proc img._.composite_rgb_21 ; Grain Merge
|
||||
|
||||
punpcklbw mm2, mm0
|
||||
punpcklbw mm3, mm0
|
||||
|
@@ -17,6 +17,55 @@
|
||||
;; ;;
|
||||
;;================================================================================================;;
|
||||
|
||||
;;============================================================================;;
|
||||
proc img.blend uses ebx esi edi, _bottom, _top, _xbottom, _ybottom, \ ;///////;;
|
||||
_xtop, _ytop, _width, _height ;//////////////;;
|
||||
;;----------------------------------------------------------------------------;;
|
||||
;? Alpha blend _top image to _bottom one (both must be of type Image.bpp32) ;;
|
||||
;;----------------------------------------------------------------------------;;
|
||||
;> _bottom = pointer to bottom image (will be changed) ;;
|
||||
;> _top = pointer to top image (unchanged) ;;
|
||||
;> _xbottom = x coord inside _bottom image where to put _top image ;;
|
||||
;> _ybottom = y coord inside _bottom image where to put _top image ;;
|
||||
;> _xtop = x coord inside _top image to start from ;;
|
||||
;> _ytop = y coord inside _top image to start from ;;
|
||||
;> _width = width of _top image area to put to _bottom image ;;
|
||||
;> _height = height of _top image area to put to _bottom image ;;
|
||||
;;----------------------------------------------------------------------------;;
|
||||
;< eax = 0 (fail) / _bottom (ok) ;;
|
||||
;;============================================================================;;
|
||||
mov esi, [_top]
|
||||
mov edi, [_bottom]
|
||||
|
||||
mov eax, [esi+Image.Width]
|
||||
sub eax, [_width]
|
||||
shl eax, 2
|
||||
push eax
|
||||
|
||||
mov eax, [edi+Image.Width]
|
||||
sub eax, [_width]
|
||||
shl eax, 2
|
||||
push eax
|
||||
|
||||
mov eax, [_ytop]
|
||||
imul eax, [esi+Image.Width]
|
||||
add eax, [_xtop]
|
||||
shl eax, 2
|
||||
mov esi, [esi+Image.Data]
|
||||
add esi, eax
|
||||
|
||||
mov eax, [_ybottom]
|
||||
imul eax, [edi+Image.Width]
|
||||
add eax, [_xbottom]
|
||||
shl eax, 2
|
||||
mov edi, [edi+Image.Data]
|
||||
add edi, eax
|
||||
stdcall img._.composite_rgb_00, [_width], [_height]
|
||||
mov eax, [_bottom]
|
||||
ret
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.blend_rgb
|
||||
|
||||
push eax ebx
|
||||
@@ -248,7 +297,7 @@ proc xcf._.merge_8a _copy_width, _copy_height, _img_total_bpl, _bottom_total_bpl
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_00 _copy_width, _copy_height, _bottom_total_bpl, _img_total_bpl
|
||||
proc img._.composite_rgb_00 _copy_width, _copy_height, _bottom_total_bpl, _img_total_bpl
|
||||
|
||||
pxor xmm0, xmm0
|
||||
|
||||
@@ -412,7 +461,7 @@ proc xcf._.composite_rgb_00 _copy_width, _copy_height, _bottom_total_bpl, _img_t
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_gray_00 _copy_width, _copy_height, _bottom_total_bpl, _img_total_bpl
|
||||
proc img._.composite_gray_00 _copy_width, _copy_height, _bottom_total_bpl, _img_total_bpl
|
||||
|
||||
.line:
|
||||
mov ecx, [_copy_width]
|
||||
@@ -470,7 +519,7 @@ proc xcf._.composite_gray_00 _copy_width, _copy_height, _bottom_total_bpl, _img_
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_indexed_00 _copy_width, _copy_height, _bottom_total_bpl, _img_total_bpl
|
||||
proc img._.composite_indexed_00 _copy_width, _copy_height, _bottom_total_bpl, _img_total_bpl
|
||||
|
||||
.line:
|
||||
mov ecx, [_copy_width]
|
||||
@@ -495,7 +544,7 @@ proc xcf._.composite_indexed_00 _copy_width, _copy_height, _bottom_total_bpl, _i
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_01 _copy_width, _copy_height, _bottom_total_bpl, _img_total_bpl
|
||||
proc img._.composite_rgb_01 _copy_width, _copy_height, _bottom_total_bpl, _img_total_bpl
|
||||
pushad
|
||||
|
||||
pxor xmm4, xmm4
|
||||
@@ -542,7 +591,7 @@ proc xcf._.composite_rgb_01 _copy_width, _copy_height, _bottom_total_bpl, _img_t
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_gray_01 _copy_width, _copy_height, _bottom_total_bpl, _img_total_bpl
|
||||
proc img._.composite_gray_01 _copy_width, _copy_height, _bottom_total_bpl, _img_total_bpl
|
||||
pushad
|
||||
|
||||
pxor xmm4, xmm4
|
||||
@@ -587,7 +636,7 @@ proc xcf._.composite_gray_01 _copy_width, _copy_height, _bottom_total_bpl, _img_
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_03 ; Multiply
|
||||
proc img._.composite_rgb_03 ; Multiply
|
||||
|
||||
punpcklbw xmm2, xmm0
|
||||
punpcklbw xmm3, xmm0
|
||||
@@ -598,7 +647,7 @@ proc xcf._.composite_rgb_03 ; Multiply
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_04 ; Screen
|
||||
proc img._.composite_rgb_04 ; Screen
|
||||
|
||||
punpcklbw xmm2, xmm0
|
||||
punpcklbw xmm3, xmm0
|
||||
@@ -614,7 +663,7 @@ proc xcf._.composite_rgb_04 ; Screen
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_05 ; Overlay
|
||||
proc img._.composite_rgb_05 ; Overlay
|
||||
|
||||
punpcklbw xmm2, xmm0
|
||||
punpcklbw xmm3, xmm0
|
||||
@@ -630,7 +679,7 @@ proc xcf._.composite_rgb_05 ; Overlay
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_06 ; Difference
|
||||
proc img._.composite_rgb_06 ; Difference
|
||||
|
||||
movdqa xmm4, xmm3
|
||||
pminub xmm4, xmm2
|
||||
@@ -643,7 +692,7 @@ proc xcf._.composite_rgb_06 ; Difference
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_07 ; Addition
|
||||
proc img._.composite_rgb_07 ; Addition
|
||||
|
||||
paddusb xmm3, xmm2
|
||||
punpcklbw xmm2, xmm0
|
||||
@@ -653,7 +702,7 @@ proc xcf._.composite_rgb_07 ; Addition
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_08 ; Subtract
|
||||
proc img._.composite_rgb_08 ; Subtract
|
||||
|
||||
movdqa xmm4, xmm2
|
||||
psubusb xmm4, xmm3
|
||||
@@ -665,7 +714,7 @@ proc xcf._.composite_rgb_08 ; Subtract
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_09 ; Darken Only
|
||||
proc img._.composite_rgb_09 ; Darken Only
|
||||
|
||||
pminub xmm3, xmm2
|
||||
punpcklbw xmm2, xmm0
|
||||
@@ -675,7 +724,7 @@ proc xcf._.composite_rgb_09 ; Darken Only
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_10 ; Lighten Only
|
||||
proc img._.composite_rgb_10 ; Lighten Only
|
||||
|
||||
pmaxub xmm3, xmm2
|
||||
punpcklbw xmm2, xmm0
|
||||
@@ -685,7 +734,7 @@ proc xcf._.composite_rgb_10 ; Lighten Only
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_11 ; Hue (H of HSV)
|
||||
proc img._.composite_rgb_11 ; Hue (H of HSV)
|
||||
push eax ebx ecx edx
|
||||
|
||||
movd eax, xmm3
|
||||
@@ -749,7 +798,7 @@ proc xcf._.composite_rgb_11 ; Hue (H of HSV)
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_12 ; Saturation (S of HSV)
|
||||
proc img._.composite_rgb_12 ; Saturation (S of HSV)
|
||||
push eax ebx ecx edx
|
||||
|
||||
movd eax, xmm3
|
||||
@@ -807,7 +856,7 @@ proc xcf._.composite_rgb_12 ; Saturation (S of HSV)
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_13 ; Color (H and S of HSL)
|
||||
proc img._.composite_rgb_13 ; Color (H and S of HSL)
|
||||
push eax ebx ecx edx
|
||||
|
||||
movd eax, xmm3
|
||||
@@ -854,7 +903,7 @@ proc xcf._.composite_rgb_13 ; Color (H and S of HSL)
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_14 ; Value (V of HSV)
|
||||
proc img._.composite_rgb_14 ; Value (V of HSV)
|
||||
push eax ebx ecx edx
|
||||
|
||||
movd eax, xmm3
|
||||
@@ -909,7 +958,7 @@ proc xcf._.composite_rgb_14 ; Value (V of HSV)
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_15 ; Divide
|
||||
proc img._.composite_rgb_15 ; Divide
|
||||
push eax ebx ecx
|
||||
|
||||
movd eax, xmm3
|
||||
@@ -1006,7 +1055,7 @@ proc xcf._.composite_rgb_15 ; Divide
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_16 ; Dodge
|
||||
proc img._.composite_rgb_16 ; Dodge
|
||||
push eax ebx ecx
|
||||
|
||||
movd eax, xmm3
|
||||
@@ -1107,7 +1156,7 @@ proc xcf._.composite_rgb_16 ; Dodge
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_17 ; Burn
|
||||
proc img._.composite_rgb_17 ; Burn
|
||||
push eax ebx ecx
|
||||
|
||||
movd eax, xmm3
|
||||
@@ -1212,7 +1261,7 @@ proc xcf._.composite_rgb_17 ; Burn
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_18 ; Hard Light
|
||||
proc img._.composite_rgb_18 ; Hard Light
|
||||
push eax ebx ecx
|
||||
|
||||
movd eax, xmm3
|
||||
@@ -1297,7 +1346,7 @@ proc xcf._.composite_rgb_18 ; Hard Light
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_20 ; Grain Extract
|
||||
proc img._.composite_rgb_20 ; Grain Extract
|
||||
|
||||
punpcklbw xmm2, xmm0
|
||||
punpcklbw xmm3, xmm0
|
||||
@@ -1311,7 +1360,7 @@ proc xcf._.composite_rgb_20 ; Grain Extract
|
||||
endp
|
||||
|
||||
|
||||
proc xcf._.composite_rgb_21 ; Grain Merge
|
||||
proc img._.composite_rgb_21 ; Grain Merge
|
||||
|
||||
punpcklbw xmm2, xmm0
|
||||
punpcklbw xmm3, xmm0
|
||||
|
@@ -57,10 +57,11 @@ include 'xbm/xbm.asm'
|
||||
include 'scale.asm'
|
||||
include 'convert.asm'
|
||||
|
||||
COMPOSITE_MODE equ MMX
|
||||
; MMX | pretty fast and compatible
|
||||
; SSE | a bit faster, but may be unsupported by some CPUs
|
||||
include 'blend.asm'
|
||||
COMPOSITE_MODE equ MMX
|
||||
match =MMX, COMPOSITE_MODE {include 'blend_mmx.asm'}
|
||||
match =SSE, COMPOSITE_MODE {include 'blend_sse.asm'}
|
||||
|
||||
;;============================================================================;;
|
||||
proc lib_init ;///////////////////////////////////////////////////////////////;;
|
||||
|
@@ -963,8 +963,8 @@ endl
|
||||
@@:
|
||||
mov edx, 12
|
||||
.type_defined:
|
||||
mov ecx, (xcf._.composite_table.end - xcf._.composite_table.begin) / 8
|
||||
mov edi, xcf._.composite_table.begin
|
||||
mov ecx, (img._.composite_table.end - img._.composite_table.begin) / 8
|
||||
mov edi, img._.composite_table.begin
|
||||
|
||||
.still:
|
||||
cmp eax, [edi]
|
||||
@@ -1628,3 +1628,28 @@ xcf._.prop_table_begin:
|
||||
dd 11, xcf._.parse_properties.11
|
||||
dd 15, xcf._.parse_properties.15
|
||||
xcf._.prop_table_end:
|
||||
|
||||
img._.composite_table.begin:
|
||||
.p00 dd 00, img._.composite_rgb_00, img._.composite_gray_00, img._.composite_indexed_00 ; Normal
|
||||
.p01 dd 01, img._.composite_rgb_01, img._.composite_gray_01, img._.composite_gray_01 ; Dissolve : random dithering to discrete alpha
|
||||
; .p02 dd 02, img._.composite_rgb_02, 0, img._.composite_indexed_02 ; Behind : not selectable in the GIMP UI. not implemented
|
||||
.p03 dd 03, img._.composite_rgb_03, img._.composite_rgb_03, img._.composite_indexed_00 ; Multiply
|
||||
.p04 dd 04, img._.composite_rgb_04, img._.composite_rgb_04, img._.composite_indexed_00 ; Screen
|
||||
.p05 dd 05, img._.composite_rgb_05, img._.composite_rgb_05, img._.composite_indexed_00 ; Overlay
|
||||
.p06 dd 06, img._.composite_rgb_06, img._.composite_rgb_06, img._.composite_indexed_00 ; Difference
|
||||
.p07 dd 07, img._.composite_rgb_07, img._.composite_rgb_07, img._.composite_indexed_00 ; Addition
|
||||
.p08 dd 08, img._.composite_rgb_08, img._.composite_rgb_08, img._.composite_indexed_00 ; Subtract
|
||||
.p09 dd 09, img._.composite_rgb_09, img._.composite_rgb_09, img._.composite_indexed_00 ; Darken Only
|
||||
.p10 dd 10, img._.composite_rgb_10, img._.composite_rgb_10, img._.composite_indexed_00 ; Lighten Only
|
||||
.p11 dd 11, img._.composite_rgb_11, img._.composite_gray_00, img._.composite_indexed_00 ; Hue (H of HSV)
|
||||
.p12 dd 12, img._.composite_rgb_12, img._.composite_gray_00, img._.composite_indexed_00 ; Saturation (S of HSV)
|
||||
.p13 dd 13, img._.composite_rgb_13, img._.composite_gray_00, img._.composite_indexed_00 ; Color (H and S of HSL)
|
||||
.p14 dd 14, img._.composite_rgb_14, img._.composite_gray_00, img._.composite_indexed_00 ; Value (V of HSV)
|
||||
.p15 dd 15, img._.composite_rgb_15, img._.composite_rgb_15, img._.composite_indexed_00 ; Divide
|
||||
.p16 dd 16, img._.composite_rgb_16, img._.composite_rgb_16, img._.composite_indexed_00 ; Dodge
|
||||
.p17 dd 17, img._.composite_rgb_17, img._.composite_rgb_17, img._.composite_indexed_00 ; Burn
|
||||
.p18 dd 18, img._.composite_rgb_18, img._.composite_rgb_18, img._.composite_indexed_00 ; Hard Light
|
||||
.p19 dd 19, img._.composite_rgb_05, img._.composite_rgb_05, img._.composite_indexed_00 ; Soft Light : XCF >= 2 only ('soft light' == 'overlay')
|
||||
.p20 dd 20, img._.composite_rgb_20, img._.composite_rgb_20, img._.composite_indexed_00 ; Grain Extract : XCF >= 2 only
|
||||
.p21 dd 21, img._.composite_rgb_21, img._.composite_rgb_21, img._.composite_indexed_00 ; Grain Merge : XCF >= 2 only
|
||||
img._.composite_table.end:
|
||||
|
@@ -22,7 +22,6 @@ void graphicsInit() {
|
||||
}
|
||||
dbg_printf("spriteAtlas->Type = %d\n", spriteAtlas->Type);
|
||||
screenImage = img_create(DEFAULT_WIDTH, DEFAULT_HEIGHT, IMAGE_BPP32);
|
||||
// asm_inline("emms"); // doenst need bec. libimg functions used here does not use mmx (=> does not currept fpu state)
|
||||
}
|
||||
|
||||
void graphicsBlitAtlasImage(int atlasX, int atlasY, int destX, int destY, int w, int h, bool center) {
|
||||
@@ -63,7 +62,6 @@ void graphicsBlitAtlasImage(int atlasX, int atlasY, int destX, int destY, int w,
|
||||
//printf("start graphicsBlitAtlasImage ax = %d ay = %d dx = %d dy = %d w = %d h = %d %x %x\n\n", atlasX, atlasY, destX, destY, w, h, screenImage, spriteAtlas);
|
||||
|
||||
img_blend(screenImage, spriteAtlas, destX, destY, atlasX, atlasY, w, h);
|
||||
asm_inline("emms");
|
||||
|
||||
// dbg_printf("end graphicsBlitAtlasImage\n\n");
|
||||
}
|
||||
|
Reference in New Issue
Block a user