1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
23 #include "tools/gen.hxx"
25 #include "basebmp/bitmapdevice.hxx"
27 #include "vcl/salbtype.hxx"
29 #include "aqua/salconst.h"
30 #include "aqua/salgdi.h"
32 #include "saldata.hxx"
33 #include "salinst.hxx"
37 #include "salcolorutils.hxx"
47 class AquaSalVirtualDevice
;
48 class AquaSalGraphics
;
50 class AquaSalBitmap
: public SalBitmap
53 CGContextRef mxGraphicContext
;
54 mutable CGImageRef mxCachedImage
;
55 BitmapPalette maPalette
;
56 basebmp::RawMemorySharedArray maUserBuffer
;
57 basebmp::RawMemorySharedArray maContextBuffer
;
61 sal_uInt32 mnBytesPerRow
;
65 virtual ~AquaSalBitmap();
70 bool Create( const Size
& rSize
, sal_uInt16 nBitCount
, const BitmapPalette
& rPal
);
71 bool Create( const SalBitmap
& rSalBmp
);
72 bool Create( const SalBitmap
& rSalBmp
, SalGraphics
* pGraphics
);
73 bool Create( const SalBitmap
& rSalBmp
, sal_uInt16 nNewBitCount
);
74 virtual bool Create( const ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XBitmapCanvas
> xBitmapCanvas
,
81 sal_uInt16
GetBitCount() const;
83 BitmapBuffer
*AcquireBuffer( bool bReadOnly
);
84 void ReleaseBuffer( BitmapBuffer
* pBuffer
, bool bReadOnly
);
86 bool GetSystemData( BitmapSystemData
& rData
);
91 void DestroyContext();
92 bool AllocateUserData();
94 void ConvertBitmapData( sal_uInt32 nWidth
, sal_uInt32 nHeight
,
95 sal_uInt16 nDestBits
, sal_uInt32 nDestBytesPerRow
, const BitmapPalette
& rDestPalette
, sal_uInt8
* pDestData
,
96 sal_uInt16 nSrcBits
, sal_uInt32 nSrcBytesPerRow
, const BitmapPalette
& rSrcPalette
, sal_uInt8
* pSrcData
);
99 bool Create( CGLayerRef xLayer
, int nBitCount
, int nX
, int nY
, int nWidth
, int nHeight
, bool bMirrorVert
= true );
102 CGImageRef
CreateWithMask( const AquaSalBitmap
& rMask
, int nX
, int nY
, int nWidth
, int nHeight
) const;
103 CGImageRef
CreateColorMask( int nX
, int nY
, int nWidth
, int nHeight
, SalColor nMaskColor
) const;
104 CGImageRef
CreateCroppedImage( int nX
, int nY
, int nWidth
, int nHeight
) const;
107 #endif // _SV_SALBMP_HXX
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */