bmpconv.cxx (9f62ea84) | bmpconv.cxx (45fd3b9a) |
---|---|
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 --- 5 unchanged lines hidden (view full) --- 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 | 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 --- 5 unchanged lines hidden (view full) --- 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 |
22 23 | |
24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_vcl.hxx" 26 27#include "vcl/bitmap.hxx" 28#include "vcl/svapp.hxx" 29#include "vcl/salctype.hxx" 30#include "vos/mutex.hxx" 31#include "tools/stream.hxx" 32#include "com/sun/star/script/XInvocation.hpp" 33#include "com/sun/star/awt/XBitmap.hpp" 34#include "cppuhelper/compbase1.hxx" | 22// MARKER(update_precomp.py): autogen include statement, do not remove 23#include "precompiled_vcl.hxx" 24 25#include "vcl/bitmap.hxx" 26#include "vcl/svapp.hxx" 27#include "vcl/salctype.hxx" 28#include "vos/mutex.hxx" 29#include "tools/stream.hxx" 30#include "com/sun/star/script/XInvocation.hpp" 31#include "com/sun/star/awt/XBitmap.hpp" 32#include "cppuhelper/compbase1.hxx" |
33#include <vcl/dibtools.hxx> |
|
35 | 34 |
36 | |
37using namespace com::sun::star::uno; 38using namespace com::sun::star::script; 39using namespace com::sun::star::beans; 40using namespace com::sun::star::reflection; 41using namespace com::sun::star::awt; 42using namespace rtl; 43 44namespace vcl { --- 99 unchanged lines hidden (view full) --- 144 145 Sequence< sal_Int8 > aDIB = xBM->getDIB(); 146 147 // call into vcl not thread safe 148 vos::OGuard aGuard( Application::GetSolarMutex() ); 149 150 SvMemoryStream aStream( aDIB.getArray(), aDIB.getLength(), STREAM_READ | STREAM_WRITE ); 151 Bitmap aBM; | 35using namespace com::sun::star::uno; 36using namespace com::sun::star::script; 37using namespace com::sun::star::beans; 38using namespace com::sun::star::reflection; 39using namespace com::sun::star::awt; 40using namespace rtl; 41 42namespace vcl { --- 99 unchanged lines hidden (view full) --- 142 143 Sequence< sal_Int8 > aDIB = xBM->getDIB(); 144 145 // call into vcl not thread safe 146 vos::OGuard aGuard( Application::GetSolarMutex() ); 147 148 SvMemoryStream aStream( aDIB.getArray(), aDIB.getLength(), STREAM_READ | STREAM_WRITE ); 149 Bitmap aBM; |
152 aBM.Read( aStream, sal_True ); | 150 151 ReadDIB(aBM, aStream, true); 152 |
153 if( nTargetDepth < 4 ) 154 nTargetDepth = 1; 155 else if( nTargetDepth < 8 ) 156 nTargetDepth = 4; 157 else if( nTargetDepth >8 && nTargetDepth < 24 ) 158 nTargetDepth = 24; 159 160 if( aBM.GetBitCount() == 24 && nTargetDepth <= 8 ) --- 17 unchanged lines hidden (view full) --- 178 179 return aRet; 180} 181 182BmpTransporter::BmpTransporter( const Bitmap& rBM ) 183{ 184 m_aSize.Width = rBM.GetSizePixel().Width(); 185 m_aSize.Height = rBM.GetSizePixel().Height(); | 153 if( nTargetDepth < 4 ) 154 nTargetDepth = 1; 155 else if( nTargetDepth < 8 ) 156 nTargetDepth = 4; 157 else if( nTargetDepth >8 && nTargetDepth < 24 ) 158 nTargetDepth = 24; 159 160 if( aBM.GetBitCount() == 24 && nTargetDepth <= 8 ) --- 17 unchanged lines hidden (view full) --- 178 179 return aRet; 180} 181 182BmpTransporter::BmpTransporter( const Bitmap& rBM ) 183{ 184 m_aSize.Width = rBM.GetSizePixel().Width(); 185 m_aSize.Height = rBM.GetSizePixel().Height(); |
186 |
|
186 SvMemoryStream aStream; | 187 SvMemoryStream aStream; |
187 rBM.Write( aStream, sal_False, sal_True ); | 188 189 WriteDIB(rBM, aStream, false, true); 190 |
188 m_aBM = Sequence<sal_Int8>(static_cast<const sal_Int8*>(aStream.GetData()), 189 aStream.GetEndOfData()); 190} 191 192BmpTransporter::~BmpTransporter() 193{ 194} 195 --- 14 unchanged lines hidden --- | 191 m_aBM = Sequence<sal_Int8>(static_cast<const sal_Int8*>(aStream.GetData()), 192 aStream.GetEndOfData()); 193} 194 195BmpTransporter::~BmpTransporter() 196{ 197} 198 --- 14 unchanged lines hidden --- |