LibreOffice Module vcl (master)  1
salmisc.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 
20 #include <vcl/bitmapaccess.hxx>
21 #include <vcl/salgtype.hxx>
22 #include <bmpfast.hxx>
23 #include <o3tl/safeint.hxx>
24 #include <osl/diagnose.h>
25 #include <sal/log.hxx>
26 #include <tools/helpers.hxx>
27 #include <memory>
28 
29 #define IMPL_CASE_SET_FORMAT( Format, BitCount ) \
30 case( ScanlineFormat::Format ): \
31 { \
32  pFncSetPixel = BitmapReadAccess::SetPixelFor##Format; \
33  pDstBuffer->mnBitCount = BitCount; \
34 } \
35 break
36 
37 #define DOUBLE_SCANLINES() \
38 while( ( nActY < nHeight1 ) && ( pMapY[ nActY + 1 ] == nMapY ) ) \
39 { \
40  memcpy( pDstScanMap[ nActY + 1 ], pDstScan, rDstBuffer.mnScanlineSize ); \
41  nActY++; \
42 }
43 
44 constexpr int TC_TO_PAL_COLORS = 4096;
45 
47 {
48  return ( ( static_cast<tools::Long>(rCol.GetBlue()) >> 4) << 8 ) |
49  ( ( static_cast<tools::Long>(rCol.GetGreen()) >> 4 ) << 4 ) |
50  ( static_cast<tools::Long>(rCol.GetRed()) >> 4 );
51 }
52 
53 static void ImplPALToPAL( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffer,
54  FncGetPixel pFncGetPixel, FncSetPixel pFncSetPixel,
55  Scanline* pSrcScanMap, Scanline* pDstScanMap, tools::Long const * pMapX, const tools::Long* pMapY )
56 {
57  const tools::Long nHeight1 = rDstBuffer.mnHeight - 1;
58  const ColorMask& rSrcMask = rSrcBuffer.maColorMask;
59  const ColorMask& rDstMask = rDstBuffer.maColorMask;
60  BitmapPalette aColMap( rSrcBuffer.maPalette.GetEntryCount() );
61  BitmapColor* pColMapBuf = aColMap.ImplGetColorBuffer();
62  BitmapColor aIndex( 0 );
63 
64  for( sal_uInt16 i = 0, nSrcCount = aColMap.GetEntryCount(), nDstCount = rDstBuffer.maPalette.GetEntryCount(); i < nSrcCount; i++ )
65  {
66  if( ( i < nDstCount ) && ( rSrcBuffer.maPalette[ i ] == rDstBuffer.maPalette[ i ] ) )
67  aIndex.SetIndex( sal::static_int_cast<sal_uInt8>(i) );
68  else
69  aIndex.SetIndex( sal::static_int_cast<sal_uInt8>(rDstBuffer.maPalette.GetBestIndex( rSrcBuffer.maPalette[ i ] )) );
70 
71  pColMapBuf[ i ] = aIndex;
72  }
73 
74  for (tools::Long nActY = 0; nActY < rDstBuffer.mnHeight; ++nActY)
75  {
76  tools::Long nMapY = pMapY[nActY];
77  Scanline pSrcScan(pSrcScanMap[nMapY]), pDstScan(pDstScanMap[nActY]);
78 
79  for (tools::Long nX = 0; nX < rDstBuffer.mnWidth; ++nX)
80  pFncSetPixel( pDstScan, nX, pColMapBuf[ pFncGetPixel( pSrcScan, pMapX[ nX ], rSrcMask ).GetIndex() ], rDstMask );
81 
83  }
84 }
85 
86 static void ImplPALToTC( const BitmapBuffer& rSrcBuffer, BitmapBuffer const & rDstBuffer,
87  FncGetPixel pFncGetPixel, FncSetPixel pFncSetPixel,
88  Scanline* pSrcScanMap, Scanline* pDstScanMap, tools::Long const * pMapX, const tools::Long* pMapY )
89 {
90  const tools::Long nHeight1 = rDstBuffer.mnHeight - 1;
91  const ColorMask& rSrcMask = rSrcBuffer.maColorMask;
92  const ColorMask& rDstMask = rDstBuffer.maColorMask;
93  const BitmapColor* pColBuf = rSrcBuffer.maPalette.ImplGetColorBuffer();
94 
96  {
97  const BitmapColor aCol0( pColBuf[ 0 ] );
98  const BitmapColor aCol1( pColBuf[ 1 ] );
99  tools::Long nMapX;
100 
101  for (tools::Long nActY = 0; nActY < rDstBuffer.mnHeight; ++nActY)
102  {
103  tools::Long nMapY = pMapY[nActY];
104  Scanline pSrcScan(pSrcScanMap[nMapY]), pDstScan(pDstScanMap[nActY]);
105 
106  for (tools::Long nX = 0; nX < rDstBuffer.mnWidth;)
107  {
108  nMapX = pMapX[ nX ];
109  pFncSetPixel( pDstScan, nX++,
110  pSrcScan[ nMapX >> 3 ] & ( 1 << ( 7 - ( nMapX & 7 ) ) ) ? aCol1 : aCol0,
111  rDstMask );
112  }
113 
115  }
116  }
117  else if( RemoveScanline( rSrcBuffer.mnFormat ) == ScanlineFormat::N4BitMsnPal )
118  {
119  tools::Long nMapX;
120 
121  for (tools::Long nActY = 0; nActY < rDstBuffer.mnHeight; ++nActY)
122  {
123  tools::Long nMapY = pMapY[nActY];
124  Scanline pSrcScan(pSrcScanMap[nMapY]), pDstScan(pDstScanMap[nActY]);
125 
126  for (tools::Long nX = 0; nX < rDstBuffer.mnWidth;)
127  {
128  nMapX = pMapX[ nX ];
129  pFncSetPixel( pDstScan, nX++,
130  pColBuf[ ( pSrcScan[ nMapX >> 1 ] >> ( nMapX & 1 ? 0 : 4 ) ) & 0x0f ],
131  rDstMask );
132  }
133 
135  }
136  }
137  else if( RemoveScanline( rSrcBuffer.mnFormat ) == ScanlineFormat::N8BitPal )
138  {
139  for (tools::Long nActY = 0; nActY < rDstBuffer.mnHeight; ++nActY)
140  {
141  tools::Long nMapY = pMapY[nActY];
142  Scanline pSrcScan(pSrcScanMap[nMapY]), pDstScan(pDstScanMap[nActY]);
143 
144  for (tools::Long nX = 0; nX < rDstBuffer.mnWidth; ++nX)
145  pFncSetPixel( pDstScan, nX, pColBuf[ pSrcScan[ pMapX[ nX ] ] ], rDstMask );
146 
148  }
149  }
150  else
151  {
152  for (tools::Long nActY = 0; nActY < rDstBuffer.mnHeight; ++nActY)
153  {
154  tools::Long nMapY = pMapY[nActY];
155  Scanline pSrcScan(pSrcScanMap[nMapY]), pDstScan(pDstScanMap[nActY]);
156 
157  for (tools::Long nX = 0; nX < rDstBuffer.mnWidth; ++nX)
158  pFncSetPixel( pDstScan, nX, pColBuf[ pFncGetPixel( pSrcScan, pMapX[ nX ], rSrcMask ).GetIndex() ], rDstMask );
159 
161  }
162  }
163 }
164 
165 static void ImplTCToTC( const BitmapBuffer& rSrcBuffer, BitmapBuffer const & rDstBuffer,
166  FncGetPixel pFncGetPixel, FncSetPixel pFncSetPixel,
167  Scanline* pSrcScanMap, Scanline* pDstScanMap, tools::Long const * pMapX, const tools::Long* pMapY )
168 {
169  const tools::Long nHeight1 = rDstBuffer.mnHeight - 1;
170  const ColorMask& rSrcMask = rSrcBuffer.maColorMask;
171  const ColorMask& rDstMask = rDstBuffer.maColorMask;
172 
174  {
175  BitmapColor aCol;
176  sal_uInt8* pPixel = nullptr;
177 
178  for (tools::Long nActY = 0; nActY < rDstBuffer.mnHeight; ++nActY)
179  {
180  tools::Long nMapY = pMapY[nActY];
181  Scanline pSrcScan(pSrcScanMap[nMapY]), pDstScan(pDstScanMap[nActY]);
182 
183  for (tools::Long nX = 0; nX < rDstBuffer.mnWidth; ++nX)
184  {
185  pPixel = pSrcScan + pMapX[ nX ] * 3;
186  aCol.SetBlue( *pPixel++ );
187  aCol.SetGreen( *pPixel++ );
188  aCol.SetRed( *pPixel );
189  pFncSetPixel( pDstScan, nX, aCol, rDstMask );
190  }
191 
193  }
194  }
195  else
196  {
197  for (tools::Long nActY = 0; nActY < rDstBuffer.mnHeight; ++nActY)
198  {
199  tools::Long nMapY = pMapY[nActY];
200  Scanline pSrcScan(pSrcScanMap[nMapY]), pDstScan(pDstScanMap[nActY]);
201 
202  for (tools::Long nX = 0; nX < rDstBuffer.mnWidth; ++nX)
203  pFncSetPixel( pDstScan, nX, pFncGetPixel( pSrcScan, pMapX[ nX ], rSrcMask ), rDstMask );
204 
206  }
207  }
208 }
209 
210 static void ImplTCToPAL( const BitmapBuffer& rSrcBuffer, BitmapBuffer const & rDstBuffer,
211  FncGetPixel pFncGetPixel, FncSetPixel pFncSetPixel,
212  Scanline* pSrcScanMap, Scanline* pDstScanMap, tools::Long const * pMapX, const tools::Long* pMapY )
213 {
214  const tools::Long nHeight1 = rDstBuffer.mnHeight- 1;
215  const ColorMask& rSrcMask = rSrcBuffer.maColorMask;
216  const ColorMask& rDstMask = rDstBuffer.maColorMask;
217  std::unique_ptr<sal_uInt8[]> pColToPalMap(new sal_uInt8[ TC_TO_PAL_COLORS ]);
218  BitmapColor aIndex( 0 );
219 
220  for( tools::Long nR = 0; nR < 16; nR++ )
221  {
222  for( tools::Long nG = 0; nG < 16; nG++ )
223  {
224  for( tools::Long nB = 0; nB < 16; nB++ )
225  {
226  BitmapColor aCol( sal::static_int_cast<sal_uInt8>(nR << 4),
227  sal::static_int_cast<sal_uInt8>(nG << 4),
228  sal::static_int_cast<sal_uInt8>(nB << 4) );
229  pColToPalMap[ ImplIndexFromColor( aCol ) ] = static_cast<sal_uInt8>(rDstBuffer.maPalette.GetBestIndex( aCol ));
230  }
231  }
232  }
233 
234  for (tools::Long nActY = 0; nActY < rDstBuffer.mnHeight; ++nActY)
235  {
236  tools::Long nMapY = pMapY[nActY];
237  Scanline pSrcScan(pSrcScanMap[nMapY]), pDstScan(pDstScanMap[nActY]);
238 
239  for (tools::Long nX = 0; nX < rDstBuffer.mnWidth; ++nX)
240  {
241  aIndex.SetIndex( pColToPalMap[ ImplIndexFromColor( pFncGetPixel( pSrcScan, pMapX[ nX ], rSrcMask ) ) ] );
242  pFncSetPixel( pDstScan, nX, aIndex, rDstMask );
243  }
244 
246  }
247 }
248 
249 std::unique_ptr<BitmapBuffer> StretchAndConvert(
250  const BitmapBuffer& rSrcBuffer, const SalTwoRect& rTwoRect,
251  ScanlineFormat nDstBitmapFormat, const BitmapPalette* pDstPal, const ColorMask* pDstMask )
252 {
253  FncGetPixel pFncGetPixel;
254  FncSetPixel pFncSetPixel;
255  std::unique_ptr<BitmapBuffer> pDstBuffer(new BitmapBuffer);
256 
257  // set function for getting pixels
258  pFncGetPixel = BitmapReadAccess::GetPixelFunction( rSrcBuffer.mnFormat );
259  if( !pFncGetPixel )
260  {
261  // should never come here
262  // initialize pFncGetPixel to something valid that is
263  // least likely to crash
265  OSL_FAIL( "unknown read format" );
266  }
267 
268  // set function for setting pixels
269  const ScanlineFormat nDstScanlineFormat = RemoveScanline( nDstBitmapFormat );
270  switch( nDstScanlineFormat )
271  {
284 
285  default:
286  // should never come here
287  // initialize pFncSetPixel to something valid that is
288  // least likely to crash
290  pDstBuffer->mnBitCount = 1;
291  OSL_FAIL( "unknown write format" );
292  break;
293  }
294 
295  // fill destination buffer
296  pDstBuffer->mnFormat = nDstBitmapFormat;
297  pDstBuffer->mnWidth = rTwoRect.mnDestWidth;
298  pDstBuffer->mnHeight = rTwoRect.mnDestHeight;
299  tools::Long nScanlineBase;
300  bool bFail = o3tl::checked_multiply<tools::Long>(pDstBuffer->mnBitCount, pDstBuffer->mnWidth, nScanlineBase);
301  if (bFail)
302  {
303  SAL_WARN("vcl.gdi", "checked multiply failed");
304  pDstBuffer->mpBits = nullptr;
305  return nullptr;
306  }
307  pDstBuffer->mnScanlineSize = AlignedWidth4Bytes(nScanlineBase);
308  if (pDstBuffer->mnScanlineSize < nScanlineBase/8)
309  {
310  SAL_WARN("vcl.gdi", "scanline calculation wraparound");
311  pDstBuffer->mpBits = nullptr;
312  return nullptr;
313  }
314  try
315  {
316  pDstBuffer->mpBits = new sal_uInt8[ pDstBuffer->mnScanlineSize * pDstBuffer->mnHeight ];
317  }
318  catch( const std::bad_alloc& )
319  {
320  // memory exception, clean up
321  pDstBuffer->mpBits = nullptr;
322  return nullptr;
323  }
324 
325  // do we need a destination palette or color mask?
326  if( ( nDstScanlineFormat == ScanlineFormat::N1BitMsbPal ) ||
327  ( nDstScanlineFormat == ScanlineFormat::N1BitLsbPal ) ||
328  ( nDstScanlineFormat == ScanlineFormat::N4BitMsnPal ) ||
329  ( nDstScanlineFormat == ScanlineFormat::N4BitLsnPal ) ||
330  ( nDstScanlineFormat == ScanlineFormat::N8BitPal ) )
331  {
332  assert(pDstPal && "destination buffer requires palette");
333  if (!pDstPal)
334  {
335  return nullptr;
336  }
337  pDstBuffer->maPalette = *pDstPal;
338  }
339  else if(nDstScanlineFormat == ScanlineFormat::N32BitTcMask )
340  {
341  assert(pDstMask && "destination buffer requires color mask");
342  if (!pDstMask)
343  {
344  return nullptr;
345  }
346  pDstBuffer->maColorMask = *pDstMask;
347  }
348 
349  // short circuit the most important conversions
350  bool bFastConvert = ImplFastBitmapConversion( *pDstBuffer, rSrcBuffer, rTwoRect );
351  if( bFastConvert )
352  return pDstBuffer;
353 
354  std::unique_ptr<Scanline[]> pSrcScan;
355  std::unique_ptr<Scanline[]> pDstScan;
356  std::unique_ptr<tools::Long[]> pMapX;
357  std::unique_ptr<tools::Long[]> pMapY;
358 
359  try
360  {
361  pSrcScan.reset(new Scanline[rSrcBuffer.mnHeight]);
362  pDstScan.reset(new Scanline[pDstBuffer->mnHeight]);
363  pMapX.reset(new tools::Long[pDstBuffer->mnWidth]);
364  pMapY.reset(new tools::Long[pDstBuffer->mnHeight]);
365  }
366  catch( const std::bad_alloc& )
367  {
368  // memory exception, clean up
369  // remark: the buffer ptr causing the exception
370  // is still NULL here
371  return nullptr;
372  }
373 
374  // horizontal mapping table
375  if( (pDstBuffer->mnWidth != rTwoRect.mnSrcWidth) && (pDstBuffer->mnWidth != 0) )
376  {
377  const double fFactorX = static_cast<double>(rTwoRect.mnSrcWidth) / pDstBuffer->mnWidth;
378 
379  for (tools::Long i = 0; i < pDstBuffer->mnWidth; ++i)
380  pMapX[ i ] = rTwoRect.mnSrcX + static_cast<int>( i * fFactorX );
381  }
382  else
383  {
384  for (tools::Long i = 0, nTmp = rTwoRect.mnSrcX ; i < pDstBuffer->mnWidth; ++i)
385  pMapX[ i ] = nTmp++;
386  }
387 
388  // vertical mapping table
389  if( (pDstBuffer->mnHeight != rTwoRect.mnSrcHeight) && (pDstBuffer->mnHeight != 0) )
390  {
391  const double fFactorY = static_cast<double>(rTwoRect.mnSrcHeight) / pDstBuffer->mnHeight;
392 
393  for (tools::Long i = 0; i < pDstBuffer->mnHeight; ++i)
394  pMapY[ i ] = rTwoRect.mnSrcY + static_cast<int>( i * fFactorY );
395  }
396  else
397  {
398  for (tools::Long i = 0, nTmp = rTwoRect.mnSrcY; i < pDstBuffer->mnHeight; ++i)
399  pMapY[ i ] = nTmp++;
400  }
401 
402  // source scanline buffer
403  Scanline pTmpScan;
404  tools::Long nOffset;
405  if( rSrcBuffer.mnFormat & ScanlineFormat::TopDown )
406  {
407  pTmpScan = rSrcBuffer.mpBits;
408  nOffset = rSrcBuffer.mnScanlineSize;
409  }
410  else
411  {
412  pTmpScan = rSrcBuffer.mpBits + ( rSrcBuffer.mnHeight - 1 ) * rSrcBuffer.mnScanlineSize;
413  nOffset = -rSrcBuffer.mnScanlineSize;
414  }
415 
416  for (tools::Long i = 0; i < rSrcBuffer.mnHeight; i++, pTmpScan += nOffset)
417  pSrcScan[ i ] = pTmpScan;
418 
419  // destination scanline buffer
420  if( pDstBuffer->mnFormat & ScanlineFormat::TopDown )
421  {
422  pTmpScan = pDstBuffer->mpBits;
423  nOffset = pDstBuffer->mnScanlineSize;
424  }
425  else
426  {
427  pTmpScan = pDstBuffer->mpBits + ( pDstBuffer->mnHeight - 1 ) * pDstBuffer->mnScanlineSize;
428  nOffset = -pDstBuffer->mnScanlineSize;
429  }
430 
431  for (tools::Long i = 0; i < pDstBuffer->mnHeight; i++, pTmpScan += nOffset)
432  pDstScan[ i ] = pTmpScan;
433 
434  // do buffer scaling and conversion
435  if( rSrcBuffer.mnBitCount <= 8 && pDstBuffer->mnBitCount <= 8 )
436  {
437  ImplPALToPAL( rSrcBuffer, *pDstBuffer, pFncGetPixel, pFncSetPixel,
438  pSrcScan.get(), pDstScan.get(), pMapX.get(), pMapY.get() );
439  }
440  else if( rSrcBuffer.mnBitCount <= 8 && pDstBuffer->mnBitCount > 8 )
441  {
442  ImplPALToTC( rSrcBuffer, *pDstBuffer, pFncGetPixel, pFncSetPixel,
443  pSrcScan.get(), pDstScan.get(), pMapX.get(), pMapY.get() );
444  }
445  else if( rSrcBuffer.mnBitCount > 8 && pDstBuffer->mnBitCount > 8 )
446  {
447  ImplTCToTC( rSrcBuffer, *pDstBuffer, pFncGetPixel, pFncSetPixel,
448  pSrcScan.get(), pDstScan.get(), pMapX.get(), pMapY.get() );
449  }
450  else
451  {
452  ImplTCToPAL( rSrcBuffer, *pDstBuffer, pFncGetPixel, pFncSetPixel,
453  pSrcScan.get(), pDstScan.get(), pMapX.get(), pMapY.get() );
454  }
455 
456  return pDstBuffer;
457 }
458 
459 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
double mnHeight
#define IMPL_CASE_SET_FORMAT(Format, BitCount)
Definition: salmisc.cxx:29
static BitmapColor GetPixelForN1BitMsbPal(ConstScanline pScanline, tools::Long nX, const ColorMask &rMask)
Definition: bmpacc2.cxx:23
sal_uInt8 GetRed() const
ColorMask maColorMask
void SetBlue(sal_uInt8 nBlue)
sal_uInt32 AlignedWidth4Bytes(sal_uInt32 nWidthBits)
tools::Long mnHeight
long Long
tools::Long mnSrcHeight
Definition: salgtype.hxx:44
tools::Long mnSrcWidth
Definition: salgtype.hxx:43
for(size_t a(0);a< count;a++)
SAL_DLLPRIVATE const BitmapColor * ImplGetColorBuffer() const
tools::Long mnDestWidth
Definition: salgtype.hxx:47
sal_uInt16 mnBitCount
ScanlineFormat
Definition: Scanline.hxx:28
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
static void SetPixelForN1BitMsbPal(Scanline pScanline, tools::Long nX, const BitmapColor &rBitmapColor, const ColorMask &rMask)
Definition: bmpacc2.cxx:28
sal_uInt8 GetBlue() const
ScanlineFormat mnFormat
tools::Long mnDestHeight
Definition: salgtype.hxx:48
sal_uInt16 GetEntryCount() const
sal_uInt8 * Scanline
Definition: Scanline.hxx:25
int i
void SetRed(sal_uInt8 nRed)
sal_uInt8 * mpBits
tools::Long mnSrcX
Definition: salgtype.hxx:41
tools::Long mnSrcY
Definition: salgtype.hxx:42
static void ImplPALToTC(const BitmapBuffer &rSrcBuffer, BitmapBuffer const &rDstBuffer, FncGetPixel pFncGetPixel, FncSetPixel pFncSetPixel, Scanline *pSrcScanMap, Scanline *pDstScanMap, tools::Long const *pMapX, const tools::Long *pMapY)
Definition: salmisc.cxx:86
sal_uInt16 GetBestIndex(const BitmapColor &rCol) const
void SetIndex(sal_uInt8 cIndex)
Definition: BitmapColor.hxx:66
static void ImplTCToPAL(const BitmapBuffer &rSrcBuffer, BitmapBuffer const &rDstBuffer, FncGetPixel pFncGetPixel, FncSetPixel pFncSetPixel, Scanline *pSrcScanMap, Scanline *pDstScanMap, tools::Long const *pMapX, const tools::Long *pMapY)
Definition: salmisc.cxx:210
sal_uInt8 GetGreen() const
static FncGetPixel GetPixelFunction(ScanlineFormat nFormat)
Definition: bmpacc.cxx:122
constexpr int TC_TO_PAL_COLORS
Definition: salmisc.cxx:44
void(* FncSetPixel)(Scanline pScanline, tools::Long nX, const BitmapColor &rBitmapColor, const ColorMask &rMask)
std::deque< AttacherIndex_Impl > aIndex
tools::Long mnScanlineSize
static void ImplPALToPAL(const BitmapBuffer &rSrcBuffer, BitmapBuffer &rDstBuffer, FncGetPixel pFncGetPixel, FncSetPixel pFncSetPixel, Scanline *pSrcScanMap, Scanline *pDstScanMap, tools::Long const *pMapX, const tools::Long *pMapY)
Definition: salmisc.cxx:53
unsigned char sal_uInt8
void SetGreen(sal_uInt8 nGreen)
#define DOUBLE_SCANLINES()
Definition: salmisc.cxx:37
static tools::Long ImplIndexFromColor(const BitmapColor &rCol)
Definition: salmisc.cxx:46
double mnWidth
std::unique_ptr< BitmapBuffer > StretchAndConvert(const BitmapBuffer &rSrcBuffer, const SalTwoRect &rTwoRect, ScanlineFormat nDstBitmapFormat, const BitmapPalette *pDstPal, const ColorMask *pDstMask)
Definition: salmisc.cxx:249
ScanlineFormat RemoveScanline(ScanlineFormat nFormat)
Definition: Scanline.hxx:56
BitmapPalette maPalette
BitmapColor(* FncGetPixel)(ConstScanline pScanline, tools::Long nX, const ColorMask &rMask)
#define SAL_WARN(area, stream)
tools::Long mnWidth
static void ImplTCToTC(const BitmapBuffer &rSrcBuffer, BitmapBuffer const &rDstBuffer, FncGetPixel pFncGetPixel, FncSetPixel pFncSetPixel, Scanline *pSrcScanMap, Scanline *pDstScanMap, tools::Long const *pMapX, const tools::Long *pMapY)
Definition: salmisc.cxx:165
bool ImplFastBitmapConversion(BitmapBuffer &rDst, const BitmapBuffer &rSrc, const SalTwoRect &rTR)
Definition: bmpfast.cxx:373