LibreOffice Module cppcanvas (master) 1
|
Classes | |
struct | TextLineInfo |
Functions | |
css::uno::Sequence< double > | intSRGBAToDoubleSequence (IntSRGBA) |
IntSRGBA | doubleSequenceToIntSRGBA (const css::uno::Sequence< double > &rColor) |
void | initRenderState (rendering::RenderState &renderState, const ::cppcanvas::internal::OutDevState &outdevState) |
::Size | getBaselineOffset (const ::cppcanvas::internal::OutDevState &outdevState, const VirtualDevice &rVDev) |
Calc output offset relative to baseline. More... | |
::basegfx::B2DHomMatrix & | calcLogic2PixelLinearTransform (::basegfx::B2DHomMatrix &o_rMatrix, const VirtualDevice &rVDev) |
Construct a matrix that converts from logical to pixel coordinate system. More... | |
::basegfx::B2DHomMatrix & | calcLogic2PixelAffineTransform (::basegfx::B2DHomMatrix &o_rMatrix, const VirtualDevice &rVDev) |
Construct a matrix that converts from logical to pixel coordinate system. More... | |
bool | modifyClip (rendering::RenderState &o_rRenderState, const struct ::cppcanvas::internal::OutDevState &rOutdevState, const CanvasSharedPtr &rCanvas, const ::basegfx::B2DPoint &rOffset, const ::basegfx::B2DVector *pScaling, const double *pRotation) |
TextLineInfo | createTextLineInfo (const ::VirtualDevice &rVDev, const ::cppcanvas::internal::OutDevState &rState) |
Generate text underline/strikeout info struct from OutDev state. More... | |
::basegfx::B2DPolyPolygon | createTextLinesPolyPolygon (const ::basegfx::B2DPoint &rStartPos, const double &rLineWidth, const TextLineInfo &rTextLineInfo) |
::basegfx::B2DRange | calcDevicePixelBounds (const ::basegfx::B2DRange &rBounds, const rendering::ViewState &viewState, const rendering::RenderState &renderState) |
::basegfx::B2DPolyPolygon | createTextLinesPolyPolygon (const double &rStartOffset, const double &rLineWidth, const TextLineInfo &rTextLineInfo) |
Create a poly-polygon representing the given combination of overline, strikeout and underline. More... | |
void | createTextLinesPolyPolygon (const double &rStartOffset, const double &rLineWidth, const TextLineInfo &rTextLineInfo, ::basegfx::B2DPolyPolygon &rOverlinePolyPoly, ::basegfx::B2DPolyPolygon &rUnderlinePolyPoly, ::basegfx::B2DPolyPolygon &rStrikeoutPolyPoly) |
void | initRenderState (css::rendering::RenderState &renderState, const ::cppcanvas::internal::OutDevState &outdevState) |
Init render state from OutDevState. More... | |
bool | modifyClip (css::rendering::RenderState &o_rRenderState, const struct ::cppcanvas::internal::OutDevState &rOutdevState, const CanvasSharedPtr &rCanvas, const ::basegfx::B2DPoint &rOffset, const ::basegfx::B2DVector *pScaling, const double *pRotation) |
This method modifies the clip, to cancel the given transformation. More... | |
::basegfx::B2DRange | calcDevicePixelBounds (const ::basegfx::B2DRange &rBounds, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState) |
Transform given bounds to device coordinate system. More... | |
IntSRGBA | doubleSequenceToIntSRGBA (const uno::Sequence< double > &rColor) |
::basegfx::B2DRange cppcanvas::tools::calcDevicePixelBounds | ( | const ::basegfx::B2DRange & | rBounds, |
const css::rendering::ViewState & | viewState, | ||
const css::rendering::RenderState & | renderState | ||
) |
Transform given bounds to device coordinate system.
::basegfx::B2DRange cppcanvas::tools::calcDevicePixelBounds | ( | const ::basegfx::B2DRange & | rBounds, |
const rendering::ViewState & | viewState, | ||
const rendering::RenderState & | renderState | ||
) |
Definition at line 628 of file mtftools.cxx.
basegfx::B2DHomMatrix & cppcanvas::tools::calcLogic2PixelAffineTransform | ( | ::basegfx::B2DHomMatrix & | o_rMatrix, |
const VirtualDevice & | rVDev | ||
) |
Construct a matrix that converts from logical to pixel coordinate system.
This method calculates a matrix that approximates the VirtualDevice's LogicToPixel conversion.
o_rMatrix | This matrix will receive the calculated transform, and is also returned from this method. |
Definition at line 95 of file mtftools.cxx.
References calcLogic2PixelLinearTransform(), OutputDevice::LogicToPixel(), and basegfx::B2DHomMatrix::translate().
Referenced by cppcanvas::internal::ImplRenderer::createActions(), and cppcanvas::internal::ImplRenderer::ImplRenderer().
basegfx::B2DHomMatrix & cppcanvas::tools::calcLogic2PixelLinearTransform | ( | ::basegfx::B2DHomMatrix & | o_rMatrix, |
const VirtualDevice & | rVDev | ||
) |
Construct a matrix that converts from logical to pixel coordinate system.
This method calculates a matrix that approximates the VirtualDevice's LogicToPixel conversion (disregarding any offset components, thus the 'linear' in the method name - the returned matrix is guaranteed to be linear).
o_rMatrix | This matrix will receive the calculated transform, and is also returned from this method. |
Definition at line 77 of file mtftools.cxx.
References basegfx::utils::createScaleB2DHomMatrix(), and OutputDevice::LogicToPixel().
Referenced by calcLogic2PixelAffineTransform(), and cppcanvas::internal::ImplRenderer::createActions().
TextLineInfo cppcanvas::tools::createTextLineInfo | ( | const ::VirtualDevice & | rVDev, |
const ::cppcanvas::internal::OutDevState & | rState | ||
) |
Generate text underline/strikeout info struct from OutDev state.
Definition at line 218 of file mtftools.cxx.
References OutputDevice::GetFontMetric().
Referenced by cppcanvas::internal::ImplRenderer::createActions().
basegfx::B2DPolyPolygon cppcanvas::tools::createTextLinesPolyPolygon | ( | const ::basegfx::B2DPoint & | rStartPos, |
const double & | rLineWidth, | ||
const TextLineInfo & | rTextLineInfo | ||
) |
Definition at line 615 of file mtftools.cxx.
Referenced by cppcanvas::internal::ImplRenderer::createActions(), createTextLinesPolyPolygon(), and cppcanvas::internal::TextLinesHelper::init().
basegfx::B2DPolyPolygon cppcanvas::tools::createTextLinesPolyPolygon | ( | const double & | rStartOffset, |
const double & | rLineWidth, | ||
const TextLineInfo & | rTextLineInfo | ||
) |
Create a poly-polygon representing the given combination of overline, strikeout and underline.
rStartOffset | Offset in X direction, where the underline starts |
rLineWidth | Width of the line of text to overline/strikeout/underline |
rTextLineInfo | Common info needed for overline/strikeout/underline generation |
Definition at line 645 of file mtftools.cxx.
References createTextLinesPolyPolygon().
void cppcanvas::tools::createTextLinesPolyPolygon | ( | const double & | rStartOffset, |
const double & | rLineWidth, | ||
const TextLineInfo & | rTextLineInfo, | ||
::basegfx::B2DPolyPolygon & | rOverlinePolyPoly, | ||
::basegfx::B2DPolyPolygon & | rUnderlinePolyPoly, | ||
::basegfx::B2DPolyPolygon & | rStrikeoutPolyPoly | ||
) |
Definition at line 656 of file mtftools.cxx.
IntSRGBA cppcanvas::tools::doubleSequenceToIntSRGBA | ( | const css::uno::Sequence< double > & | rColor | ) |
Referenced by cppcanvas::internal::ImplPolyPolygon::getRGBALineColor().
IntSRGBA cppcanvas::tools::doubleSequenceToIntSRGBA | ( | const uno::Sequence< double > & | rColor | ) |
Definition at line 39 of file tools.cxx.
References cppcanvas::makeColor().
Size cppcanvas::tools::getBaselineOffset | ( | const ::cppcanvas::internal::OutDevState & | outdevState, |
const VirtualDevice & | rVDev | ||
) |
Calc output offset relative to baseline.
The XCanvas API always renders text relative to its baseline. This method calculates an offset in logical coordinates, depending on the OutDevState's textReferencePoint and the font currently set, to offset the text from the baseline.
outdevState | State to take textReferencePoint from |
rVDev | VDev to obtain font metrics from. |
Definition at line 51 of file mtftools.cxx.
References ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_TOP, and OutputDevice::GetFontMetric().
Referenced by cppcanvas::internal::ImplRenderer::createActions(), and cppcanvas::internal::TextActionFactory::createTextAction().
void cppcanvas::tools::initRenderState | ( | css::rendering::RenderState & | renderState, |
const ::cppcanvas::internal::OutDevState & | outdevState | ||
) |
Init render state from OutDevState.
This method initializes the given render state object, sets up the transformation and the clip from the OutDevState.
void cppcanvas::tools::initRenderState | ( | rendering::RenderState & | renderState, |
const ::cppcanvas::internal::OutDevState & | outdevState | ||
) |
Definition at line 42 of file mtftools.cxx.
References initRenderState().
Referenced by cppcanvas::internal::CanvasGraphicHelper::CanvasGraphicHelper(), initRenderState(), cppcanvas::internal::ImplSprite::move(), and cppcanvas::internal::ImplSprite::movePixel().
uno::Sequence< double > cppcanvas::tools::intSRGBAToDoubleSequence | ( | IntSRGBA | aColor | ) |
Definition at line 28 of file tools.cxx.
References cppcanvas::getAlpha(), cppcanvas::getBlue(), cppcanvas::getGreen(), and cppcanvas::getRed().
Referenced by cppcanvas::internal::ImplRenderer::ImplRenderer(), cppcanvas::internal::ImplPolyPolygon::setRGBAFillColor(), and cppcanvas::internal::ImplPolyPolygon::setRGBALineColor().
bool cppcanvas::tools::modifyClip | ( | css::rendering::RenderState & | o_rRenderState, |
const struct ::cppcanvas::internal::OutDevState & | rOutdevState, | ||
const CanvasSharedPtr & | rCanvas, | ||
const ::basegfx::B2DPoint & | rOffset, | ||
const ::basegfx::B2DVector * | pScaling, | ||
const double * | pRotation | ||
) |
This method modifies the clip, to cancel the given transformation.
As the clip is relative to the render state transformation, offsetting or scaling the render state must modify the clip, to keep it at the same position relative to the primitive at hand
o_rRenderState | Render state to change the clip in |
rOutdevState | Input state. Is used to retrieve the original clip from |
rOffset | The clip is offsetted by the negative of this value. |
pScaling | The clip is inversely scaled by this value (if given) |
pRotation | The clip is inversely rotated by this value (if given) |
bool cppcanvas::tools::modifyClip | ( | rendering::RenderState & | o_rRenderState, |
const struct ::cppcanvas::internal::OutDevState & | rOutdevState, | ||
const CanvasSharedPtr & | rCanvas, | ||
const ::basegfx::B2DPoint & | rOffset, | ||
const ::basegfx::B2DVector * | pScaling, | ||
const double * | pRotation | ||
) |
Definition at line 112 of file mtftools.cxx.
References vcl::unotools::b2DRectangleFromRectangle(), cppcanvas::internal::OutDevState::clip, cppcanvas::internal::OutDevState::clipRect, basegfx::B2DPolyPolygon::count(), tools::Rectangle::IsEmpty(), basegfx::B2DHomMatrix::rotate(), basegfx::B2DHomMatrix::scale(), basegfx::B2DPolygon::transform(), basegfx::B2DPolyPolygon::transform(), and basegfx::B2DHomMatrix::translate().