LibreOffice Module drawinglayer (master) 1
zbufferprocessor3d.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
24#include <texture/texture.hxx>
30#include <o3tl/safeint.hxx>
32#include <utility>
33
34using namespace com::sun::star;
35
36class ZBufferRasterConverter3D : public basegfx::RasterConverter3D
37{
38private:
41
42 // interpolators for a single line span
48
49 // current material to use for rasterconversion
51
52 // some boolean flags for line span interpolator usages
53 bool mbModifyColor : 1;
54 bool mbUseTex : 1;
55 bool mbHasTexCoor : 1;
57 bool mbUseNrm : 1;
58 bool mbUseCol : 1;
59
60 void getTextureCoor(basegfx::B2DPoint& rTarget) const
61 {
62 if(mbHasTexCoor)
63 {
66 }
67 else if(mbHasInvTexCoor)
68 {
69 const double fZFactor(maIntInvTexture.getZ().getVal());
70 const double fInvZFactor(basegfx::fTools::equalZero(fZFactor) ? 1.0 : 1.0 / fZFactor);
71 rTarget.setX(maIntInvTexture.getX().getVal() * fInvZFactor);
72 rTarget.setY(maIntInvTexture.getY().getVal() * fInvZFactor);
73 }
74 }
75
77 {
78 maIntZ.increment(fStep);
79
80 if(mbUseTex)
81 {
82 if(mbHasTexCoor)
83 {
85 }
86 else if(mbHasInvTexCoor)
87 {
89 }
90 }
91
92 if(mbUseNrm)
93 {
95 }
96
97 if(mbUseCol)
98 {
99 maIntColor.increment(fStep);
100 }
101 }
102
104 {
105 // init values with full opacity and material color
106 OSL_ENSURE(nullptr != mpCurrentMaterial, "CurrentMaterial not set (!)");
107 double fOpacity(1.0);
108 rColor = mpCurrentMaterial->getColor();
109
110 if(mbUseTex)
111 {
112 basegfx::B2DPoint aTexCoor(0.0, 0.0);
113 getTextureCoor(aTexCoor);
114
116 {
117 // calc color in spot. This may also set to invisible already when
118 // e.g. bitmap textures have transparent parts
119 mrProcessor.getGeoTexSvx()->modifyBColor(aTexCoor, rColor, fOpacity);
120 }
121
123 {
124 // calc opacity. Object has a 2nd texture, a transparence texture
125 mrProcessor.getTransparenceGeoTexSvx()->modifyOpacity(aTexCoor, fOpacity);
126 }
127 }
128
129 if(basegfx::fTools::more(fOpacity, 0.0))
130 {
132 {
133 if(mbUseNrm)
134 {
135 // blend texture with phong
138 rColor,
142 }
143 else if(mbUseCol)
144 {
145 // blend texture with gouraud
147 rColor *= aBlendColor;
148 }
149 else if(mrProcessor.getModulate())
150 {
151 // blend texture with single material color
152 rColor *= mpCurrentMaterial->getColor();
153 }
154 }
155 else
156 {
157 if(mbUseNrm)
158 {
159 // modify color with phong
162 rColor,
166 }
167 else if(mbUseCol)
168 {
169 // modify color with gouraud
170 rColor.setRed(maIntColor.getX().getVal());
171 rColor.setGreen(maIntColor.getY().getVal());
172 rColor.setBlue(maIntColor.getZ().getVal());
173 }
174 }
175
176 if(mbModifyColor)
177 {
179 }
180 }
181
182 return fOpacity;
183 }
184
186 {
187 // get inverse XDelta
188 const double xInvDelta(1.0 / (rB.getX().getVal() - rA.getX().getVal()));
189
190 // prepare Z-interpolator
191 const double fZA(rA.getZ().getVal());
192 const double fZB(rB.getZ().getVal());
193 maIntZ = basegfx::ip_single(fZA, (fZB - fZA) * xInvDelta);
194
195 // get bools and init other interpolators on demand accordingly
199 const bool bTextureActive(mrProcessor.getGeoTexSvx() || mrProcessor.getTransparenceGeoTexSvx());
201 const bool bUseColorTex(mbUseTex && mrProcessor.getGeoTexSvx());
202 const bool bNeedNrmOrCol(!bUseColorTex || mrProcessor.getModulate());
205
206 if(mbUseTex)
207 {
208 if(mbHasTexCoor)
209 {
210 const basegfx::ip_double& rTA(getTextureInterpolators()[rA.getTextureIndex()]);
211 const basegfx::ip_double& rTB(getTextureInterpolators()[rB.getTextureIndex()]);
213 rTA.getX().getVal(), (rTB.getX().getVal() - rTA.getX().getVal()) * xInvDelta,
214 rTA.getY().getVal(), (rTB.getY().getVal() - rTA.getY().getVal()) * xInvDelta);
215 }
216 else if(mbHasInvTexCoor)
217 {
218 const basegfx::ip_triple& rITA(getInverseTextureInterpolators()[rA.getInverseTextureIndex()]);
219 const basegfx::ip_triple& rITB(getInverseTextureInterpolators()[rB.getInverseTextureIndex()]);
221 rITA.getX().getVal(), (rITB.getX().getVal() - rITA.getX().getVal()) * xInvDelta,
222 rITA.getY().getVal(), (rITB.getY().getVal() - rITA.getY().getVal()) * xInvDelta,
223 rITA.getZ().getVal(), (rITB.getZ().getVal() - rITA.getZ().getVal()) * xInvDelta);
224 }
225 }
226
227 if(mbUseNrm)
228 {
229 const basegfx::ip_triple& rNA(getNormalInterpolators()[rA.getNormalIndex()]);
230 const basegfx::ip_triple& rNB(getNormalInterpolators()[rB.getNormalIndex()]);
232 rNA.getX().getVal(), (rNB.getX().getVal() - rNA.getX().getVal()) * xInvDelta,
233 rNA.getY().getVal(), (rNB.getY().getVal() - rNA.getY().getVal()) * xInvDelta,
234 rNA.getZ().getVal(), (rNB.getZ().getVal() - rNA.getZ().getVal()) * xInvDelta);
235 }
236
237 if(mbUseCol)
238 {
239 const basegfx::ip_triple& rCA(getColorInterpolators()[rA.getColorIndex()]);
240 const basegfx::ip_triple& rCB(getColorInterpolators()[rB.getColorIndex()]);
242 rCA.getX().getVal(), (rCB.getX().getVal() - rCA.getX().getVal()) * xInvDelta,
243 rCA.getY().getVal(), (rCB.getY().getVal() - rCA.getY().getVal()) * xInvDelta,
244 rCA.getZ().getVal(), (rCB.getZ().getVal() - rCA.getZ().getVal()) * xInvDelta);
245 }
246 }
247
248 virtual void processLineSpan(const basegfx::RasterConversionLineEntry3D& rA, const basegfx::RasterConversionLineEntry3D& rB, sal_Int32 nLine, sal_uInt32 nSpanCount) override;
249
250public:
253 mrBuffer(rBuffer),
254 mpCurrentMaterial(nullptr),
255 mbModifyColor(false),
256 mbUseTex(false),
257 mbHasTexCoor(false),
258 mbHasInvTexCoor(false),
259 mbUseNrm(false),
260 mbUseCol(false)
261 {}
262
264 {
265 mpCurrentMaterial = &rMaterial;
266 }
267};
268
270{
271 if(nSpanCount & 0x0001)
272 return;
273
274 if(nLine < 0 || o3tl::make_unsigned(nLine) >= mrBuffer.getHeight())
275 return;
276
277 sal_uInt32 nXA(std::min(mrBuffer.getWidth(), static_cast<sal_uInt32>(std::max(sal_Int32(0), basegfx::fround(rA.getX().getVal())))));
278 const sal_uInt32 nXB(std::min(mrBuffer.getWidth(), static_cast<sal_uInt32>(std::max(sal_Int32(0), basegfx::fround(rB.getX().getVal())))));
279
280 if(nXA >= nXB)
281 return;
282
283 // prepare the span interpolators
285
286 // bring span interpolators to start condition by incrementing with the possible difference of
287 // clamped and non-clamped XStart. Interpolators are setup relying on double precision
288 // X-values, so that difference is the correct value to compensate for possible clampings
289 incrementLineSpanInterpolators(static_cast<double>(nXA) - rA.getX().getVal());
290
291 // prepare scanline index
292 sal_uInt32 nScanlineIndex(mrBuffer.getIndexFromXY(nXA, static_cast<sal_uInt32>(nLine)));
293 basegfx::BColor aNewColor;
294
295 while(nXA < nXB)
296 {
297 // early-test Z values if we need to do anything at all
298 const double fNewZ(std::clamp(maIntZ.getVal(), 0.0, 65535.0));
299 const sal_uInt16 nNewZ(static_cast< sal_uInt16 >(fNewZ));
300 sal_uInt16& rOldZ(mrBuffer.getZ(nScanlineIndex));
301
302 if(nNewZ > rOldZ)
303 {
304 // detect color and opacity for this pixel
305 const sal_uInt16 nOpacity(std::max(sal_Int16(0), static_cast< sal_Int16 >(decideColorAndOpacity(aNewColor) * 255.0)));
306
307 if(nOpacity > 0)
308 {
309 // avoid color overrun
310 aNewColor.clamp();
311
312 if(nOpacity >= 0x00ff)
313 {
314 // full opacity (not transparent), set z and color
315 rOldZ = nNewZ;
316 mrBuffer.getBPixel(nScanlineIndex) = basegfx::BPixel(aNewColor, 0xff);
317 }
318 else
319 {
320 basegfx::BPixel& rDest = mrBuffer.getBPixel(nScanlineIndex);
321
322 if(rDest.getAlpha())
323 {
324 // mix new color by using
325 // color' = color * (1 - opacity) + newcolor * opacity
326 const sal_uInt16 nTransparence(255 - nOpacity);
327 rDest.setRed(static_cast<sal_uInt8>(((rDest.getRed() * nTransparence) + (static_cast<sal_uInt16>(255.0 * aNewColor.getRed()) * nOpacity)) >> 8));
328 rDest.setGreen(static_cast<sal_uInt8>(((rDest.getGreen() * nTransparence) + (static_cast<sal_uInt16>(255.0 * aNewColor.getGreen()) * nOpacity)) >> 8));
329 rDest.setBlue(static_cast<sal_uInt8>(((rDest.getBlue() * nTransparence) + (static_cast<sal_uInt16>(255.0 * aNewColor.getBlue()) * nOpacity)) >> 8));
330
331 if(255 != rDest.getAlpha())
332 {
333 // both are transparent, mix new opacity by using
334 // opacity = newopacity * (1 - oldopacity) + oldopacity
335 rDest.setAlpha(static_cast<sal_uInt8>((nOpacity * (255 - rDest.getAlpha())) >> 8) + rDest.getAlpha());
336 }
337 }
338 else
339 {
340 // dest is unused, set color
341 rDest = basegfx::BPixel(aNewColor, static_cast<sal_uInt8>(nOpacity));
342 }
343 }
344 }
345 }
346
347 // increments
348 nScanlineIndex++;
349 nXA++;
351 }
352}
353
354// helper class to buffer output for transparent rasterprimitives (filled areas
355// and lines) until the end of processing. To ensure correct transparent
356// visualisation, ZBuffers require to not set Z and to mix with the transparent
357// color. If transparent rasterprimitives overlap, it gets necessary to
358// paint transparent rasterprimitives from back to front to ensure that the
359// mixing happens from back to front. For that purpose, transparent
360// rasterprimitives are held in this class during the processing run, remember
361// all data and will be rendered
362
364{
365private:
366 std::shared_ptr< drawinglayer::texture::GeoTexSvx > mpGeoTexSvx;
367 std::shared_ptr< drawinglayer::texture::GeoTexSvx > mpTransparenceGeoTexSvx;
370 double mfCenterZ;
371
372 bool mbModulate : 1;
373 bool mbFilter : 1;
375 bool mbIsLine : 1;
376
377public:
379 std::shared_ptr< drawinglayer::texture::GeoTexSvx > pGeoTexSvx,
380 std::shared_ptr< drawinglayer::texture::GeoTexSvx > pTransparenceGeoTexSvx,
382 const basegfx::B3DPolyPolygon& rPolyPolygon,
383 bool bModulate,
384 bool bFilter,
385 bool bSimpleTextureActive,
386 bool bIsLine)
387 : mpGeoTexSvx(std::move(pGeoTexSvx)),
388 mpTransparenceGeoTexSvx(std::move(pTransparenceGeoTexSvx)),
389 maMaterial(rMaterial),
390 maPolyPolygon(rPolyPolygon),
391 mfCenterZ(basegfx::utils::getRange(rPolyPolygon).getCenter().getZ()),
392 mbModulate(bModulate),
393 mbFilter(bFilter),
394 mbSimpleTextureActive(bSimpleTextureActive),
395 mbIsLine(bIsLine)
396 {
397 }
398
399 bool operator<(const RasterPrimitive3D& rComp) const
400 {
401 return mfCenterZ < rComp.mfCenterZ;
402 }
403
404 const std::shared_ptr< drawinglayer::texture::GeoTexSvx >& getGeoTexSvx() const { return mpGeoTexSvx; }
405 const std::shared_ptr< drawinglayer::texture::GeoTexSvx >& getTransparenceGeoTexSvx() const { return mpTransparenceGeoTexSvx; }
408 bool getModulate() const { return mbModulate; }
409 bool getFilter() const { return mbFilter; }
411 bool getIsLine() const { return mbIsLine; }
412};
413
415{
417 {
419 {
420 // transparent output; record for later sorting and painting from
421 // back to front
422
424 getGeoTexSvx(),
426 rMaterial,
427 basegfx::B3DPolyPolygon(rHairline),
428 getModulate(),
429 getFilter(),
431 true));
432 }
433 else
434 {
435 // do rasterconversion
436 mpZBufferRasterConverter3D->setCurrentMaterial(rMaterial);
437
438 if(mnAntiAlialize > 1)
439 {
441
442 if(bForceLineSnap)
443 {
444 basegfx::B3DHomMatrix aTransform;
445 basegfx::B3DPolygon aSnappedHairline(rHairline);
446 const double fScaleDown(1.0 / mnAntiAlialize);
447 const double fScaleUp(mnAntiAlialize);
448
449 // take oversampling out
450 aTransform.scale(fScaleDown, fScaleDown, 1.0);
451 aSnappedHairline.transform(aTransform);
452
453 // snap to integer
454 aSnappedHairline = basegfx::utils::snapPointsOfHorizontalOrVerticalEdges(aSnappedHairline);
455
456 // add oversampling again
457 aTransform.identity();
458 aTransform.scale(fScaleUp, fScaleUp, 1.0);
459
460 aSnappedHairline.transform(aTransform);
461
462 mpZBufferRasterConverter3D->rasterconvertB3DPolygon(aSnappedHairline, mnStartLine, mnStopLine, mnAntiAlialize);
463 }
464 else
465 {
466 mpZBufferRasterConverter3D->rasterconvertB3DPolygon(rHairline, mnStartLine, mnStopLine, mnAntiAlialize);
467 }
468 }
469 else
470 {
471 mpZBufferRasterConverter3D->rasterconvertB3DPolygon(rHairline, mnStartLine, mnStopLine, 1);
472 }
473 }
474 }
475
477 {
479 {
480 // transparent output; record for later sorting and painting from
481 // back to front
483 getGeoTexSvx(),
485 rMaterial,
486 rFill,
487 getModulate(),
488 getFilter(),
490 false));
491 }
492 else
493 {
494 mpZBufferRasterConverter3D->setCurrentMaterial(rMaterial);
495 mpZBufferRasterConverter3D->rasterconvertB3DPolyPolygon(rFill, &maInvEyeToView, mnStartLine, mnStopLine);
496 }
497 }
498
500 const geometry::ViewInformation3D& rViewInformation3D,
501 const attribute::SdrSceneAttribute& rSdrSceneAttribute,
502 const attribute::SdrLightingAttribute& rSdrLightingAttribute,
503 const basegfx::B2DRange& rVisiblePart,
504 sal_uInt16 nAntiAlialize,
505 double fFullViewSizeX,
506 double fFullViewSizeY,
507 basegfx::BZPixelRaster& rBZPixelRaster,
508 sal_uInt32 nStartLine,
509 sal_uInt32 nStopLine)
510 : DefaultProcessor3D(rViewInformation3D, rSdrSceneAttribute, rSdrLightingAttribute),
511 mnAntiAlialize(nAntiAlialize),
512 mnStartLine(nStartLine),
513 mnStopLine(nStopLine)
514 {
515 // create DeviceToView for Z-Buffer renderer since Z is handled
516 // different from standard 3D transformations (Z is mirrored). Also
517 // the transformation includes the step from unit device coordinates
518 // to discrete units ([-1.0 .. 1.0] -> [minDiscrete .. maxDiscrete]
519 basegfx::B3DHomMatrix aDeviceToView;
520
521 {
522 // step one:
523 //
524 // bring from [-1.0 .. 1.0] in X,Y and Z to [0.0 .. 1.0]. Also
525 // necessary to
526 // - flip Y due to screen orientation
527 // - flip Z due to Z-Buffer orientation from back to front
528
529 aDeviceToView.scale(0.5, -0.5, -0.5);
530 aDeviceToView.translate(0.5, 0.5, 0.5);
531 }
532
533 {
534 // step two:
535 //
536 // bring from [0.0 .. 1.0] in X,Y and Z to view coordinates
537 //
538 // #i102611#
539 // also: scale Z to [1.5 .. 65534.5]. Normally, a range of [0.0 .. 65535.0]
540 // could be used, but a 'unused' value is needed, so '0' is used what reduces
541 // the range to [1.0 .. 65535.0]. It has also shown that small numerical errors
542 // (smaller as basegfx::fTools::mfSmallValue, which is 0.000000001) happen.
543 // Instead of checking those by basegfx::fTools methods which would cost
544 // runtime, just add another 0.5 tolerance to the start and end of the Z-Buffer
545 // range, thus resulting in [1.5 .. 65534.5]
546 const double fMaxZDepth(65533.0);
547 aDeviceToView.translate(-rVisiblePart.getMinX(), -rVisiblePart.getMinY(), 0.0);
548
550 aDeviceToView.scale(fFullViewSizeX * mnAntiAlialize, fFullViewSizeY * mnAntiAlialize, fMaxZDepth);
551 else
552 aDeviceToView.scale(fFullViewSizeX, fFullViewSizeY, fMaxZDepth);
553
554 aDeviceToView.translate(0.0, 0.0, 1.5);
555 }
556
557 // update local ViewInformation3D with own DeviceToView
558 const geometry::ViewInformation3D aNewViewInformation3D(
559 getViewInformation3D().getObjectTransformation(),
561 getViewInformation3D().getProjection(),
562 aDeviceToView,
563 getViewInformation3D().getViewTime(),
564 getViewInformation3D().getExtendedInformationSequence());
565 updateViewInformation(aNewViewInformation3D);
566
567 // prepare inverse EyeToView transformation. This can be done in constructor
568 // since changes in object transformations when processing TransformPrimitive3Ds
569 // do not influence this prepared partial transformation
572
573 // prepare maRasterRange
575 maRasterRange.expand(basegfx::B2DPoint(0.0, nStartLine));
576 maRasterRange.expand(basegfx::B2DPoint(rBZPixelRaster.getWidth(), nStopLine));
577
578 // create the raster converter
579 mpZBufferRasterConverter3D.reset( new ZBufferRasterConverter3D(rBZPixelRaster, *this) );
580 }
581
583 {
585
586 if(!maRasterPrimitive3Ds.empty())
587 {
588 OSL_FAIL("ZBufferProcessor3D: destructed, but there are unrendered transparent geometries. Use ZBufferProcessor3D::finish() to render these (!)");
589 }
590 }
591
593 {
594 if(maRasterPrimitive3Ds.empty())
595 return;
596
597 // there are transparent rasterprimitives
598 const sal_uInt32 nSize(maRasterPrimitive3Ds.size());
599
600 if(nSize > 1)
601 {
602 // sort them from back to front
603 std::sort(maRasterPrimitive3Ds.begin(), maRasterPrimitive3Ds.end());
604 }
605
606 for(sal_uInt32 a(0); a < nSize; a++)
607 {
608 // paint each one by setting the remembered data and calling
609 // the render method
610 const RasterPrimitive3D& rCandidate = maRasterPrimitive3Ds[a];
611
612 mpGeoTexSvx = rCandidate.getGeoTexSvx();
614 mbModulate = rCandidate.getModulate();
615 mbFilter = rCandidate.getFilter();
617
618 if(rCandidate.getIsLine())
619 {
621 rCandidate.getMaterial(),
622 rCandidate.getPolyPolygon().getB3DPolygon(0));
623 }
624 else
625 {
627 rCandidate.getMaterial(),
628 rCandidate.getPolyPolygon());
629 }
630 }
631
632 // delete them to signal the destructor that all is done and
633 // to allow asserting there
634 maRasterPrimitive3Ds.clear();
635 }
636
637} // end of namespace
638
639/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const ::rtl::Reference< IEventProcessor > & rProcessor
const std::shared_ptr< drawinglayer::texture::GeoTexSvx > & getTransparenceGeoTexSvx() const
drawinglayer::attribute::MaterialAttribute3D maMaterial
RasterPrimitive3D(std::shared_ptr< drawinglayer::texture::GeoTexSvx > pGeoTexSvx, std::shared_ptr< drawinglayer::texture::GeoTexSvx > pTransparenceGeoTexSvx, const drawinglayer::attribute::MaterialAttribute3D &rMaterial, const basegfx::B3DPolyPolygon &rPolyPolygon, bool bModulate, bool bFilter, bool bSimpleTextureActive, bool bIsLine)
bool getSimpleTextureActive() const
const basegfx::B3DPolyPolygon & getPolyPolygon() const
std::shared_ptr< drawinglayer::texture::GeoTexSvx > mpGeoTexSvx
basegfx::B3DPolyPolygon maPolyPolygon
bool operator<(const RasterPrimitive3D &rComp) const
const std::shared_ptr< drawinglayer::texture::GeoTexSvx > & getGeoTexSvx() const
std::shared_ptr< drawinglayer::texture::GeoTexSvx > mpTransparenceGeoTexSvx
const drawinglayer::attribute::MaterialAttribute3D & getMaterial() const
void setupLineSpanInterpolators(const basegfx::RasterConversionLineEntry3D &rA, const basegfx::RasterConversionLineEntry3D &rB)
basegfx::ip_triple maIntInvTexture
void getTextureCoor(basegfx::B2DPoint &rTarget) const
basegfx::BZPixelRaster & mrBuffer
const drawinglayer::processor3d::DefaultProcessor3D & mrProcessor
basegfx::ip_triple maIntNormal
basegfx::ip_double maIntTexture
void incrementLineSpanInterpolators(double fStep)
double decideColorAndOpacity(basegfx::BColor &rColor) const
basegfx::ip_triple maIntColor
ZBufferRasterConverter3D(basegfx::BZPixelRaster &rBuffer, const drawinglayer::processor3d::ZBufferProcessor3D &rProcessor)
const drawinglayer::attribute::MaterialAttribute3D * mpCurrentMaterial
void setCurrentMaterial(const drawinglayer::attribute::MaterialAttribute3D &rMaterial)
virtual void processLineSpan(const basegfx::RasterConversionLineEntry3D &rA, const basegfx::RasterConversionLineEntry3D &rB, sal_Int32 nLine, sal_uInt32 nSpanCount) override
void translate(double fX, double fY, double fZ)
void scale(double fX, double fY, double fZ)
B3DPolygon const & getB3DPolygon(sal_uInt32 nIndex) const
void transform(const B3DHomMatrix &rMatrix)
::basegfx::BColor getModifiedColor(const ::basegfx::BColor &rSource) const
sal_uInt32 count() const
double getBlue() const
void setBlue(double fNew)
double getRed() const
BColor & clamp()
void setGreen(double fNew)
double getGreen() const
void setRed(double fNew)
sal_uInt8 getAlpha() const
void setAlpha(sal_uInt8 nNew)
sal_uInt8 getBlue() const
sal_uInt8 getGreen() const
void setRed(sal_uInt8 nNew)
sal_uInt8 getRed() const
void setBlue(sal_uInt8 nNew)
void setGreen(sal_uInt8 nNew)
sal_uInt32 getIndexFromXY(sal_uInt32 nX, sal_uInt32 nY) const
sal_uInt32 getWidth() const
sal_uInt32 getHeight() const
const sal_uInt16 & getZ(sal_uInt32 nIndex) const
const BPixel & getBPixel(sal_uInt32 nIndex) const
TYPE getMinX() const
TYPE getMinY() const
void expand(const Tuple2D< TYPE > &rTuple)
sal_uInt32 getInverseTextureIndex() const
const ip_single & getZ() const
const ip_single & getX() const
const ip_single & getY() const
void increment(double fStep)
const ip_single & getX() const
double getVal() const
void increment(double fStep)
void increment(double fStep)
const ip_single & getZ() const
const ip_single & getY() const
const ip_single & getX() const
basegfx::BColor solveColorModel(const basegfx::B3DVector &rNormalInEyeCoordinates, const basegfx::BColor &rColor, const basegfx::BColor &rSpecular, const basegfx::BColor &rEmission, sal_uInt16 nSpecularIntensity) const
const basegfx::B3DHomMatrix & getDeviceToView() const
const basegfx::B3DHomMatrix & getProjection() const
const geometry::ViewInformation3D & getViewInformation3D() const
void updateViewInformation(const geometry::ViewInformation3D &rViewInformation3D)
std::shared_ptr< texture::GeoTexSvx > mpTransparenceGeoTexSvx
the current active transparence texture
const basegfx::BColorModifierStack & getBColorModifierStack() const
data read access renderer stuff
const attribute::SdrLightingAttribute & getSdrLightingAttribute() const
std::shared_ptr< texture::GeoTexSvx > mpGeoTexSvx
the current active texture
const std::shared_ptr< texture::GeoTexSvx > & getGeoTexSvx() const
basegfx::B2DRange maRasterRange
renderer range.
const std::shared_ptr< texture::GeoTexSvx > & getTransparenceGeoTexSvx() const
This 3D renderer derived from DefaultProcessor3D renders all fed primitives to a 2D raster bitmap usi...
std::unique_ptr< ZBufferRasterConverter3D > mpZBufferRasterConverter3D
The raster converter for Z-Buffer.
ZBufferProcessor3D(const geometry::ViewInformation3D &rViewInformation3D, const attribute::SdrSceneAttribute &rSdrSceneAttribute, const attribute::SdrLightingAttribute &rSdrLightingAttribute, const basegfx::B2DRange &rVisiblePart, sal_uInt16 nAntiAlialize, double fFullViewSizeX, double fFullViewSizeY, basegfx::BZPixelRaster &rBZPixelRaster, sal_uInt32 nStartLine, sal_uInt32 nStopLine)
virtual void rasterconvertB3DPolyPolygon(const attribute::MaterialAttribute3D &rMaterial, const basegfx::B3DPolyPolygon &rFill) const override
virtual void rasterconvertB3DPolygon(const attribute::MaterialAttribute3D &rMaterial, const basegfx::B3DPolygon &rHairline) const override
basegfx::B3DHomMatrix maInvEyeToView
inverse of EyeToView for rasterconversion with evtl. Phong shading
std::vector< RasterPrimitive3D > maRasterPrimitive3Ds
FilterGroup & rTarget
uno_Any a
bool IsSnapHorVerLinesToDiscrete()
bool more(const T &rfValA, const T &rfValB)
bool equalZero(const T &rfVal)
B2VectorOrientation getOrientation(const B2DPolygon &rCandidate)
B2DPolygon snapPointsOfHorizontalOrVerticalEdges(const B2DPolygon &rCandidate)
B2DRange getRange(const B2DPolygon &rCandidate)
B2IRange fround(const B2DRange &rRange)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
#define SCANLINE_EMPTY_INDEX
unsigned char sal_uInt8