bmpacc3.cxx (9f62ea84) | bmpacc3.cxx (e6f63103) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 303 unchanged lines hidden (view full) --- 312void BitmapWriteAccess::FillPolygon( const Polygon& rPoly ) 313{ 314 const sal_uInt16 nSize = rPoly.GetSize(); 315 316 if( nSize && mpFillColor ) 317 { 318 const BitmapColor& rFillColor = *mpFillColor; 319 Region aRegion( rPoly ); | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 303 unchanged lines hidden (view full) --- 312void BitmapWriteAccess::FillPolygon( const Polygon& rPoly ) 313{ 314 const sal_uInt16 nSize = rPoly.GetSize(); 315 316 if( nSize && mpFillColor ) 317 { 318 const BitmapColor& rFillColor = *mpFillColor; 319 Region aRegion( rPoly ); |
320 Rectangle aRect; | 320// Rectangle aRect; |
321 322 aRegion.Intersect( Rectangle( Point(), Size( Width(), Height() ) ) ); 323 324 if( !aRegion.IsEmpty() ) 325 { | 321 322 aRegion.Intersect( Rectangle( Point(), Size( Width(), Height() ) ) ); 323 324 if( !aRegion.IsEmpty() ) 325 { |
326 RegionHandle aRegHandle( aRegion.BeginEnumRects() ); | 326 RectangleVector aRectangles; 327 aRegion.GetRegionRectangles(aRectangles); |
327 | 328 |
328 while( aRegion.GetNextEnumRect( aRegHandle, aRect ) ) 329 for( long nY = aRect.Top(), nEndY = aRect.Bottom(); nY <= nEndY; nY++ ) 330 for( long nX = aRect.Left(), nEndX = aRect.Right(); nX <= nEndX; nX++ ) 331 SetPixel( nY, nX, rFillColor ); | 329 for(RectangleVector::const_iterator aRectIter(aRectangles.begin()); aRectIter != aRectangles.end(); aRectIter++) 330 { 331 for(long nY = aRectIter->Top(), nEndY = aRectIter->Bottom(); nY <= nEndY; nY++) 332 { 333 for(long nX = aRectIter->Left(), nEndX = aRectIter->Right(); nX <= nEndX; nX++) 334 { 335 SetPixel(nY, nX, rFillColor); 336 } 337 } 338 } |
332 | 339 |
333 aRegion.EndEnumRects( aRegHandle ); | 340 //RegionHandle aRegHandle( aRegion.BeginEnumRects() ); 341 // 342 //while( aRegion.GetEnumRects( aRegHandle, aRect ) ) 343 // for( long nY = aRect.Top(), nEndY = aRect.Bottom(); nY <= nEndY; nY++ ) 344 // for( long nX = aRect.Left(), nEndX = aRect.Right(); nX <= nEndX; nX++ ) 345 // SetPixel( nY, nX, rFillColor ); 346 // 347 //aRegion.EndEnumRects( aRegHandle ); |
334 } 335 } 336} 337 338// ------------------------------------------------------------------ 339 340void BitmapWriteAccess::DrawPolygon( const Polygon& rPoly ) 341{ --- 17 unchanged lines hidden (view full) --- 359void BitmapWriteAccess::FillPolyPolygon( const PolyPolygon& rPolyPoly ) 360{ 361 const sal_uInt16 nCount = rPolyPoly.Count(); 362 363 if( nCount && mpFillColor ) 364 { 365 const BitmapColor& rFillColor = *mpFillColor; 366 Region aRegion( rPolyPoly ); | 348 } 349 } 350} 351 352// ------------------------------------------------------------------ 353 354void BitmapWriteAccess::DrawPolygon( const Polygon& rPoly ) 355{ --- 17 unchanged lines hidden (view full) --- 373void BitmapWriteAccess::FillPolyPolygon( const PolyPolygon& rPolyPoly ) 374{ 375 const sal_uInt16 nCount = rPolyPoly.Count(); 376 377 if( nCount && mpFillColor ) 378 { 379 const BitmapColor& rFillColor = *mpFillColor; 380 Region aRegion( rPolyPoly ); |
367 Rectangle aRect; | 381 //Rectangle aRect; |
368 369 aRegion.Intersect( Rectangle( Point(), Size( Width(), Height() ) ) ); 370 371 if( !aRegion.IsEmpty() ) 372 { | 382 383 aRegion.Intersect( Rectangle( Point(), Size( Width(), Height() ) ) ); 384 385 if( !aRegion.IsEmpty() ) 386 { |
373 RegionHandle aRegHandle( aRegion.BeginEnumRects() ); 374 375 while( aRegion.GetNextEnumRect( aRegHandle, aRect ) ) 376 for( long nY = aRect.Top(), nEndY = aRect.Bottom(); nY <= nEndY; nY++ ) 377 for( long nX = aRect.Left(), nEndX = aRect.Right(); nX <= nEndX; nX++ ) 378 SetPixel( nY, nX, rFillColor ); | 387 RectangleVector aRectangles; 388 aRegion.GetRegionRectangles(aRectangles); |
379 | 389 |
380 aRegion.EndEnumRects( aRegHandle ); | 390 for(RectangleVector::const_iterator aRectIter(aRectangles.begin()); aRectIter != aRectangles.end(); aRectIter++) 391 { 392 for(long nY = aRectIter->Top(), nEndY = aRectIter->Bottom(); nY <= nEndY; nY++) 393 { 394 for(long nX = aRectIter->Left(), nEndX = aRectIter->Right(); nX <= nEndX; nX++) 395 { 396 SetPixel(nY, nX, rFillColor); 397 } 398 } 399 } 400 401 //RegionHandle aRegHandle( aRegion.BeginEnumRects() ); 402 // 403 //while( aRegion.GetEnumRects( aRegHandle, aRect ) ) 404 // for( long nY = aRect.Top(), nEndY = aRect.Bottom(); nY <= nEndY; nY++ ) 405 // for( long nX = aRect.Left(), nEndX = aRect.Right(); nX <= nEndX; nX++ ) 406 // SetPixel( nY, nX, rFillColor ); 407 // 408 //aRegion.EndEnumRects( aRegHandle ); |
381 } 382 } 383} 384 385// ------------------------------------------------------------------ 386 387void BitmapWriteAccess::DrawPolyPolygon( const PolyPolygon& rPolyPoly ) 388{ --- 21 unchanged lines hidden --- | 409 } 410 } 411} 412 413// ------------------------------------------------------------------ 414 415void BitmapWriteAccess::DrawPolyPolygon( const PolyPolygon& rPolyPoly ) 416{ --- 21 unchanged lines hidden --- |