1*25b11142SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*25b11142SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*25b11142SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*25b11142SAndrew Rist * distributed with this work for additional information 6*25b11142SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*25b11142SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*25b11142SAndrew Rist * "License"); you may not use this file except in compliance 9*25b11142SAndrew Rist * with the License. You may obtain a copy of the License at 10*25b11142SAndrew Rist * 11*25b11142SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*25b11142SAndrew Rist * 13*25b11142SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*25b11142SAndrew Rist * software distributed under the License is distributed on an 15*25b11142SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*25b11142SAndrew Rist * KIND, either express or implied. See the License for the 17*25b11142SAndrew Rist * specific language governing permissions and limitations 18*25b11142SAndrew Rist * under the License. 19*25b11142SAndrew Rist * 20*25b11142SAndrew Rist *************************************************************/ 21*25b11142SAndrew Rist 22*25b11142SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_cppcanvas.hxx" 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <com/sun/star/rendering/XCanvas.hpp> 28cdf0e10cSrcweir #include <com/sun/star/rendering/XBitmapCanvas.hpp> 29cdf0e10cSrcweir 30cdf0e10cSrcweir #include <basegfx/matrix/b2dhommatrix.hxx> 31cdf0e10cSrcweir #include <basegfx/polygon/b2dpolypolygon.hxx> 32cdf0e10cSrcweir #include <basegfx/tools/canvastools.hxx> 33cdf0e10cSrcweir 34cdf0e10cSrcweir #include "implbitmapcanvas.hxx" 35cdf0e10cSrcweir 36cdf0e10cSrcweir 37cdf0e10cSrcweir using namespace ::com::sun::star; 38cdf0e10cSrcweir 39cdf0e10cSrcweir namespace cppcanvas 40cdf0e10cSrcweir { 41cdf0e10cSrcweir namespace internal 42cdf0e10cSrcweir { ImplBitmapCanvas(const uno::Reference<rendering::XBitmapCanvas> & rCanvas)43cdf0e10cSrcweir ImplBitmapCanvas::ImplBitmapCanvas( const uno::Reference< rendering::XBitmapCanvas >& rCanvas ) : 44cdf0e10cSrcweir ImplCanvas( uno::Reference< rendering::XCanvas >(rCanvas, 45cdf0e10cSrcweir uno::UNO_QUERY) ), 46cdf0e10cSrcweir mxBitmapCanvas( rCanvas ), 47cdf0e10cSrcweir mxBitmap( rCanvas, 48cdf0e10cSrcweir uno::UNO_QUERY ) 49cdf0e10cSrcweir { 50cdf0e10cSrcweir OSL_ENSURE( mxBitmapCanvas.is(), "ImplBitmapCanvas::ImplBitmapCanvas(): Invalid canvas" ); 51cdf0e10cSrcweir OSL_ENSURE( mxBitmap.is(), "ImplBitmapCanvas::ImplBitmapCanvas(): Invalid bitmap" ); 52cdf0e10cSrcweir } 53cdf0e10cSrcweir ~ImplBitmapCanvas()54cdf0e10cSrcweir ImplBitmapCanvas::~ImplBitmapCanvas() 55cdf0e10cSrcweir { 56cdf0e10cSrcweir } 57cdf0e10cSrcweir getSize() const58cdf0e10cSrcweir ::basegfx::B2ISize ImplBitmapCanvas::getSize() const 59cdf0e10cSrcweir { 60cdf0e10cSrcweir OSL_ENSURE( mxBitmap.is(), "ImplBitmapCanvas::getSize(): Invalid canvas" ); 61cdf0e10cSrcweir return ::basegfx::unotools::b2ISizeFromIntegerSize2D( mxBitmap->getSize() ); 62cdf0e10cSrcweir } 63cdf0e10cSrcweir clone() const64cdf0e10cSrcweir CanvasSharedPtr ImplBitmapCanvas::clone() const 65cdf0e10cSrcweir { 66cdf0e10cSrcweir return BitmapCanvasSharedPtr( new ImplBitmapCanvas( *this ) ); 67cdf0e10cSrcweir } 68cdf0e10cSrcweir } 69cdf0e10cSrcweir } 70