diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-01-19 20:56:58 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-01-20 09:43:28 +0000 |
commit | 4ebe24910441e7f382cff4ccc899515910c74c2c (patch) | |
tree | 5aa56197779b7038a4fa41423d976f6c7b4c9c78 /include | |
parent | 62ea0ef8428ca4e12c5fa11674737a9bf0b646aa (diff) |
drop basebmp entirely now
Change-Id: I534848c4be8eadf86b7f31ac742a80982405f56f
Diffstat (limited to 'include')
-rw-r--r-- | include/basebmp/basebmpdllapi.h | 34 | ||||
-rw-r--r-- | include/basebmp/bitmapdevice.hxx | 168 | ||||
-rw-r--r-- | include/basebmp/color.hxx | 93 | ||||
-rw-r--r-- | include/basebmp/scanlineformats.hxx | 60 | ||||
-rw-r--r-- | include/sal/log-areas.dox | 5 |
5 files changed, 0 insertions, 360 deletions
diff --git a/include/basebmp/basebmpdllapi.h b/include/basebmp/basebmpdllapi.h deleted file mode 100644 index 88241af7a812..000000000000 --- a/include/basebmp/basebmpdllapi.h +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_BASEBMP_BASEBMPDLLAPI_H -#define INCLUDED_BASEBMP_BASEBMPDLLAPI_H - -#include <sal/types.h> - -#if defined BASEBMP_DLLIMPLEMENTATION -#define BASEBMP_DLLPUBLIC SAL_DLLPUBLIC_EXPORT -#else -#define BASEBMP_DLLPUBLIC SAL_DLLPUBLIC_IMPORT -#endif -#define BASEBMP_DLLPRIVATE SAL_DLLPRIVATE - -#endif /* INCLUDED_BASEBMP_BASEBMPDLLAPI_H */ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/basebmp/bitmapdevice.hxx b/include/basebmp/bitmapdevice.hxx deleted file mode 100644 index aa1cc6a2ff2b..000000000000 --- a/include/basebmp/bitmapdevice.hxx +++ /dev/null @@ -1,168 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_BASEBMP_BITMAPDEVICE_HXX -#define INCLUDED_BASEBMP_BITMAPDEVICE_HXX - -#include <sal/types.h> -#include <basebmp/scanlineformats.hxx> -#include <basebmp/basebmpdllapi.h> - -#include <boost/shared_array.hpp> -#include <memory> -#include <vector> - -namespace basegfx -{ - class B2IPoint; - class B2DPoint; - class B2IVector; - class B2IBox; -} - -namespace basebmp -{ - -// Temporary. Use like the tools color object -class Color; -typedef std::shared_ptr< class BitmapDevice > BitmapDeviceSharedPtr; -typedef boost::shared_array< sal_uInt8 > RawMemorySharedArray; -typedef std::shared_ptr< const std::vector<Color> > PaletteMemorySharedVector; - -struct ImplBitmapDevice; - -/** Definition of BitmapDevice interface - - Use the createBitmapDevice() function to create instances. - - Implementation note: the clip mask and bitmap parameter instances - of BitmapDevice that are passed to individual BitmapDevice - instances work best with 1 bit grey masks for the clip and a - format matching that of the target BitmapDevice for the other - parameters. - */ -class BASEBMP_DLLPUBLIC BitmapDevice : public std::enable_shared_from_this<BitmapDevice> -{ -public: - /** Query size of device in pixel columns (X) and rows (Y, "scanlines") - */ - basegfx::B2IVector getSize() const; - - /** Query type of scanline memory format - */ - Format getScanlineFormat() const; - - /** Query byte offset to get from scanline n to scanline n+1 - - @return the scanline stride in bytes. - */ - sal_Int32 getScanlineStride() const; - - /** Get pointer to frame buffer - - @return a shared ptr to the bitmap buffer memory. As this is a - shared ptr, you can freely store and use the pointer, even - after this object has been deleted. - */ - RawMemorySharedArray getBuffer() const; - - /** Get pointer to palette - - The returned pointer is const on purpose, since the - BitmapDevice might internally cache lookup information. Don't - modify the returned data, unless you want to enter the realm - of completely undefined behaviour. - - @return shared pointer to vector of Color entries. - */ - PaletteMemorySharedVector getPalette() const; - - /** Get color value at given pixel - */ - Color getPixel( const basegfx::B2IPoint& rPt ); - - /** Draw another bitmap into this device - - @param rSrcBitmap - Bitmap to render into this one. - */ - void convertBitmap( const BitmapDeviceSharedPtr& rSrcBitmap ); - -protected: - BASEBMP_DLLPRIVATE BitmapDevice( const basegfx::B2IBox& rBounds, - Format nScanlineFormat, - sal_Int32 nScanlineStride, - sal_uInt8* pFirstScanline, - const RawMemorySharedArray& rMem, - const PaletteMemorySharedVector& rPalette ); - BASEBMP_DLLPRIVATE virtual ~BitmapDevice(); - BitmapDevice(const BitmapDevice&) = delete; - BitmapDevice& operator=( const BitmapDevice& ) = delete; - -private: - - BASEBMP_DLLPRIVATE virtual Color getPixel_i( const basegfx::B2IPoint& rPt ) = 0; - - BASEBMP_DLLPRIVATE virtual void convertBitmap_i( const BitmapDeviceSharedPtr& rSrcBitmap ) = 0; - - std::unique_ptr< ImplBitmapDevice > mpImpl; -}; - -/** Function to calculate a suitable BitmapDevice Scanline Stride for a given scanline format and width - * you can provide this value or any larger value. - */ -sal_Int32 BASEBMP_DLLPUBLIC getBitmapDeviceStrideForWidth(Format nScanlineFormat, sal_Int32 nWidth); - -/** Function to create a BitmapDevice for given scanline format - */ -BitmapDeviceSharedPtr BASEBMP_DLLPUBLIC createBitmapDevice( const basegfx::B2IVector& rSize, - Format nScanlineFormat ); - -/** Function to create a BitmapDevice for given scanline format - with the given palette - - Note: the provided palette must have sufficient size, to satisfy - lookups for the whole range of pixel values from the specified - format. - */ -BitmapDeviceSharedPtr BASEBMP_DLLPUBLIC createBitmapDevice( const basegfx::B2IVector& rSize, - Format nScanlineFormat, - const PaletteMemorySharedVector& rPalette ); - -/** Function to create a BitmapDevice for given scanline format - from the given piece of raw memory and palette - - Note: the provided memory must have sufficient size, to store the - image of the specified area and format. - */ -BitmapDeviceSharedPtr BASEBMP_DLLPUBLIC createBitmapDevice( const basegfx::B2IVector& rSize, - Format nScanlineFormat, - const RawMemorySharedArray& rMem, - const PaletteMemorySharedVector& rPalette ); - - -/** Function to clone a BitmapDevice from a given prototype. - */ -BitmapDeviceSharedPtr BASEBMP_DLLPUBLIC cloneBitmapDevice(const BitmapDeviceSharedPtr& rProto); - -} - -#endif /* INCLUDED_BASEBMP_BITMAPDEVICE_HXX */ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/basebmp/color.hxx b/include/basebmp/color.hxx deleted file mode 100644 index b2d79b7c9f85..000000000000 --- a/include/basebmp/color.hxx +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_BASEBMP_COLOR_HXX -#define INCLUDED_BASEBMP_COLOR_HXX - -#include <sal/types.h> -#include <rtl/math.hxx> - -namespace basebmp -{ - -class Color -{ -private: - sal_uInt32 mnColor; - -public: - typedef sal_uInt32 value_type; - typedef sal_uInt8 component_type; - - Color() : mnColor(0) {} - explicit Color( sal_uInt32 nVal ) : mnColor(nVal) {} - Color( sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue ) : - mnColor( ((sal_uInt32)nRed << 16) | ((sal_uInt32)nGreen << 8) | nBlue ) - {} - - void setRed( sal_uInt8 nRed ) { mnColor &= ~0x00FF0000UL; mnColor |= (sal_uInt32)nRed << 16; } - void setGreen( sal_uInt8 nGreen ) { mnColor &= ~0x0000FF00UL; mnColor |= (sal_uInt32)nGreen << 8; } - void setBlue( sal_uInt8 nBlue ) { mnColor &= ~0x000000FFUL; mnColor |= nBlue; } - - void setGrey( sal_uInt8 nGreyVal ) { mnColor = (sal_uInt32)nGreyVal << 16 | (sal_uInt32)nGreyVal << 8 | nGreyVal; } - - sal_uInt8 getRed() const { return 0xFF & (sal_uInt8)(mnColor >> 16); } - sal_uInt8 getGreen() const { return 0xFF & (sal_uInt8)(mnColor >> 8); } - sal_uInt8 getBlue() const { return 0xFF & (sal_uInt8)mnColor; } - - sal_uInt8 getGreyscale() const { return (sal_uInt8)((getBlue()*28UL + - getGreen()*151 + - getRed()*77) / 256); } - - sal_uInt32 toInt32() const { return mnColor; } - - bool operator!() const { return mnColor == 0; } - Color operator&( sal_uInt32 nMask ) const { return Color(mnColor & nMask); } - Color operator^( Color col ) const { return Color(col.getRed()^getRed(), - col.getGreen()^getGreen(), - col.getBlue()^getBlue()); } - Color operator-( Color col ) const { return Color((sal_uInt8)abs((int)getRed()-col.getRed()), - (sal_uInt8)abs((int)getGreen()-col.getGreen()), - (sal_uInt8)abs((int)getBlue()-col.getBlue())); } - Color operator+( Color col ) const { return Color(getRed()+col.getRed(), - getGreen()+col.getGreen(), - getBlue()+col.getBlue()); } - Color operator*( Color col ) const { return Color((sal_uInt8)((sal_uInt32)col.getRed()*getRed()/SAL_MAX_UINT8), - (sal_uInt8)((sal_uInt32)col.getGreen()*getGreen()/SAL_MAX_UINT8), - (sal_uInt8)((sal_uInt32)col.getBlue()*getBlue()/SAL_MAX_UINT8)); } - Color operator*( sal_uInt8 n ) const { return Color((sal_uInt8)((sal_uInt32)n*getRed()/SAL_MAX_UINT8), - (sal_uInt8)((sal_uInt32)n*getGreen()/SAL_MAX_UINT8), - (sal_uInt8)((sal_uInt32)n*getBlue()/SAL_MAX_UINT8)); } - Color operator*( double n ) const { return Color((sal_uInt8)(n*getRed()+.5), - (sal_uInt8)(n*getGreen()+.5), - (sal_uInt8)(n*getBlue()+.5)); } - bool operator==( const Color& rhs ) const { return (getRed()==rhs.getRed() && - getGreen()==rhs.getGreen() && - getBlue()==rhs.getBlue()); } - bool operator!=( const Color& rhs ) const { return !(*this==rhs); } - double magnitude() const { return sqrt((double)getRed()*getRed() - + getGreen()*getGreen() - + getBlue()*getBlue()); } -}; - -} // namespace basebmp - -#endif /* INCLUDED_BASEBMP_COLOR_HXX */ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/basebmp/scanlineformats.hxx b/include/basebmp/scanlineformats.hxx deleted file mode 100644 index efdc43fc533f..000000000000 --- a/include/basebmp/scanlineformats.hxx +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_BASEBMP_SCANLINEFORMATS_HXX -#define INCLUDED_BASEBMP_SCANLINEFORMATS_HXX - -#include <sal/config.h> - -/* Definition of Scanline formats */ - -namespace basebmp { - -enum class Format -{ - NONE, - OneBitMsbGrey, - OneBitLsbGrey, - OneBitMsbPal, - OneBitLsbPal, - FourBitMsbGrey, - FourBitLsbGrey, - FourBitMsbPal, - FourBitLsbPal, - EightBitPal, - EightBitGrey, - SixteenBitLsbTcMask, - SixteenBitMsbTcMask, - TwentyFourBitTcMask, - // The order of the channels code letters indicates the order of the - // channel bytes in memory - ThirtyTwoBitTcMaskBGRA, - ThirtyTwoBitTcMaskARGB, - ThirtyTwoBitTcMaskABGR, - ThirtyTwoBitTcMaskRGBA, - LAST = ThirtyTwoBitTcMaskRGBA -}; - -const char *formatName(Format nScanlineFormat); - -} - -#endif /* INCLUDED_BASEBMP_SCANLINEFORMATS_HXX */ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox index f6400893b45b..99fdfd567fe8 100644 --- a/include/sal/log-areas.dox +++ b/include/sal/log-areas.dox @@ -35,10 +35,6 @@ certain functionality. @li @c basctl.basicide -@section basebmp - -@li @c basebmp.bitmapdevice - @section basic @li @c basic @@ -521,7 +517,6 @@ certain functionality. @section other @li @c accessibility -@li @c basebmp @li @c basegfx @li @c binaryurp @li @c configmgr |