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