diff options
-rw-r--r-- | vcl/source/gdi/bitmap2.cxx | 10 | ||||
-rw-r--r-- | vcl/source/gdi/bmpacc.cxx | 16 | ||||
-rw-r--r-- | vcl/source/gdi/bmpacc2.cxx | 28 | ||||
-rw-r--r-- | vcl/source/gdi/salmisc.cxx | 13 | ||||
-rw-r--r-- | vcl/unx/source/gdi/salbmp.cxx | 33 | ||||
-rw-r--r-- | vcl/unx/source/gdi/salgdi2.cxx | 10 | ||||
-rw-r--r-- | vcl/win/source/gdi/salbmp.cxx | 6 |
7 files changed, 78 insertions, 38 deletions
diff --git a/vcl/source/gdi/bitmap2.cxx b/vcl/source/gdi/bitmap2.cxx index ab08732b790c..0febc706acd0 100644 --- a/vcl/source/gdi/bitmap2.cxx +++ b/vcl/source/gdi/bitmap2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: bitmap2.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: ka $ $Date: 2001-03-29 13:20:51 $ + * last change: $Author: cp $ $Date: 2001-06-28 13:10:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -608,7 +608,7 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri for( long nX = 0L; nX < nWidth; nX++ ) { - aMask.GetColorFor16Bit( aColor, (BYTE*) pTmp16++ ); + aMask.GetColorFor16BitLSB( aColor, (BYTE*) pTmp16++ ); rAcc.SetPixel( nY, nX, aColor ); } } @@ -721,10 +721,10 @@ BOOL Bitmap::ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bCompre switch( rAcc.GetScanlineFormat() ) { - case( BMP_FORMAT_16BIT_TC_MASK ): + case( BMP_FORMAT_16BIT_TC_LSB_MASK ): case( BMP_FORMAT_32BIT_TC_MASK ): { - aHeader.nBitCount = ( rAcc.GetScanlineFormat() == BMP_FORMAT_16BIT_TC_MASK ) ? 16 : 32; + aHeader.nBitCount = ( rAcc.GetScanlineFormat() == BMP_FORMAT_16BIT_TC_LSB_MASK ) ? 16 : 32; nCompression = BITFIELDS; } break; diff --git a/vcl/source/gdi/bmpacc.cxx b/vcl/source/gdi/bmpacc.cxx index 6fc3657c90fd..94827ab11303 100644 --- a/vcl/source/gdi/bmpacc.cxx +++ b/vcl/source/gdi/bmpacc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: bmpacc.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:05:37 $ + * last change: $Author: cp $ $Date: 2001-06-28 13:10:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -212,7 +212,8 @@ BOOL BitmapReadAccess::ImplSetAccessPointers( ULONG nFormat ) CASE_FORMAT( _4BIT_LSN_PAL ) CASE_FORMAT( _8BIT_PAL ) CASE_FORMAT( _8BIT_TC_MASK ) - CASE_FORMAT( _16BIT_TC_MASK ) + CASE_FORMAT( _16BIT_TC_MSB_MASK ) + CASE_FORMAT( _16BIT_TC_LSB_MASK ) CASE_FORMAT( _24BIT_TC_BGR ) CASE_FORMAT( _24BIT_TC_RGB ) CASE_FORMAT( _24BIT_TC_MASK ) @@ -257,7 +258,8 @@ void BitmapReadAccess::ImplZeroInitUnusedBits() nBits = 8; break; - case( BMP_FORMAT_16BIT_TC_MASK ): + case( BMP_FORMAT_16BIT_TC_MSB_MASK ): + case( BMP_FORMAT_16BIT_TC_LSB_MASK ): nBits = 16; break; @@ -387,7 +389,8 @@ void BitmapWriteAccess::CopyScanline( long nY, const Scanline aSrcScanline, HMEMCPY( mpScanBuf[ nY ], aSrcScanline, nCount ); else { - BMP_ASSERT( nFormat != BMP_FORMAT_8BIT_TC_MASK && nFormat != BMP_FORMAT_16BIT_TC_MASK && + BMP_ASSERT( nFormat != BMP_FORMAT_8BIT_TC_MASK && + nFormat != BMP_FORMAT_16BIT_TC_MSB_MASK && nFormat != BMP_FORMAT_16BIT_TC_LSB_MASK && nFormat != BMP_FORMAT_24BIT_TC_MASK && nFormat != BMP_FORMAT_32BIT_TC_MASK, "No support for pixel formats with color masks yet!" ); @@ -401,7 +404,8 @@ void BitmapWriteAccess::CopyScanline( long nY, const Scanline aSrcScanline, case( BMP_FORMAT_4BIT_LSN_PAL ): pFncGetPixel = GetPixelFor_4BIT_LSN_PAL; break; case( BMP_FORMAT_8BIT_PAL ): pFncGetPixel = GetPixelFor_8BIT_PAL; break; case( BMP_FORMAT_8BIT_TC_MASK ): pFncGetPixel = GetPixelFor_8BIT_TC_MASK; break; - case( BMP_FORMAT_16BIT_TC_MASK ): pFncGetPixel = GetPixelFor_16BIT_TC_MASK; break; + case( BMP_FORMAT_16BIT_TC_MSB_MASK ): pFncGetPixel = GetPixelFor_16BIT_TC_MSB_MASK; break; + case( BMP_FORMAT_16BIT_TC_LSB_MASK ): pFncGetPixel = GetPixelFor_16BIT_TC_LSB_MASK; break; case( BMP_FORMAT_24BIT_TC_BGR ): pFncGetPixel = GetPixelFor_24BIT_TC_BGR; break; case( BMP_FORMAT_24BIT_TC_RGB ): pFncGetPixel = GetPixelFor_24BIT_TC_RGB; break; case( BMP_FORMAT_24BIT_TC_MASK ): pFncGetPixel = GetPixelFor_24BIT_TC_MASK; break; diff --git a/vcl/source/gdi/bmpacc2.cxx b/vcl/source/gdi/bmpacc2.cxx index a07f58815a88..7886656413d6 100644 --- a/vcl/source/gdi/bmpacc2.cxx +++ b/vcl/source/gdi/bmpacc2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: bmpacc2.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:05:37 $ + * last change: $Author: cp $ $Date: 2001-06-28 13:10:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -170,18 +170,34 @@ IMPL_FORMAT_SETPIXEL( _8BIT_TC_MASK ) // ------------------------------------------------------------------ -IMPL_FORMAT_GETPIXEL( _16BIT_TC_MASK ) +IMPL_FORMAT_GETPIXEL( _16BIT_TC_MSB_MASK ) { BitmapColor aColor; - rMask.GetColorFor16Bit( aColor, pScanline + ( nX << 1UL ) ); + rMask.GetColorFor16BitMSB( aColor, pScanline + ( nX << 1UL ) ); return aColor; } // ------------------------------------------------------------------ -IMPL_FORMAT_SETPIXEL( _16BIT_TC_MASK ) +IMPL_FORMAT_SETPIXEL( _16BIT_TC_MSB_MASK ) { - rMask.SetColorFor16Bit( rBitmapColor, pScanline + ( nX << 1UL ) ); + rMask.SetColorFor16BitMSB( rBitmapColor, pScanline + ( nX << 1UL ) ); +} + +// ------------------------------------------------------------------ + +IMPL_FORMAT_GETPIXEL( _16BIT_TC_LSB_MASK ) +{ + BitmapColor aColor; + rMask.GetColorFor16BitLSB( aColor, pScanline + ( nX << 1UL ) ); + return aColor; +} + +// ------------------------------------------------------------------ + +IMPL_FORMAT_SETPIXEL( _16BIT_TC_LSB_MASK ) +{ + rMask.SetColorFor16BitLSB( rBitmapColor, pScanline + ( nX << 1UL ) ); } // ------------------------------------------------------------------ diff --git a/vcl/source/gdi/salmisc.cxx b/vcl/source/gdi/salmisc.cxx index 50af07d0eda9..96c23066abdc 100644 --- a/vcl/source/gdi/salmisc.cxx +++ b/vcl/source/gdi/salmisc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: salmisc.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:05:38 $ + * last change: $Author: cp $ $Date: 2001-06-28 13:10:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -347,7 +347,8 @@ BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRec IMPL_CASE_GET_FORMAT( _4BIT_LSN_PAL ); IMPL_CASE_GET_FORMAT( _8BIT_PAL ); IMPL_CASE_GET_FORMAT( _8BIT_TC_MASK ); - IMPL_CASE_GET_FORMAT( _16BIT_TC_MASK ); + IMPL_CASE_GET_FORMAT( _16BIT_TC_MSB_MASK ); + IMPL_CASE_GET_FORMAT( _16BIT_TC_LSB_MASK ); IMPL_CASE_GET_FORMAT( _24BIT_TC_BGR ); IMPL_CASE_GET_FORMAT( _24BIT_TC_RGB ); IMPL_CASE_GET_FORMAT( _24BIT_TC_MASK ); @@ -371,7 +372,8 @@ BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRec IMPL_CASE_SET_FORMAT( _4BIT_LSN_PAL, 4 ); IMPL_CASE_SET_FORMAT( _8BIT_PAL, 8 ); IMPL_CASE_SET_FORMAT( _8BIT_TC_MASK, 8 ); - IMPL_CASE_SET_FORMAT( _16BIT_TC_MASK, 16 ); + IMPL_CASE_SET_FORMAT( _16BIT_TC_MSB_MASK, 16 ); + IMPL_CASE_SET_FORMAT( _16BIT_TC_LSB_MASK, 16 ); IMPL_CASE_SET_FORMAT( _24BIT_TC_BGR, 24 ); IMPL_CASE_SET_FORMAT( _24BIT_TC_RGB, 24 ); IMPL_CASE_SET_FORMAT( _24BIT_TC_MASK, 24 ); @@ -405,7 +407,8 @@ BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRec pDstBuffer->maPalette = *pDstPal; } else if( ( nDstScanlineFormat == BMP_FORMAT_8BIT_TC_MASK ) || - ( nDstScanlineFormat == BMP_FORMAT_16BIT_TC_MASK ) || + ( nDstScanlineFormat == BMP_FORMAT_16BIT_TC_MSB_MASK ) || + ( nDstScanlineFormat == BMP_FORMAT_16BIT_TC_LSB_MASK ) || ( nDstScanlineFormat == BMP_FORMAT_24BIT_TC_MASK ) || ( nDstScanlineFormat == BMP_FORMAT_32BIT_TC_MASK ) ) { diff --git a/vcl/unx/source/gdi/salbmp.cxx b/vcl/unx/source/gdi/salbmp.cxx index 9c6b2101fcc0..f3afbd9b7ca3 100644 --- a/vcl/unx/source/gdi/salbmp.cxx +++ b/vcl/unx/source/gdi/salbmp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: salbmp.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: oisin $ $Date: 2001-01-31 15:01:50 $ + * last change: $Author: cp $ $Date: 2001-06-28 13:11:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -265,13 +265,18 @@ BitmapBuffer* SalBitmap::ImplCreateDIB( Drawable aDrawable, case( 16 ): { - aSrcBuf.mnFormat |= BMP_FORMAT_16BIT_TC_MASK; nDstFormat |= BMP_FORMAT_24BIT_TC_BGR; + aSrcBuf.maColorMask = ColorMask( pImage->red_mask, pImage->green_mask, pImage->blue_mask ); if( LSBFirst == pImage->byte_order ) - aSrcBuf.maColorMask = ColorMask( pImage->red_mask, pImage->green_mask, pImage->blue_mask ); + { + aSrcBuf.mnFormat |= BMP_FORMAT_16BIT_TC_LSB_MASK; + } else - aSrcBuf.maColorMask = ColorMask( SWAPSHORT( pImage->red_mask ), SWAPSHORT( pImage->green_mask ), SWAPSHORT( pImage->blue_mask ) ); + { + aSrcBuf.mnFormat |= BMP_FORMAT_16BIT_TC_MSB_MASK; + // aSrcBuf.maColorMask = ColorMask( pImage->red_mask ), SWAPSHORT( pImage->green_mask ), SWAPSHORT( pImage->blue_mask ) ); + } } break; @@ -386,12 +391,22 @@ XImage* SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, long nDepth, const Sa case( 16 ): { - nDstFormat |= BMP_FORMAT_16BIT_TC_MASK; + #ifdef __BIGENDIAN - if( LSBFirst == pImage->byte_order ) - pMask = new ColorMask( pImage->red_mask, pImage->green_mask, pImage->blue_mask ); + if( MSBFirst == pImage->byte_order ) + nDstFormat |= BMP_FORMAT_16BIT_TC_MSB_MASK; else - pMask = new ColorMask( SWAPSHORT( pImage->red_mask ), SWAPSHORT( pImage->green_mask ), SWAPSHORT( pImage->blue_mask ) ); + nDstFormat |= BMP_FORMAT_16BIT_TC_LSB_MASK; + + #else /* __LITTLEENDIAN */ + + nDstFormat |= BMP_FORMAT_16BIT_TC_LSB_MASK; + if( MSBFirst == pImage->byte_order ) + pImage->byte_order = LSBFirst; + + #endif + + pMask = new ColorMask( pImage->red_mask, pImage->green_mask, pImage->blue_mask ); } break; diff --git a/vcl/unx/source/gdi/salgdi2.cxx b/vcl/unx/source/gdi/salgdi2.cxx index b3e902e0be2c..24f0dc12db9b 100644 --- a/vcl/unx/source/gdi/salgdi2.cxx +++ b/vcl/unx/source/gdi/salgdi2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: salgdi2.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: cp $ $Date: 2001-05-31 11:47:46 $ + * last change: $Author: cp $ $Date: 2001-06-28 13:11:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -468,8 +468,10 @@ SalPrinterBmp::SalPrinterBmp (BitmapBuffer* pBuffer) : mpFncGetPixel = BitmapReadAccess::GetPixelFor_8BIT_PAL; break; case BMP_FORMAT_8BIT_TC_MASK: mpFncGetPixel = BitmapReadAccess::GetPixelFor_8BIT_TC_MASK; break; - case BMP_FORMAT_16BIT_TC_MASK: - mpFncGetPixel = BitmapReadAccess::GetPixelFor_16BIT_TC_MASK; break; + case BMP_FORMAT_16BIT_TC_MSB_MASK: + mpFncGetPixel = BitmapReadAccess::GetPixelFor_16BIT_TC_MSB_MASK; break; + case BMP_FORMAT_16BIT_TC_LSB_MASK: + mpFncGetPixel = BitmapReadAccess::GetPixelFor_16BIT_TC_LSB_MASK; break; case BMP_FORMAT_24BIT_TC_BGR: mpFncGetPixel = BitmapReadAccess::GetPixelFor_24BIT_TC_BGR; break; case BMP_FORMAT_24BIT_TC_RGB: diff --git a/vcl/win/source/gdi/salbmp.cxx b/vcl/win/source/gdi/salbmp.cxx index ec0f9914b5ee..b97c7b8ed251 100644 --- a/vcl/win/source/gdi/salbmp.cxx +++ b/vcl/win/source/gdi/salbmp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: salbmp.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:05:49 $ + * last change: $Author: cp $ $Date: 2001-06-28 13:13:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -494,7 +494,7 @@ BitmapBuffer* SalBitmap::AcquireBuffer( BOOL bReadOnly ) ( pBIH->biBitCount == 1 ? BMP_FORMAT_1BIT_MSB_PAL : pBIH->biBitCount == 4 ? BMP_FORMAT_4BIT_MSN_PAL : pBIH->biBitCount == 8 ? BMP_FORMAT_8BIT_PAL : - pBIH->biBitCount == 16 ? BMP_FORMAT_16BIT_TC_MASK : + pBIH->biBitCount == 16 ? BMP_FORMAT_16BIT_TC_LSB_MASK : pBIH->biBitCount == 24 ? BMP_FORMAT_24BIT_TC_BGR : pBIH->biBitCount == 32 ? BMP_FORMAT_32BIT_TC_MASK : 0UL ); |