• R/O
  • SSH

wp2latex: Commit

WP2LaTeX sources.


Commit MetaInfo

Revisiond0aee654a35a6d1d0d2bb1d2ed1974c1ed207e0a (tree)
Zeit2022-05-02 07:43:41
AutorFojtik
CommiterFojtik

Log Message

Raster image processing has been optimised for Win32 and Win64 targets.

Ändern Zusammenfassung

Diff

diff -r 62262796d9b1 -r d0aee654a35a trunk/msvc/wp2latex.vcproj
--- a/trunk/msvc/wp2latex.vcproj Sun May 01 02:27:36 2022 +0200
+++ b/trunk/msvc/wp2latex.vcproj Mon May 02 00:43:41 2022 +0200
@@ -4363,6 +4363,270 @@
43634363 >
43644364 </File>
43654365 <File
4366+ RelativePath="..\sources.cc\images\img_tool.c"
4367+ >
4368+ <FileConfiguration
4369+ Name="Debug_PNG_Gtxt|Win32"
4370+ ExcludedFromBuild="true"
4371+ >
4372+ <Tool
4373+ Name="VCCLCompilerTool"
4374+ />
4375+ </FileConfiguration>
4376+ <FileConfiguration
4377+ Name="Debug_PNG_Gtxt|x64"
4378+ ExcludedFromBuild="true"
4379+ >
4380+ <Tool
4381+ Name="VCCLCompilerTool"
4382+ />
4383+ </FileConfiguration>
4384+ <FileConfiguration
4385+ Name="Debug_Gettext|Win32"
4386+ ExcludedFromBuild="true"
4387+ >
4388+ <Tool
4389+ Name="VCCLCompilerTool"
4390+ />
4391+ </FileConfiguration>
4392+ <FileConfiguration
4393+ Name="Debug_Gettext|x64"
4394+ ExcludedFromBuild="true"
4395+ >
4396+ <Tool
4397+ Name="VCCLCompilerTool"
4398+ />
4399+ </FileConfiguration>
4400+ <FileConfiguration
4401+ Name="Release|Win32"
4402+ ExcludedFromBuild="true"
4403+ >
4404+ <Tool
4405+ Name="VCCLCompilerTool"
4406+ />
4407+ </FileConfiguration>
4408+ <FileConfiguration
4409+ Name="Release|x64"
4410+ ExcludedFromBuild="true"
4411+ >
4412+ <Tool
4413+ Name="VCCLCompilerTool"
4414+ />
4415+ </FileConfiguration>
4416+ <FileConfiguration
4417+ Name="Release_Gettext|Win32"
4418+ ExcludedFromBuild="true"
4419+ >
4420+ <Tool
4421+ Name="VCCLCompilerTool"
4422+ />
4423+ </FileConfiguration>
4424+ <FileConfiguration
4425+ Name="Release_Gettext|x64"
4426+ ExcludedFromBuild="true"
4427+ >
4428+ <Tool
4429+ Name="VCCLCompilerTool"
4430+ />
4431+ </FileConfiguration>
4432+ <FileConfiguration
4433+ Name="Release_PNG_Gtxt|Win32"
4434+ ExcludedFromBuild="true"
4435+ >
4436+ <Tool
4437+ Name="VCCLCompilerTool"
4438+ />
4439+ </FileConfiguration>
4440+ <FileConfiguration
4441+ Name="Release_PNG_Gtxt|x64"
4442+ ExcludedFromBuild="true"
4443+ >
4444+ <Tool
4445+ Name="VCCLCompilerTool"
4446+ />
4447+ </FileConfiguration>
4448+ <FileConfiguration
4449+ Name="Debug|Win32"
4450+ ExcludedFromBuild="true"
4451+ >
4452+ <Tool
4453+ Name="VCCLCompilerTool"
4454+ />
4455+ </FileConfiguration>
4456+ <FileConfiguration
4457+ Name="Debug|x64"
4458+ ExcludedFromBuild="true"
4459+ >
4460+ <Tool
4461+ Name="VCCLCompilerTool"
4462+ />
4463+ </FileConfiguration>
4464+ </File>
4465+ <File
4466+ RelativePath="..\sources.cc\images\img_tool_MSVC.asm"
4467+ >
4468+ <FileConfiguration
4469+ Name="Debug_PNG_Gtxt|x64"
4470+ ExcludedFromBuild="true"
4471+ >
4472+ <Tool
4473+ Name="MASM"
4474+ />
4475+ </FileConfiguration>
4476+ <FileConfiguration
4477+ Name="Debug_Gettext|x64"
4478+ ExcludedFromBuild="true"
4479+ >
4480+ <Tool
4481+ Name="MASM"
4482+ />
4483+ </FileConfiguration>
4484+ <FileConfiguration
4485+ Name="Release|x64"
4486+ ExcludedFromBuild="true"
4487+ >
4488+ <Tool
4489+ Name="MASM"
4490+ />
4491+ </FileConfiguration>
4492+ <FileConfiguration
4493+ Name="Release_Gettext|x64"
4494+ ExcludedFromBuild="true"
4495+ >
4496+ <Tool
4497+ Name="MASM"
4498+ />
4499+ </FileConfiguration>
4500+ <FileConfiguration
4501+ Name="Release_PNG_Gtxt|x64"
4502+ ExcludedFromBuild="true"
4503+ >
4504+ <Tool
4505+ Name="MASM"
4506+ />
4507+ </FileConfiguration>
4508+ <FileConfiguration
4509+ Name="Debug|x64"
4510+ ExcludedFromBuild="true"
4511+ >
4512+ <Tool
4513+ Name="MASM"
4514+ />
4515+ </FileConfiguration>
4516+ </File>
4517+ <File
4518+ RelativePath="..\sources.cc\images\img_tool_MSVC64.asm"
4519+ >
4520+ <FileConfiguration
4521+ Name="Debug_PNG_Gtxt|Win32"
4522+ ExcludedFromBuild="true"
4523+ >
4524+ <Tool
4525+ Name="MASM"
4526+ />
4527+ </FileConfiguration>
4528+ <FileConfiguration
4529+ Name="Debug_PNG_Gtxt|x64"
4530+ >
4531+ <Tool
4532+ Name="VCCustomBuildTool"
4533+ Description="ASM64"
4534+ CommandLine="ml64.exe /c /nologo /Fo&quot;$(OutDir)\$(InputName).obj&quot; /W3 /Zi /errorReport:prompt $(InputPath)"
4535+ Outputs="$(OutDir)\$(InputName).obj"
4536+ />
4537+ </FileConfiguration>
4538+ <FileConfiguration
4539+ Name="Debug_Gettext|Win32"
4540+ ExcludedFromBuild="true"
4541+ >
4542+ <Tool
4543+ Name="MASM"
4544+ />
4545+ </FileConfiguration>
4546+ <FileConfiguration
4547+ Name="Debug_Gettext|x64"
4548+ >
4549+ <Tool
4550+ Name="VCCustomBuildTool"
4551+ Description="ASM64"
4552+ CommandLine="ml64.exe /c /nologo /Fo&quot;$(OutDir)\$(InputName).obj&quot; /W3 /Zi /errorReport:prompt $(InputPath)"
4553+ Outputs="$(OutDir)\$(InputName).obj"
4554+ />
4555+ </FileConfiguration>
4556+ <FileConfiguration
4557+ Name="Release|Win32"
4558+ ExcludedFromBuild="true"
4559+ >
4560+ <Tool
4561+ Name="MASM"
4562+ />
4563+ </FileConfiguration>
4564+ <FileConfiguration
4565+ Name="Release|x64"
4566+ >
4567+ <Tool
4568+ Name="VCCustomBuildTool"
4569+ Description="ASM64"
4570+ CommandLine="ml64.exe /c /nologo /Fo&quot;$(OutDir)\$(InputName).obj&quot; /W3 /Zi /errorReport:prompt $(InputPath)"
4571+ Outputs="$(OutDir)\$(InputName).obj"
4572+ />
4573+ </FileConfiguration>
4574+ <FileConfiguration
4575+ Name="Release_Gettext|Win32"
4576+ ExcludedFromBuild="true"
4577+ >
4578+ <Tool
4579+ Name="MASM"
4580+ />
4581+ </FileConfiguration>
4582+ <FileConfiguration
4583+ Name="Release_Gettext|x64"
4584+ >
4585+ <Tool
4586+ Name="VCCustomBuildTool"
4587+ Description="ASM64"
4588+ CommandLine="ml64.exe /c /nologo /Fo&quot;$(OutDir)\$(InputName).obj&quot; /W3 /Zi /errorReport:prompt $(InputPath)"
4589+ Outputs="$(OutDir)\$(InputName).obj"
4590+ />
4591+ </FileConfiguration>
4592+ <FileConfiguration
4593+ Name="Release_PNG_Gtxt|Win32"
4594+ ExcludedFromBuild="true"
4595+ >
4596+ <Tool
4597+ Name="MASM"
4598+ />
4599+ </FileConfiguration>
4600+ <FileConfiguration
4601+ Name="Release_PNG_Gtxt|x64"
4602+ >
4603+ <Tool
4604+ Name="VCCustomBuildTool"
4605+ Description="ASM64"
4606+ CommandLine="ml64.exe /c /nologo /Fo&quot;$(OutDir)\$(InputName).obj&quot; /W3 /Zi /errorReport:prompt $(InputPath)"
4607+ Outputs="$(OutDir)\$(InputName).obj"
4608+ />
4609+ </FileConfiguration>
4610+ <FileConfiguration
4611+ Name="Debug|Win32"
4612+ ExcludedFromBuild="true"
4613+ >
4614+ <Tool
4615+ Name="MASM"
4616+ />
4617+ </FileConfiguration>
4618+ <FileConfiguration
4619+ Name="Debug|x64"
4620+ >
4621+ <Tool
4622+ Name="VCCustomBuildTool"
4623+ Description="ASM64"
4624+ CommandLine="ml64.exe /c /nologo /Fo&quot;$(OutDir)\$(InputName).obj&quot; /W3 /Zi /errorReport:prompt $(InputPath)"
4625+ Outputs="$(OutDir)\$(InputName).obj"
4626+ />
4627+ </FileConfiguration>
4628+ </File>
4629+ <File
43664630 RelativePath=".\imgsupp.cpp"
43674631 >
43684632 </File>
diff -r 62262796d9b1 -r d0aee654a35a trunk/sources.cc/images/img_tool.c
--- a/trunk/sources.cc/images/img_tool.c Sun May 01 02:27:36 2022 +0200
+++ b/trunk/sources.cc/images/img_tool.c Mon May 02 00:43:41 2022 +0200
@@ -10,16 +10,16 @@
1010 /** Flip R and B coupounds inplace.
1111 * param[in] Data Pointer to data.
1212 * param[in] Size Amount of RGB tripplets. */
13-void RGB_BGR(char *Data, int size)
13+void RGB_BGR(char *Data, int PixelCount)
1414 {
1515 char c;
16-while(size-->0)
17- {
18- c=Data[2];
19- Data[2]=*Data;
20- *Data=c;
21- Data+=3;
22- }
16+ while(PixelCount-->0)
17+ {
18+ c = Data[2];
19+ Data[2] = *Data;
20+ *Data = c;
21+ Data += 3;
22+ }
2323 }
2424
2525
@@ -80,7 +80,8 @@
8080 }
8181
8282
83-/** Invert block of data. */
83+/** Invert block of data.
84+ * @param[in] size Block size in Bytes. */
8485 void NotR(char *R, int size) //R1:=not(R1)
8586 {
8687 while(size-->0)
diff -r 62262796d9b1 -r d0aee654a35a trunk/sources.cc/images/img_tool_MSVC.asm
--- a/trunk/sources.cc/images/img_tool_MSVC.asm Sun May 01 02:27:36 2022 +0200
+++ b/trunk/sources.cc/images/img_tool_MSVC.asm Mon May 02 00:43:41 2022 +0200
@@ -11,11 +11,10 @@
1111 Data:ptr byte, \
1212 PixelCount:DWORD
1313
14- mov ecx,[PixelCount] ; cx=amount of pixels
15- cmp ecx,1
16- jle ToEnd ; array has zero size
14+ mov ecx,[PixelCount] ; cx=amount of pixels
15+ jecxz ToEnd ; array has zero size
1716
18- mov esi,[Data] ;
17+ mov esi,[Data] ; Load data ptr.
1918
2019 LoopPix:mov al,[esi]
2120 mov ah,[esi+2]
@@ -30,33 +29,89 @@
3029 RGB_BGR endp
3130
3231
32+
3333 ;void RGB_BGR2(unsigned char *OutData, const unsigned char *InData, unsigned PixelCount)
3434 public RGB_BGR2
3535 RGB_BGR2 proc \
36- uses esi edi \
36+ uses esi edi ebx, \
3737 OutData:ptr byte, \
3838 InData:ptr byte, \
3939 PixelCount:DWORD
4040
41- mov ecx,[PixelCount] ; cx=amount of pixels
42- cmp ecx,1
43- jle ToEnd ; array has zero size
41+ mov ecx,[PixelCount] ; cx=amount of pixels
4442
4543 mov esi,[InData] ;
4644 mov edi,[OutData] ;
4745
46+ sub ecx,4
47+ jl LoopSimple
48+
49+ ; Processing of 4px block with size 3xDWORD
50+ xor edx,edx ; EDX=0
51+LoopPix4:lodsd ; EAX = R2 B1 G1 R1
52+ mov ebx,eax
53+ ror ebx,16 ; EBX = G1 R1 R2 B1
54+
55+ mov dh,bh ; DL = R2
56+ and ebx,00FF00FFh ; EBX = 00 R1 00 B1
57+ mov bh,ah ; EBX = 00 R1 G1 B1
58+
59+ lodsd ; EAX = G3 R3 B2 G2
60+ xchg ah,dh ; EAX = G3 R3 R2 G2
61+
62+ shl edx,16
63+ or ebx,edx ; EBX = B2 R1 G1 B1
64+
65+ mov [edi],ebx ; B2 R1 G1 B1 shipped out
66+ add edi,4
67+
68+ mov ebx,eax ; EBX = G3 R3 R2 G2
69+ rol ebx,16 ; EBX = R2 G2 G3 R3
70+
71+ lodsd ; EAX = B4 G4 R4 B3
72+ xchg bl,al ; EAX = B4 G4 R4 R3
73+
74+ rol ebx,16 ; EBX = G3 B3 R2 G2
75+ mov [edi],ebx ; G3 B3 R2 G2 shipped out
76+ add edi,4
77+
78+ mov ebx,eax ; EBX = B4 G4 R4 R3
79+ rol ebx,16 ; EBX = R4 R3 B4 G4
80+ and eax, 00FF00FFh ; EAX = 00 G4 00 R3
81+ and ebx,0FF00FF00h ; EBX = R4 00 B4 00
82+ or eax,ebx
83+
84+ stosd ; R4 G4 B4 R3 shipped out
85+ ;mov [edi],eax ; (STOSD is slow on AMD, replaced, seems that Intel works reversed)
86+ ;add edi,4
87+
88+ sub ecx,4
89+ jae LoopPix4
90+
91+ ; Simple loop for 0,1,2,3 pixels (works also for more px)
92+LoopSimple:
93+ add ecx,4 ; ecx was -4, correct counter
94+ jecxz ToEnd ; array has zero size
4895 LoopPix:lodsw
4996 mov [edi+2],al
5097 mov [edi+1],ah
5198 lodsb
5299 mov [edi],al
53100 add edi,3
101+ dec ecx
102+ jz ToEnd
103+
104+ lodsb
105+ mov [edi+2],al
106+ lodsw
107+ mov [edi+1],al
108+ mov [edi],ah
109+ add edi,3
110+
54111 loop LoopPix
55-
56-ToEnd:
57- ret ; _cdecl return
58-
59-RGB_BGR2 endp
112+ToEnd: ret
113+
114+RGB_BGR2 endp
60115
61116
62117 ;void RGB32_BGR24(unsigned char *OutData, const unsigned char *InData, unsigned PixelCount)
@@ -67,12 +122,61 @@
67122 InData:ptr byte, \
68123 PixelCount:DWORD
69124
70- mov ecx,[PixelCount] ; cx=amount of pixels
71- cmp ecx,1
72- jle ToEnd ; array has zero size
125+ mov ecx,[PixelCount] ; ecx=amount of pixels
73126
74- mov esi,[InData] ;
75- mov edi,[OutData] ;
127+ mov esi,[InData] ; source data
128+ mov edi,[OutData] ; destination data
129+
130+ sub ecx,4
131+ jl LoopSimple ; array size < 4
132+
133+LoopPx4:mov eax,[esi] ; EAX = ?? B1 G1 R1
134+ add esi,4
135+ mov ebx,eax ; EBX = ?? B1 G1 R1
136+ rol ebx,8 ; EBX = B1 G1 R1 ??
137+ mov bl,ah ; EBX = B1 G1 R1 G1
138+ ror ebx,8 ; EBX = G1 B1 G1 R1
139+
140+; lodsd ; EAX = ?? B2 G2 R2
141+ mov eax,[esi]
142+ add esi,4
143+
144+ mov edx,eax ; EDX = ?? B2 G2 R2
145+
146+ sar edx,8 ; EDX = 00 ?? B2 ??
147+ mov bh,dh ; EBX = G1 B1 B2 R1
148+ ror ebx,16 ; EBX = B2 R1 G1 B1
149+ mov [edi],ebx ; shipout B2 R1 G1 B1
150+ add edi,4
151+
152+ mov ebx,[esi] ; EBX = ?? B3 G3 R3
153+ add esi,4
154+ mov dl,bl ; EDX = ?? ?? ?? R3
155+
156+ sar ebx,8 ; EBX = 00 ?? B3 G3
157+ xchg bl,bh ; EBX = 00 ?? G3 B3
158+ sal ebx,16 ; EBX = G3 B3 00 00
159+ mov bl,ah ; EBX = G3 B3 00 G2
160+ mov bh,al ; EBX = G3 B3 R2 G2
161+
162+ mov [edi],ebx ; shipout G3 B3 R2 G2
163+ add edi,4
164+
165+ lodsd ; EAX = ?? B4 G4 R4
166+
167+ xchg al,ah ; EAX = ?? B4 R4 G4
168+ rol eax,16 ; EAX = R4 G4 ?? B4
169+ mov ah,al ; EAX = R4 G4 B4 B4
170+ mov al,dl ; EAX = R4 G4 B4 R3
171+
172+ stosd ; shipout R4 G4 B4 R3
173+
174+ sub ecx,4
175+ jae LoopPx4
176+
177+LoopSimple:
178+ add ecx,4
179+ jz ToEnd ; remaining size = 0
76180
77181 LoopPix:lodsd
78182 mov [edi+2],al
@@ -289,32 +393,31 @@
289393 ;void NotR(char *R, unsigned DataSize) //R1:=not(R1)
290394 public NotR
291395 NotR proc \
292- uses esi, \
396+ uses edi, \
293397 R:ptr byte, \
294398 DataSize:DWORD
295399
296400 mov ecx,[DataSize] ; cx=amount of pixels/bytes
297- mov esi,[R] ; Row byte data
298-
299- cmp ecx,4
401+ mov edi,[R] ; Row byte data
402+
403+ sub ecx,4
300404 jl LoopPx1
301405
302- sub ecx,4
303-LoopPx4:mov eax,[esi] ; Invert DWORDs
304- not eax
305- mov [esi],eax
306- add esi,4
406+LoopPx4:mov eax,[edi] ; Invert DWORDs
407+ not eax
408+ mov [edi],eax
409+ add edi,4
307410
308411 sub ecx,4
309412 jge LoopPx4
310413
311- add ecx,4
312-
313-LoopPx1:jecxz ToEnd
314-LoopPix:mov al,[esi] ; Invert BYTEs
414+LoopPx1:add ecx,4
415+ jz ToEnd
416+
417+LoopPix:mov al,[edi] ; Invert BYTEs
315418 not al
316- mov [esi],al
317- inc esi
419+ mov [edi],al
420+ inc edi
318421 loop LoopPix
319422 ToEnd:
320423 ret ; _cdecl return
diff -r 62262796d9b1 -r d0aee654a35a trunk/sources.cc/images/img_tool_MSVC64.asm
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/trunk/sources.cc/images/img_tool_MSVC64.asm Mon May 02 00:43:41 2022 +0200
@@ -0,0 +1,229 @@
1+
2+.CODE ;Indicates the start of a code segment.
3+
4+
5+;void RGB_BGR(unsigned char *Data, unsigned PixelCount)
6+ public RGB_BGR
7+
8+RGB_BGR proc \
9+ uses rsi
10+; Dest:ptr byte, RCX
11+; count:DWORD RDX
12+
13+ mov rsi,rcx ; Load data ptr.
14+ mov rcx,rdx ; rcx=amount of pixels
15+ jrcxz ToEnd ; array has zero size
16+
17+LoopPix:mov al,[rsi]
18+ mov ah,[rsi+2]
19+ mov [rsi],ah
20+ mov [rsi+2],al
21+ add rsi,3
22+ loop LoopPix
23+
24+ToEnd:
25+ ret ; _cdecl return
26+
27+RGB_BGR endp
28+
29+
30+
31+;void RGB_BGR2(unsigned char *OutData, const unsigned char *InData, unsigned PixelCount)
32+ public RGB_BGR2
33+RGB_BGR2 proc \
34+ uses rsi rdi rbx
35+; OutData: ptr byte,RCX
36+; InData: ptr byte,RDX
37+; PixelCount: QWORD R8
38+
39+ mov rsi,rdx
40+ mov rdi,rcx
41+
42+ mov rcx,R8 ; cx=amount of pixels
43+
44+ sub rcx,4
45+ jl LoopSimple
46+
47+ ; Processing of 4px block with size 3xDWORD
48+ xor edx,edx ; EDX=0
49+LoopPix4:lodsd ; EAX = R2 B1 G1 R1
50+ mov ebx,eax
51+ ror ebx,16 ; EBX = G1 R1 R2 B1
52+
53+ mov dh,bh ; DL = R2
54+ and ebx,00FF00FFh ; EBX = 00 R1 00 B1
55+ mov bh,ah ; EBX = 00 R1 G1 B1
56+
57+ lodsd ; EAX = G3 R3 B2 G2
58+ xchg ah,dh ; EAX = G3 R3 R2 G2
59+
60+ shl edx,16
61+ or ebx,edx ; EBX = B2 R1 G1 B1
62+
63+ mov [rdi],ebx ; B2 R1 G1 B1 shipped out
64+ add rdi,4
65+
66+ mov ebx,eax ; EBX = G3 R3 R2 G2
67+ rol ebx,16 ; EBX = R2 G2 G3 R3
68+
69+ lodsd ; EAX = B4 G4 R4 B3
70+ xchg bl,al ; EAX = B4 G4 R4 R3
71+
72+ rol ebx,16 ; EBX = G3 B3 R2 G2
73+ mov [rdi],ebx ; G3 B3 R2 G2 shipped out
74+ add rdi,4
75+
76+ mov ebx,eax ; EBX = B4 G4 R4 R3
77+ rol ebx,16 ; EBX = R4 R3 B4 G4
78+ and eax, 00FF00FFh ; EAX = 00 G4 00 R3
79+ and ebx,0FF00FF00h ; EBX = R4 00 B4 00
80+ or eax,ebx
81+
82+ stosd ; R4 G4 B4 R3 shipped out
83+
84+ sub rcx,4
85+ jae LoopPix4
86+
87+ ; Simple loop for 0,1,2,3 pixels (works also for more px)
88+LoopSimple:
89+ add rcx,4 ; rcx was -4, correct counter
90+ jz ToEnd ; array has zero size
91+
92+LoopPix:lodsw
93+ mov [rdi+2],al
94+ mov [rdi+1],ah
95+ lodsb
96+ mov [rdi],al
97+ add rdi,3
98+ dec rcx
99+ jz ToEnd
100+
101+ lodsb
102+ mov [rdi+2],al
103+ lodsw
104+ mov [rdi+1],al
105+ mov [rdi],ah
106+ add rdi,3
107+
108+ loop LoopPix
109+ToEnd: ret
110+
111+RGB_BGR2 endp
112+
113+
114+
115+;void RGB32_BGR24(unsigned char *OutData, const unsigned char *InData, unsigned PixelCount)
116+ public RGB32_BGR24
117+RGB32_BGR24 proc \
118+ uses rsi rdi rbx
119+; OutData: ptr byte,RCX
120+; InData: ptr byte,RDX
121+; PixelCount: QWORD R8
122+
123+ mov rsi,rdx ; source data
124+ mov rdi,rcx ; destination data
125+
126+ mov rcx,R8 ; rcx=amount of pixels
127+
128+ sub rcx,4
129+ jl LoopSimple ; array size < 4
130+
131+LoopPx4:mov eax,[rsi] ; EAX = ?? B1 G1 R1
132+ add rsi,4
133+ mov ebx,eax ; EBX = ?? B1 G1 R1
134+
135+ rol ebx,8 ; EBX = B1 G1 R1 ??
136+ mov bl,ah ; EBX = B1 G1 R1 G1
137+ ror ebx,8 ; EBX = G1 B1 G1 R1
138+
139+; lodsd ; EAX = ?? B2 G2 R2
140+ mov eax,[rsi]
141+ add rsi,4
142+ mov edx,eax ; EDX = ?? B2 G2 R2
143+
144+ sar edx,8 ; EDX = 00 ?? B2 ??
145+ mov bh,dh ; EBX = G1 B1 B2 R1
146+ ror ebx,16 ; EBX = B2 R1 G1 B1
147+ mov [rdi],ebx ; shipout B2 R1 G1 B1
148+ add rdi,4
149+
150+ mov ebx,[rsi] ; EBX = ?? B3 G3 R3
151+ add rsi,4
152+ mov dl,bl ; EDX = ?? ?? ?? R3
153+
154+ sar ebx,8 ; EBX = 00 ?? B3 G3
155+ xchg bl,bh ; EBX = 00 ?? G3 B3
156+ sal ebx,16 ; EBX = G3 B3 00 00
157+ mov bl,ah ; EBX = G3 B3 00 G2
158+ mov bh,al ; EBX = G3 B3 R2 G2
159+
160+ mov [rdi],ebx ; shipout G3 B3 R2 G2
161+ add rdi,4
162+
163+ lodsd ; EAX = ?? B4 G4 R4
164+
165+ xchg al,ah ; EAX = ?? B4 R4 G4
166+ rol eax,16 ; EAX = R4 G4 ?? B4
167+ mov ah,al ; EAX = R4 G4 B4 B4
168+ mov al,dl ; EAX = R4 G4 B4 R3
169+
170+ stosd ; shipout R4 G4 B4 R3
171+
172+ sub rcx,4
173+ jae LoopPx4
174+
175+LoopSimple:
176+ add rcx,4
177+ jz ToEnd ; remaining size = 0
178+
179+LoopPix:lodsd
180+ mov [rdi+2],al
181+ mov [rdi+1],ah
182+ shr eax,8
183+ mov [rdi],ah
184+ add rdi,3
185+ loop LoopPix
186+
187+ToEnd:
188+ ret ; _cdecl return
189+
190+RGB32_BGR24 endp
191+
192+
193+;void NotR(char *R, unsigned DataSize) //R1:=not(R1)
194+ public NotR
195+NotR proc \
196+ uses rdi
197+; Dest:ptr byte, RCX
198+; count:DWORD RDX
199+
200+ mov rdi,rcx
201+ mov rcx,rdx ; rcx=amount of pixels/bytes
202+
203+ sub rcx,8
204+ jl LoopPx1
205+
206+LoopPx8:mov rax,[rdi] ; Invert DWORDs
207+ not rax
208+ mov [rdi],rax
209+ add rdi,8
210+
211+ sub rcx,8
212+ jge LoopPx8
213+
214+LoopPx1:add rcx,8
215+ jz ToEnd
216+
217+LoopPix:mov al,[rdi] ; Invert BYTEs
218+ not al
219+ mov [rdi],al
220+ inc rdi
221+ loop LoopPix
222+ToEnd:
223+ ret ; _cdecl return
224+
225+NotR endp
226+
227+
228+
229+ end
diff -r 62262796d9b1 -r d0aee654a35a trunk/sources.cc/wp2latex.h
--- a/trunk/sources.cc/wp2latex.h Sun May 01 02:27:36 2022 +0200
+++ b/trunk/sources.cc/wp2latex.h Mon May 02 00:43:41 2022 +0200
@@ -18,7 +18,7 @@
1818 #define LineLength 80 /* Split lines after more than LineLength charcters */
1919
2020 #define VersionWP2L "3.pre107"
21-#define VersionDate "30 Apr 2022" /* day (space) month (space) full year */
21+#define VersionDate "1 May 2022" /* day (space) month (space) full year */
2222
2323 #ifndef false
2424 #define false 0
Show on old repository browser