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