• R/O
  • SSH

wp2latex: Commit

WP2LaTeX sources.


Commit MetaInfo

Révisionffbc46817673b1aeda07bf9f742e8ae301757e39 (tree)
l'heure2022-06-02 07:40:03
AuteurFojtik
CommiterFojtik

Message de Log

Calculate bounding boxes on transformed data with "WorldTx" transform.

Change Summary

Modification

diff -r 8172f04b8a70 -r ffbc46817673 trunk/sources.cc/atoms/include/typedfs.h
--- a/trunk/sources.cc/atoms/include/typedfs.h Wed Jun 01 01:05:02 2022 +0200
+++ b/trunk/sources.cc/atoms/include/typedfs.h Thu Jun 02 00:40:03 2022 +0200
@@ -283,6 +283,7 @@
283283 #define ST_FLOAT_HI(ptr,val) ST_FLOAT_SWAP(ptr,val)
284284 #define LD_DOUBLE_HI(ptr) LD_DOUBLE_SWAP(ptr)
285285 #define ST_DOUBLE_HI(ptr,val) ST_DOUBLE_SWAP(ptr,val)
286+ #define LD_FLOAT_LO(ptr) LD_UINT32_CPU(ptr)
286287 #endif
287288
288289 #ifdef HI_ENDIAN
@@ -294,6 +295,8 @@
294295 #define LD_UINT64_HI(ptr) LD_UINT64_CPU(ptr)
295296 #define ST_UINT64_HI(ptr,val) ST_UINT64_CPU(ptr,val)
296297 #endif
298+ #define LD_FLOAT_HI(ptr) LD_UINT32_CPU(ptr)
299+ #define LD_FLOAT_LO(ptr) LD_FLOAT_SWAP(ptr)
297300 #endif
298301 #endif
299302
diff -r 8172f04b8a70 -r ffbc46817673 trunk/sources.cc/images.cc
--- a/trunk/sources.cc/images.cc Wed Jun 01 01:05:02 2022 +0200
+++ b/trunk/sources.cc/images.cc Thu Jun 02 00:40:03 2022 +0200
@@ -1870,7 +1870,7 @@
18701870 FloatBBox bbx;
18711871 VectorList VectList;
18721872
1873- bbx.MinX=65537; bbx.MaxX=-1; bbx.MinY=65537; bbx.MaxY=-1;
1873+ InitBBox(bbx);
18741874
18751875 CurrImg = &Img;
18761876
diff -r 8172f04b8a70 -r ffbc46817673 trunk/sources.cc/images/ras_img.cc
--- a/trunk/sources.cc/images/ras_img.cc Wed Jun 01 01:05:02 2022 +0200
+++ b/trunk/sources.cc/images/ras_img.cc Thu Jun 02 00:40:03 2022 +0200
@@ -258,6 +258,13 @@
258258 }
259259
260260
261+void InitBBox(FloatBBox & bbx)
262+{
263+ bbx.MinY = bbx.MinX = 65537;
264+ bbx.MaxY = bbx.MaxX =-32767;
265+}
266+
267+
261268 //------------------ART--------------------------
262269 #ifdef SupportART
263270
diff -r 8172f04b8a70 -r ffbc46817673 trunk/sources.cc/images/raster.h
--- a/trunk/sources.cc/images/raster.h Wed Jun 01 01:05:02 2022 +0200
+++ b/trunk/sources.cc/images/raster.h Thu Jun 02 00:40:03 2022 +0200
@@ -486,6 +486,8 @@
486486 float MaxY;
487487 } FloatBBox;
488488
489+void InitBBox(FloatBBox & bbx);
490+
489491 void UpdateBBox(FloatBBox & bbx,
490492 float alpha, float x, float y, float dx, float dy);
491493
diff -r 8172f04b8a70 -r ffbc46817673 trunk/sources.cc/pass1wmf.cc
--- a/trunk/sources.cc/pass1wmf.cc Wed Jun 01 01:05:02 2022 +0200
+++ b/trunk/sources.cc/pass1wmf.cc Thu Jun 02 00:40:03 2022 +0200
@@ -284,7 +284,7 @@
284284 NoConvertImage = 0;
285285 YOffset = XOffset = 0;
286286 YExtent = XExtent = 0;
287- bbx.MinX=65537; bbx.MaxX=-32767; bbx.MinY=65537; bbx.MaxY=-32767;
287+ InitBBox(bbx);
288288 // PSS has its own CTOR.
289289 PSS.FillPattern = FILL_SOLID;
290290 PSS.FontSizeW = PSS.FontSize = 1100/2.66; // Default font size [mm]
@@ -3149,7 +3149,7 @@
31493149 Rd_dword(wpd, &Count);
31503150 if(Count > (EmfRec.Size - 28)/4)
31513151 Count = (EmfRec.Size - 28)/4;
3152- float *Points = LoadPoints(this, Count, bbx);
3152+ float *Points = LoadPoints(this, Count, bbx, &WorldTx);
31533153 if(Points==NULL) goto POLY_FAIL;
31543154
31553155 const float Scale = GetScale2PSU((TMapMode)MapMode);
@@ -3161,8 +3161,7 @@
31613161 VectorPolygon *pVecPoly = new VectorPolygon(Points, Count);
31623162 Points = NULL;
31633163 pVecPoly->AttribFromPSS(PSS);
3164- pVecPoly->Close = true;
3165- pVecPoly->Transform(WorldTx);
3164+ pVecPoly->Close = true;
31663165 VectList.AddObject(pVecPoly); pVecPoly=NULL;
31673166
31683167 strcpy(ObjType,ObjName+1);
@@ -3188,7 +3187,7 @@
31883187 Count = (EmfRec.Size-28) / 4;
31893188 if(Count>0)
31903189 {
3191- float *Points = LoadPoints(this, Count, bbx, NULL);
3190+ float *Points = LoadPoints(this, Count, bbx, &WorldTx);
31923191 if(Points!=NULL)
31933192 {
31943193 const float Scale = GetScale2PSU((TMapMode)MapMode);
@@ -3202,7 +3201,7 @@
32023201
32033202 pVecPoly->AttribFromPSS(PSS);
32043203 pVecPoly->Close = false;
3205- pVecPoly->Transform(WorldTx);
3204+ //pVecPoly->Transform(WorldTx);
32063205 VectList.AddObject(pVecPoly); pVecPoly=NULL;
32073206
32083207 strcpy(ObjType,ObjName+1);
@@ -3233,7 +3232,7 @@
32333232 Count = (EmfRec.Size-28) / 4;
32343233 if(Count>0)
32353234 {
3236- float *Points = LoadPoints(this, Count, bbx, NULL);
3235+ float *Points = LoadPoints(this, Count, bbx, &WorldTx);
32373236 if(Points!=NULL)
32383237 {
32393238 const float Scale = GetScale2PSU((TMapMode)MapMode);
@@ -3247,7 +3246,7 @@
32473246
32483247 pVecCurve->AttribFromPSS(PSS);
32493248 pVecCurve->Close = false;
3250- pVecCurve->Transform(WorldTx);
3249+ //pVecCurve->Transform(WorldTx);
32513250 VectList.AddObject(pVecCurve); pVecCurve=NULL;
32523251
32533252 strcpy(ObjType,ObjName+1);
@@ -3297,7 +3296,7 @@
32973296 for(i=0; i<NumberOfPolygons; i++)
32983297 if(PolypolygonPointCount[i]>0)
32993298 {
3300- float *Points = LoadPoints(this, PolypolygonPointCount[i], bbx);
3299+ float *Points = LoadPoints(this, PolypolygonPointCount[i], bbx, &WorldTx);
33013300 if(Points==NULL) break;
33023301
33033302 for(int j=0; j<2*PolypolygonPointCount[i]; j++)
@@ -3309,7 +3308,7 @@
33093308 Points = NULL;
33103309 pVecPoly->AttribFromPSS(PSS);
33113310 pVecPoly->Close = true;
3312- pVecPoly->Transform(WorldTx);
3311+ //pVecPoly->Transform(WorldTx);
33133312 VectList.AddObject(pVecPoly); pVecPoly=NULL;
33143313 }
33153314
@@ -3346,7 +3345,7 @@
33463345 for(i=0; i<NumberOfPolylines; i++)
33473346 if(PolylinePointCount[i]>0)
33483347 {
3349- float *Points = LoadPoints(this, PolylinePointCount[i], bbx, NULL);
3348+ float *Points = LoadPoints(this, PolylinePointCount[i], bbx, &WorldTx);
33503349 if(Points==NULL) break; // PolylinePointCount must be deallocated
33513350
33523351 for(int j=0; j<2*PolylinePointCount[i]; j++)
@@ -3359,7 +3358,7 @@
33593358
33603359 pVecPoly->AttribFromPSS(PSS);
33613360 pVecPoly->Close = false;
3362- pVecPoly->Transform(WorldTx);
3361+ //pVecPoly->Transform(WorldTx);
33633362 VectList.AddObject(pVecPoly); pVecPoly=NULL;
33643363
33653364 strcpy(ObjType,ObjName+1);
Afficher sur ancien navigateur de dépôt.