28 const unsigned char nTopBitInt7 = 0x80;
29 const unsigned char nSignBitInt7 = 0x40;
32 const unsigned char nValueMaskInt7 = 0x7F;
52 bool bIsEmfPlusInteger15 = u8 & nTopBitInt7;
53 bool bNegative = u8 & nSignBitInt7;
54 unsigned char val1 = u8 & nValueMaskInt7;
57 if (!bIsEmfPlusInteger15)
59 return static_cast<signed char>(val1);
63 sal_uInt16 nRet = (val1 << 8) | u8;
64 return static_cast<sal_Int16
>(nRet);
89 if (pathFlags & 0x800)
98 SAL_INFO(
"drawinglayer.emf",
"EMF+\t\t\t" <<
i <<
". EmfPlusPointR [x,y]: " <<
x <<
", " <<
y);
100 else if (pathFlags & 0x4000)
106 SAL_INFO(
"drawinglayer.emf",
"EMF+\t\t\t" <<
i <<
". EmfPlusPoint [x,y]: " <<
x <<
", " <<
y);
114 SAL_INFO(
"drawinglayer.emf",
"EMF+\t" <<
i <<
". EMFPlusPointF [x,y]: " << fx <<
", " << fy);
125 SAL_INFO(
"drawinglayer.emf",
"EMF+\tpoint type: 0x" << std::hex <<
static_cast<int>(
pPointTypes[
i]) << std::dec);
136 sal_uInt32 last_normal = 0,
p = 0;
138 bool hasPrev =
false;
159 if (((
i - last_normal )% 3) == 1)
162 SAL_INFO (
"drawinglayer.emf",
"EMF+\t\tPolygon append next: " <<
p - 1 <<
" mapped: " << mapped.
getX () <<
"," << mapped.
getY ());
165 else if (((
i - last_normal) % 3) == 2)
184 SAL_INFO (
"drawinglayer.emf",
"EMF+\t\tPolygon append prev: " <<
p <<
" mapped: " << prev.
getX () <<
"," << prev.
getY ());
194 SAL_INFO (
"drawinglayer.emf",
"EMF+\t\tClose polygon");
202 if (bAddLineToCloseShape)
207 if (polygon.
count ())
211#if OSL_DEBUG_LEVEL > 1
214 SAL_INFO (
"drawinglayer.emf",
"EMF+\t\tPolygon: " <<
i);
215 for (
unsigned int j=0; j<polygon.
count(); j++) {
217 SAL_INFO (
"drawinglayer.emf",
"EMF+\t\t\tPoint: " <<
point.getX() <<
"," <<
point.getY());
220 SAL_INFO (
"drawinglayer.emf",
"EMF+\t\t\tPrev: " <<
point.getX() <<
"," <<
point.getY());
224 SAL_INFO (
"drawinglayer.emf",
"EMF+\t\t\tNext: " <<
point.getX() <<
"," <<
point.getY());
236 m[0][1] = 2. - tension;
237 m[0][2] = tension - 2.;
238 m[1][0] = 2. * tension;
239 m[1][1] = tension - 3.;
240 m[1][2] = 3. - 2. * tension;
242 m[0][3] =
m[2][2] = tension;
243 m[0][0] =
m[1][3] =
m[2][0] = -tension;
244 m[2][1] =
m[2][3] =
m[3][0] =
m[3][2] =
m[3][3] = 0.;
249 double a =
m[0][0] * p0 +
m[0][1] * p1 +
m[0][2] * p2 +
m[0][3] * p3;
250 double b =
m[1][0] * p0 +
m[1][1] * p1 +
m[1][2] * p2 +
m[1][3] * p3;
251 double c =
m[2][0] * p0 +
m[2][2] * p2;
257 sal_uInt32 aOffset, sal_uInt32 aNumSegments)
272 for (sal_uInt32
i = 3 + aOffset;
i < aNumSegments + 3;
i++)
274 for (sal_uInt32 s = 0; s <
nDetails; s++)
304 for (sal_uInt32 s = 0; s <
nDetails; s++)
SvStream & ReadInt16(sal_Int16 &rInt16)
SvStream & ReadFloat(float &rFloat)
SvStream & ReadUChar(unsigned char &rChar)
B2DPolygon const & getB2DPolygon(sal_uInt32 nIndex) const
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
bool isPrevControlPointUsed(sal_uInt32 nIndex) const
bool isNextControlPointUsed(sal_uInt32 nIndex) const
void setPrevControlPoint(sal_uInt32 nIndex, const basegfx::B2DPoint &rValue)
basegfx::B2DPoint const & getB2DPoint(sal_uInt32 nIndex) const
void setNextControlPoint(sal_uInt32 nIndex, const basegfx::B2DPoint &rValue)
basegfx::B2DPoint getPrevControlPoint(sal_uInt32 nIndex) const
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
void setClosed(bool bNew)
basegfx::B2DPoint getNextControlPoint(sal_uInt32 nIndex) const
std::unique_ptr< sal_uInt8[]> pPointTypes
std::deque< float > xPoints
::basegfx::B2DPolyPolygon aPolygon
virtual ~EMFPPath() override
::basegfx::B2DPolyPolygon & GetClosedCardinalSpline(EmfPlusHelperData const &rR, float fTension)
::basegfx::B2DPolyPolygon & GetPolygon(EmfPlusHelperData const &rR, bool bMapIt=true, bool bAddLineToCloseShape=false)
EMFPPath(sal_uInt32 _nPoints, bool bLines=false)
::basegfx::B2DPolyPolygon & GetCardinalSpline(EmfPlusHelperData const &rR, float fTension, sal_uInt32 aOffset, sal_uInt32 aNumSegments)
std::deque< float > yPoints
void Read(SvStream &s, sal_uInt32 pathFlags)
#define SAL_INFO(area, stream)
static void GetCardinalMatrix(float tension, matrix &m)
constexpr double alpha[nDetails]
static sal_Int16 GetEmfPlusInteger(SvStream &s)
constexpr sal_uInt32 nDetails
static double calculateSplineCoefficients(float p0, float p1, float p2, float p3, sal_uInt32 step, matrix m)
::basegfx::B2DPoint Map(double ix, double iy) const