diff options
Diffstat (limited to 'svtools/source/filter.vcl/jpeg/jpeg.cxx')
-rw-r--r-- | svtools/source/filter.vcl/jpeg/jpeg.cxx | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/svtools/source/filter.vcl/jpeg/jpeg.cxx b/svtools/source/filter.vcl/jpeg/jpeg.cxx index 146beff287bc..439efb9e632d 100644 --- a/svtools/source/filter.vcl/jpeg/jpeg.cxx +++ b/svtools/source/filter.vcl/jpeg/jpeg.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -92,7 +92,7 @@ extern "C" long JPEGCallback( void* pCallbackData, long nPercent ) #define BUF_SIZE 4096 -typedef struct +typedef struct { struct jpeg_destination_mgr pub; /* public fields */ @@ -308,12 +308,12 @@ extern "C" void jpeg_svstream_src (j_decompress_ptr cinfo, void * in) // -------------- JPEGReader::JPEGReader( SvStream& rStm, void* /*pCallData*/, sal_Bool bSetLS ) : - rIStm ( rStm ), - pAcc ( NULL ), - pAcc1 ( NULL ), - pBuffer ( NULL ), - nLastPos ( rStm.Tell() ), - nLastLines ( 0 ), + rIStm ( rStm ), + pAcc ( NULL ), + pAcc1 ( NULL ), + pBuffer ( NULL ), + nLastPos ( rStm.Tell() ), + nLastLines ( 0 ), bSetLogSize ( bSetLS ) { maUpperName = String::CreateFromAscii( "SVIJPEG", 7 ); @@ -361,26 +361,26 @@ void* JPEGReader::CreateBitmap( void* pParam ) } else aBmp = Bitmap( aSize, 24 ); - + if ( bSetLogSize ) { unsigned long nUnit = ((JPEGCreateBitmapParam*)pParam)->density_unit; - - if( ( ( 1 == nUnit ) || ( 2 == nUnit ) ) && - ( (JPEGCreateBitmapParam*) pParam )->X_density && + + if( ( ( 1 == nUnit ) || ( 2 == nUnit ) ) && + ( (JPEGCreateBitmapParam*) pParam )->X_density && ( (JPEGCreateBitmapParam*) pParam )->Y_density ) { Point aEmptyPoint; - Fraction aFractX( 1, ((JPEGCreateBitmapParam*)pParam)->X_density ); - Fraction aFractY( 1, ((JPEGCreateBitmapParam*)pParam)->Y_density ); - MapMode aMapMode( nUnit == 1 ? MAP_INCH : MAP_CM, aEmptyPoint, aFractX, aFractY ); - Size aPrefSize = OutputDevice::LogicToLogic( aSize, aMapMode, MAP_100TH_MM ); + Fraction aFractX( 1, ((JPEGCreateBitmapParam*)pParam)->X_density ); + Fraction aFractY( 1, ((JPEGCreateBitmapParam*)pParam)->Y_density ); + MapMode aMapMode( nUnit == 1 ? MAP_INCH : MAP_CM, aEmptyPoint, aFractX, aFractY ); + Size aPrefSize = OutputDevice::LogicToLogic( aSize, aMapMode, MAP_100TH_MM ); aBmp.SetPrefSize( aPrefSize ); aBmp.SetPrefMapMode( MapMode( MAP_100TH_MM ) ); } } - + pAcc = aBmp.AcquireWriteAccess(); if( pAcc ) @@ -416,11 +416,11 @@ void JPEGReader::FillBitmap() { if( pBuffer && pAcc ) { - HPBYTE pTmp; - BitmapColor aColor; - long nAlignedWidth; - long nWidth = pAcc->Width(); - long nHeight = pAcc->Height(); + HPBYTE pTmp; + BitmapColor aColor; + long nAlignedWidth; + long nWidth = pAcc->Width(); + long nHeight = pAcc->Height(); if( pAcc->GetBitCount() == 8 ) { @@ -468,8 +468,8 @@ void JPEGReader::FillBitmap() Graphic JPEGReader::CreateIntermediateGraphic( const Bitmap& rBitmap, long nLines ) { - Graphic aGraphic; - const Size aSizePix( rBitmap.GetSizePixel() ); + Graphic aGraphic; + const Size aSizePix( rBitmap.GetSizePixel() ); if( !nLastLines ) { @@ -513,11 +513,11 @@ Graphic JPEGReader::CreateIntermediateGraphic( const Bitmap& rBitmap, long nLine ReadState JPEGReader::Read( Graphic& rGraphic ) { - long nEndPos; - long nLines; - ReadState eReadState; - BOOL bRet = FALSE; - BYTE cDummy; + long nEndPos; + long nLines; + ReadState eReadState; + BOOL bRet = FALSE; + BYTE cDummy; #if 1 // TODO: is it possible to get rid of this seek to the end? // check if the stream's end is already available @@ -592,9 +592,9 @@ ReadState JPEGReader::Read( Graphic& rGraphic ) // -------------- JPEGWriter::JPEGWriter( SvStream& rStm, const uno::Sequence< beans::PropertyValue >* pFilterData, bool* pExportWasGrey ) : - rOStm ( rStm ), - pAcc ( NULL ), - pBuffer ( NULL ), + rOStm ( rStm ), + pAcc ( NULL ), + pBuffer ( NULL ), pExpWasGrey ( pExportWasGrey ) { FilterConfigItem aConfigItem( (uno::Sequence< beans::PropertyValue >*)pFilterData ); @@ -629,8 +629,8 @@ void* JPEGWriter::GetScanline( long nY ) else if( pBuffer ) { BitmapColor aColor; - long nWidth = pAcc->Width(); - BYTE* pTmp = pBuffer; + long nWidth = pAcc->Width(); + BYTE* pTmp = pBuffer; if( pAcc->HasPalette() ) { @@ -686,8 +686,8 @@ BOOL JPEGWriter::Write( const Graphic& rGraphic ) pAcc = aGraphicBmp.AcquireReadAccess(); - if ( !bGreys ) // bitmap was not explicitely converted into greyscale, - { // check if source is greyscale only + if ( !bGreys ) // bitmap was not explicitely converted into greyscale, + { // check if source is greyscale only sal_Bool bIsGrey = sal_True; @@ -705,7 +705,7 @@ BOOL JPEGWriter::Write( const Graphic& rGraphic ) if ( bIsGrey ) bGreys = sal_True; } - + if( pExpWasGrey ) *pExpWasGrey = bGreys; @@ -738,9 +738,9 @@ BOOL JPEGWriter::Write( const Graphic& rGraphic ) BOOL ImportJPEG( SvStream& rStm, Graphic& rGraphic, void* pCallerData, sal_Int32 nImportFlags ) { - JPEGReader* pJPEGReader = (JPEGReader*) rGraphic.GetContext(); - ReadState eReadState; - BOOL bRet = TRUE; + JPEGReader* pJPEGReader = (JPEGReader*) rGraphic.GetContext(); + ReadState eReadState; + BOOL bRet = TRUE; if( !pJPEGReader ) pJPEGReader = new JPEGReader( rStm, pCallerData, ( nImportFlags & GRFILTER_I_FLAGS_SET_LOGSIZE_FOR_JPEG ) != 0 ); |