1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef CGM_BITMAP_HXX_ 25 #define CGM_BITMAP_HXX_ 26 27 #include "cgm.hxx" 28 #include <vcl/bmpacc.hxx> 29 30 class CGM; 31 32 class CGMBitmapDescriptor 33 { 34 public: 35 sal_uInt8* mpBuf; 36 Bitmap* mpBitmap; 37 BitmapWriteAccess* mpAcc; 38 sal_Bool mbStatus; 39 sal_Bool mbVMirror; 40 sal_Bool mbHMirror; 41 sal_uInt32 mnDstBitsPerPixel; 42 sal_uInt32 mnScanSize; // bytes per line 43 FloatPoint mnP, mnQ, mnR; 44 45 FloatPoint mnOrigin; 46 double mndx, mndy; 47 double mnOrientation; 48 49 sal_uInt32 mnX, mnY; 50 long mnLocalColorPrecision; 51 sal_uInt32 mnCompressionMode; CGMBitmapDescriptor()52 CGMBitmapDescriptor() : 53 mpBuf ( NULL ), 54 mpBitmap ( NULL ), 55 mpAcc ( NULL ), 56 mbStatus ( sal_False ), 57 mbVMirror ( sal_False ), 58 mbHMirror ( sal_False ) { }; ~CGMBitmapDescriptor()59 ~CGMBitmapDescriptor() 60 { 61 if ( mpAcc ) 62 mpBitmap->ReleaseAccess( mpAcc ); 63 if ( mpBitmap ) 64 delete mpBitmap; 65 }; 66 }; 67 68 class CGMBitmap 69 { 70 CGM* mpCGM; 71 CGMBitmapDescriptor* pCGMBitmapDescriptor; 72 sal_Bool ImplGetDimensions( CGMBitmapDescriptor& ); 73 void ImplSetCurrentPalette( CGMBitmapDescriptor& ); 74 void ImplGetBitmap( CGMBitmapDescriptor& ); 75 void ImplInsert( CGMBitmapDescriptor& rSource, CGMBitmapDescriptor& rDest ); 76 public: 77 CGMBitmap( CGM& rCGM ); 78 ~CGMBitmap(); 79 CGMBitmapDescriptor* GetBitmap(); 80 CGMBitmap* GetNext(); 81 }; 82 #endif 83 84