summaryrefslogtreecommitdiff
path: root/basebmp/inc/basebmp
diff options
context:
space:
mode:
Diffstat (limited to 'basebmp/inc/basebmp')
-rw-r--r--basebmp/inc/basebmp/accessor.hxx7
-rw-r--r--basebmp/inc/basebmp/accessoradapters.hxx22
-rw-r--r--basebmp/inc/basebmp/bitmapdevice.hxx71
-rw-r--r--basebmp/inc/basebmp/clippedlinerenderer.hxx6
-rw-r--r--basebmp/inc/basebmp/packedpixeliterator.hxx102
-rw-r--r--basebmp/inc/basebmp/paletteimageaccessor.hxx34
-rw-r--r--basebmp/inc/basebmp/pixeliterator.hxx8
-rw-r--r--basebmp/inc/basebmp/scanlineformats.hxx24
8 files changed, 163 insertions, 111 deletions
diff --git a/basebmp/inc/basebmp/accessor.hxx b/basebmp/inc/basebmp/accessor.hxx
index c1cd068724f9..a21edd8280ec 100644
--- a/basebmp/inc/basebmp/accessor.hxx
+++ b/basebmp/inc/basebmp/accessor.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: accessor.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: thb $ $Date: 2006-05-31 10:12:11 $
+ * last change: $Author: thb $ $Date: 2006-06-02 08:36:13 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -36,6 +36,8 @@
#ifndef INCLUDED_BASEBMP_ACCESSOR_HXX
#define INCLUDED_BASEBMP_ACCESSOR_HXX
+#include <vigra/numerictraits.hxx>
+
namespace basebmp
{
@@ -43,7 +45,6 @@ template<typename ValueType> class StandardAccessor
{
public:
typedef ValueType value_type;
- typedef ValueType data_type;
template< class Iterator >
value_type operator()(Iterator const& i) const { return i.get(); }
diff --git a/basebmp/inc/basebmp/accessoradapters.hxx b/basebmp/inc/basebmp/accessoradapters.hxx
index 30d096005e8b..2c2d5d8f3753 100644
--- a/basebmp/inc/basebmp/accessoradapters.hxx
+++ b/basebmp/inc/basebmp/accessoradapters.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: accessoradapters.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: thb $ $Date: 2006-05-31 10:12:11 $
+ * last change: $Author: thb $ $Date: 2006-06-02 08:36:14 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -36,9 +36,9 @@
#ifndef INCLUDED_BASEBMP_ACCESSORADAPTERS_HXX
#define INCLUDED_BASEBMP_ACCESSORADAPTERS_HXX
-#include "metafunctions.hxx"
-#include "packedpixeliterator.hxx"
-#include "paletteimageaccessor.hxx"
+#include <basebmp/metafunctions.hxx>
+#include <basebmp/packedpixeliterator.hxx>
+#include <basebmp/paletteimageaccessor.hxx>
namespace basebmp
{
@@ -230,16 +230,14 @@ template< class WrappedAccessor,
class Iterator > struct maskedAccessor< WrappedAccessor,
MaskAccessor,
Iterator,
- PackedPixelIterator< typename MaskAccessor::data_type,
- typename MaskAccessor::value_type,
+ PackedPixelIterator< typename MaskAccessor::value_type,
1,
true > >
{
typedef BinaryInputAccessorAdapter< WrappedAccessor,
MaskAccessor,
Iterator,
- PackedPixelIterator< typename MaskAccessor::data_type,
- typename MaskAccessor::value_type,
+ PackedPixelIterator< typename MaskAccessor::value_type,
1,
true >,
FastMaskFunctor< typename WrappedAccessor::value_type > >
@@ -250,16 +248,14 @@ template< class WrappedAccessor,
class Iterator > struct maskedAccessor< WrappedAccessor,
MaskAccessor,
Iterator,
- PackedPixelIterator< typename MaskAccessor::data_type,
- typename MaskAccessor::value_type,
+ PackedPixelIterator< typename MaskAccessor::value_type,
1,
false > >
{
typedef BinaryInputAccessorAdapter< WrappedAccessor,
MaskAccessor,
Iterator,
- PackedPixelIterator< typename MaskAccessor::data_type,
- typename MaskAccessor::value_type,
+ PackedPixelIterator< typename MaskAccessor::value_type,
1,
false >,
FastMaskFunctor< typename WrappedAccessor::value_type > >
diff --git a/basebmp/inc/basebmp/bitmapdevice.hxx b/basebmp/inc/basebmp/bitmapdevice.hxx
index dac7588b642e..4e5d106ae3bb 100644
--- a/basebmp/inc/basebmp/bitmapdevice.hxx
+++ b/basebmp/inc/basebmp/bitmapdevice.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: bitmapdevice.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: thb $ $Date: 2006-05-31 10:12:11 $
+ * last change: $Author: thb $ $Date: 2006-06-02 08:36:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -42,13 +42,14 @@
#include <sal/types.h>
#endif
#ifndef INCLUDED_BASEBMP_DRAWMODES_HXX
-#include "drawmodes.hxx"
+#include <basebmp/drawmodes.hxx>
#endif
#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
+#include <boost/shared_array.hpp>
#include <boost/noncopyable.hpp>
-
+#include <vector>
/* What to do first:
@@ -79,19 +80,20 @@ namespace basebmp
// Temporary. Use like the tools color object
class Color;
-typedef boost::shared_ptr< class BitmapDevice > BitmapDeviceSharedPtr;
-typedef boost::shared_ptr< sal_uInt8 > RawMemorySharedPtr;
+typedef boost::shared_ptr< class BitmapDevice > BitmapDeviceSharedPtr;
+typedef boost::shared_array< sal_uInt8 > RawMemorySharedArray;
+typedef boost::shared_ptr< const std::vector<Color> > PaletteMemorySharedVector;
struct ImplBitmapDevice;
/** Definition of BitmapDevice interface
- Use createBitmapDevice() factory method to create one instance.
+ Use the createBitmapDevice() factory method to create one instance.
Implementation note: the clip mask and bitmap parameter instances
of BitmapDevice that are passed to individual BitmapDevice
- instances work best with 1 bit MSB masks for the clip and a format
- matching that of the target BitmapDevice for the other
+ instances work best with 1 bit TC MSB masks for the clip and a
+ format matching that of the target BitmapDevice for the other
parameters. Everything else is accepted, but potentially slow.
*/
class BitmapDevice : private boost::noncopyable
@@ -121,17 +123,20 @@ public:
/** Get pointer to frame buffer
*/
- RawMemorySharedPtr getBuffer() const;
+ RawMemorySharedArray getBuffer() const;
/** Get pointer to palette
- @return pointer to array of getPaletteEntryCount() Color
- entries, if this is a palette format. If not, NULL is
- returned.
+ The returned pointer is const on purpose, since the
+ BitmapDevice might internally cache lookup information.
+
+ @return shared pointer to vector of Color entries.
*/
- const Color* getPalette() const;
+ PaletteMemorySharedVector getPalette() const;
+
+ /** Query number of palette entries.
- /** Query number of palette entries
+ This is just a frontend for getPalette->size()
*/
const sal_Int32 getPaletteEntryCount() const;
@@ -178,6 +183,14 @@ public:
*/
Color getPixel( const basegfx::B2IPoint& rPt );
+ /** Get underlying pixel data value at given position
+
+ This method returns the raw pixel data. In the case of
+ paletted bitmaps, this is the palette index, not the final
+ color value.
+ */
+ sal_uInt32 getPixelData( const basegfx::B2IPoint& rPt );
+
/** Draw a line
@param rPt1
@@ -276,11 +289,12 @@ public:
const BitmapDeviceSharedPtr& rClip );
protected:
- BitmapDevice( const basegfx::B2IVector& rSize,
- bool bTopDown,
- sal_Int32 nScanlineFormat,
- sal_Int32 nScanlineStride,
- const RawMemorySharedPtr& rMem );
+ BitmapDevice( const basegfx::B2IVector& rSize,
+ bool bTopDown,
+ sal_Int32 nScanlineFormat,
+ sal_Int32 nScanlineStride,
+ const RawMemorySharedArray& rMem,
+ const PaletteMemorySharedVector& rPalette );
virtual ~BitmapDevice();
@@ -289,9 +303,6 @@ private:
virtual bool isCompatibleClipMask( const BitmapDeviceSharedPtr& bmp ) const = 0;
virtual bool isCompatibleAlphaMask( const BitmapDeviceSharedPtr& bmp ) const = 0;
- virtual const Color* getPalette_i() const = 0;
- virtual const sal_Int32 getPaletteEntryCount_i() const = 0;
-
virtual void clear_i( Color fillColor ) = 0;
virtual void setPixel_i( const basegfx::B2IPoint& rPt,
@@ -304,6 +315,8 @@ private:
virtual Color getPixel_i( const basegfx::B2IPoint& rPt ) = 0;
+ virtual sal_uInt32 getPixelData_i( const basegfx::B2IPoint& rPt ) = 0;
+
virtual void drawLine_i( const basegfx::B2DPoint& rPt1,
const basegfx::B2DPoint& rPt2,
Color lineColor,
@@ -376,6 +389,18 @@ BitmapDeviceSharedPtr createBitmapDevice( const basegfx::B2IVector& rSize,
bool bTopDown,
sal_Int32 nScanlineFormat );
+/** Factory method to create a BitmapDevice for given scanline format
+ from the given piece of raw memory
+
+ Note: the provided memory must have sufficient size, to store the
+ image of the specified area and format.
+ */
+BitmapDeviceSharedPtr createBitmapDevice( const basegfx::B2IVector& rSize,
+ bool bTopDown,
+ sal_Int32 nScanlineFormat,
+ const RawMemorySharedArray& rMem,
+ const PaletteMemorySharedVector& rPalette );
+
}
#endif /* INCLUDED_BASEBMP_BITMAPDEVICE_HXX */
diff --git a/basebmp/inc/basebmp/clippedlinerenderer.hxx b/basebmp/inc/basebmp/clippedlinerenderer.hxx
index 69b46e1ef80c..0c484a08ad3f 100644
--- a/basebmp/inc/basebmp/clippedlinerenderer.hxx
+++ b/basebmp/inc/basebmp/clippedlinerenderer.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: clippedlinerenderer.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: thb $ $Date: 2006-05-31 10:12:11 $
+ * last change: $Author: thb $ $Date: 2006-06-02 08:36:14 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -36,7 +36,9 @@
#ifndef INCLUDED_BASEBMP_CLIPPEDLINERENDERER_HXX
#define INCLUDED_BASEBMP_CLIPPEDLINERENDERER_HXX
+#ifndef _BGFX_TOOLS_RECTCLIPTOOLS_HXX
#include <basegfx/tools/rectcliptools.hxx>
+#endif
namespace basebmp
{
diff --git a/basebmp/inc/basebmp/packedpixeliterator.hxx b/basebmp/inc/basebmp/packedpixeliterator.hxx
index bb758f90b27d..96833e1ef382 100644
--- a/basebmp/inc/basebmp/packedpixeliterator.hxx
+++ b/basebmp/inc/basebmp/packedpixeliterator.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: packedpixeliterator.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: thb $ $Date: 2006-05-31 10:12:12 $
+ * last change: $Author: thb $ $Date: 2006-06-02 08:36:14 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -36,8 +36,8 @@
#ifndef INCLUDED_BASEBMP_PACKEDPIXELITERATOR_HXX
#define INCLUDED_BASEBMP_PACKEDPIXELITERATOR_HXX
-#include "metafunctions.hxx"
-#include "stridedarrayiterator.hxx"
+#include <basebmp/metafunctions.hxx>
+#include <basebmp/stridedarrayiterator.hxx>
#include <boost/static_assert.hpp>
#include <vigra/metaprogramming.hxx>
@@ -47,14 +47,14 @@ namespace basebmp
{
/// Get bitmask for data at given intra-word position, for given bit depth
-template< typename data_type, int bits_per_pixel, bool MsbFirst, typename difference_type > inline data_type get_mask( difference_type d )
+template< typename value_type, int bits_per_pixel, bool MsbFirst, typename difference_type > inline value_type get_mask( difference_type d )
{
BOOST_STATIC_ASSERT(bits_per_pixel > 0);
- BOOST_STATIC_ASSERT(sizeof(data_type)*8 % bits_per_pixel == 0);
- BOOST_STATIC_ASSERT(sizeof(data_type)*8 / bits_per_pixel > 1);
- BOOST_STATIC_ASSERT(vigra::TypeTraits<data_type>::isPOD::asBool);
+ BOOST_STATIC_ASSERT(sizeof(value_type)*8 % bits_per_pixel == 0);
+ BOOST_STATIC_ASSERT(sizeof(value_type)*8 / bits_per_pixel > 1);
+ BOOST_STATIC_ASSERT(vigra::TypeTraits<value_type>::isPOD::asBool);
- const unsigned int nIntraWordPositions( sizeof(data_type)*8 / bits_per_pixel );
+ const unsigned int nIntraWordPositions( sizeof(value_type)*8 / bits_per_pixel );
// create bits_per_pixel 1s shift to intra-word position
return ((~(~0 << bits_per_pixel)) << bits_per_pixel*(MsbFirst ?
@@ -69,26 +69,24 @@ template< int num_intraword_positions, int bits_per_pixel, bool MsbFirst, typena
remainder);
}
-template< typename Datatype,
- typename Valuetype,
+template< typename Valuetype,
int bits_per_pixel,
bool MsbFirst > class PackedPixelColumnIterator
{
public:
// no reference, no index_reference type here
- typedef Datatype data_type;
typedef Valuetype value_type;
typedef int difference_type;
typedef image_traverser_tag iterator_category;
- typedef typename remove_const<data_type>::type mask_type;
- typedef data_type* pointer;
- typedef StridedArrayIterator< data_type > MoveY;
+ typedef typename remove_const<value_type>::type mask_type;
+ typedef value_type* pointer;
+ typedef StridedArrayIterator< value_type > MoveY;
enum {
- /** The number of pixel within a single data_type value
+ /** The number of pixel within a single value_type value
*/
- num_intraword_positions=sizeof(data_type)*8/bits_per_pixel,
+ num_intraword_positions=sizeof(value_type)*8/bits_per_pixel,
/** Bit mask for one pixel (least significant bits)
*/
bit_mask=~(~0 << bits_per_pixel)
@@ -122,13 +120,13 @@ private:
public:
PackedPixelColumnIterator() :
y(0),
- mask_( get_mask<data_type, bits_per_pixel, MsbFirst, difference_type>(0) ),
+ mask_( get_mask<value_type, bits_per_pixel, MsbFirst, difference_type>(0) ),
shift_( get_shift<num_intraword_positions, bits_per_pixel, MsbFirst, difference_type>(0) )
{}
PackedPixelColumnIterator( const MoveY& base, difference_type remainder ) :
y(base),
- mask_( get_mask<data_type, bits_per_pixel, MsbFirst>(remainder) ),
+ mask_( get_mask<value_type, bits_per_pixel, MsbFirst>(remainder) ),
shift_( get_shift<num_intraword_positions, bits_per_pixel, MsbFirst>(remainder) )
{}
@@ -221,14 +219,14 @@ public:
value_type get() const
{
- // TODO(Q3): use traits to get unsigned type for data_type (if
+ // TODO(Q3): use traits to get unsigned type for value_type (if
// not already)
return static_cast<unsigned int>(*y() & mask_) >> shift_;
}
value_type get(difference_type d) const
{
- // TODO(Q3): use traits to get unsigned type for data_type (if
+ // TODO(Q3): use traits to get unsigned type for value_type (if
// not already)
return static_cast<unsigned int>(*y(d) & mask_) >> shift_;
}
@@ -246,25 +244,23 @@ public:
}
};
-template< typename Datatype,
- typename Valuetype,
+template< typename Valuetype,
int bits_per_pixel,
bool MsbFirst > class PackedPixelRowIterator
{
public:
// no reference, no index_reference type here
- typedef Datatype data_type;
typedef Valuetype value_type;
typedef int difference_type;
typedef image_traverser_tag iterator_category;
- typedef typename remove_const<data_type>::type mask_type;
- typedef data_type* pointer;
+ typedef typename remove_const<value_type>::type mask_type;
+ typedef value_type* pointer;
enum {
- /** The number of pixel within a single data_type value
+ /** The number of pixel within a single value_type value
*/
- num_intraword_positions=sizeof(data_type)*8/bits_per_pixel,
+ num_intraword_positions=sizeof(value_type)*8/bits_per_pixel,
/** Bit mask for one pixel (least significant bits)
*/
bit_mask=~(~0 << bits_per_pixel)
@@ -277,7 +273,7 @@ private:
void update_mask()
{
- mask_ = get_mask<data_type, bits_per_pixel, MsbFirst>(remainder_);
+ mask_ = get_mask<value_type, bits_per_pixel, MsbFirst>(remainder_);
}
void inc()
@@ -290,7 +286,7 @@ private:
const mask_type shifted_mask(
MsbFirst ?
- // TODO(Q3): use traits to get unsigned type for data_type
+ // TODO(Q3): use traits to get unsigned type for value_type
// (if not already)
static_cast<unsigned int>(mask_) >> bits_per_pixel :
mask_ << bits_per_pixel );
@@ -321,7 +317,7 @@ private:
const mask_type shifted_mask(
MsbFirst ?
mask_ << bits_per_pixel :
- // TODO(Q3): use traits to get unsigned type for data_type
+ // TODO(Q3): use traits to get unsigned type for value_type
// (if not already)
static_cast<unsigned int>(mask_) >> bits_per_pixel );
@@ -346,7 +342,7 @@ private:
public:
PackedPixelRowIterator() :
data_(0),
- mask_( get_mask<data_type, bits_per_pixel, MsbFirst, difference_type>(0) ),
+ mask_( get_mask<value_type, bits_per_pixel, MsbFirst, difference_type>(0) ),
remainder_(0)
{}
@@ -466,7 +462,7 @@ public:
value_type get() const
{
- // TODO(Q3): use traits to get unsigned type for data_type (if
+ // TODO(Q3): use traits to get unsigned type for value_type (if
// not already)
return static_cast<unsigned int>(*data_ & mask_) >>
get_shift<num_intraword_positions, bits_per_pixel, MsbFirst>(remainder_);
@@ -496,34 +492,36 @@ public:
}
};
-template< typename Datatype,
- typename Valuetype,
+/** 2D image iterator for packed pixel formats
+
+ This iterator can be used for image formats that pack more than
+ one pixel into an machine data type (like one bit per pixel, eight
+ of which packed into one char)
+ */
+template< typename Valuetype,
int bits_per_pixel,
bool MsbFirst > class PackedPixelIterator
{
public:
// no reference, no index_reference type here
- typedef Datatype data_type;
typedef Valuetype value_type;
typedef vigra::Diff2D difference_type;
typedef image_traverser_tag iterator_category;
- typedef PackedPixelRowIterator<data_type,
- value_type,
+ typedef PackedPixelRowIterator<value_type,
bits_per_pixel,
MsbFirst> row_iterator;
- typedef PackedPixelColumnIterator<data_type,
- value_type,
+ typedef PackedPixelColumnIterator<value_type,
bits_per_pixel,
MsbFirst> column_iterator;
- typedef data_type* pointer;
+ typedef value_type* pointer;
typedef int MoveX;
- typedef StridedArrayIterator< data_type > MoveY;
+ typedef StridedArrayIterator< value_type > MoveY;
enum {
- /** The number of pixel within a single data_type value
+ /** The number of pixel within a single value_type value
*/
- num_intraword_positions=sizeof(data_type)*8/bits_per_pixel,
+ num_intraword_positions=sizeof(value_type)*8/bits_per_pixel,
/** Bit mask for one pixel (least significant bits)
*/
bit_mask=~(~0 << bits_per_pixel)
@@ -621,17 +619,17 @@ public:
{
const int remainder( x % num_intraword_positions );
- // TODO(Q3): use traits to get unsigned type for data_type (if
+ // TODO(Q3): use traits to get unsigned type for value_type (if
// not already)
value_type nTmp0( *current() );
unsigned int nTmp1(static_cast<unsigned int>(*current() &
- get_mask<data_type, bits_per_pixel, MsbFirst>(remainder)));
+ get_mask<value_type, bits_per_pixel, MsbFirst>(remainder)));
unsigned int nTmp2( (static_cast<unsigned int>(*current() &
- get_mask<data_type, bits_per_pixel, MsbFirst>(remainder))
+ get_mask<value_type, bits_per_pixel, MsbFirst>(remainder))
>> get_shift<num_intraword_positions, bits_per_pixel, MsbFirst>(remainder)));
return (static_cast<unsigned int>(*current() &
- get_mask<data_type, bits_per_pixel, MsbFirst>(remainder))
+ get_mask<value_type, bits_per_pixel, MsbFirst>(remainder))
>> get_shift<num_intraword_positions, bits_per_pixel, MsbFirst>(remainder));
}
@@ -639,17 +637,17 @@ public:
{
const int remainder( x(d.x) % num_intraword_positions );
- // TODO(Q3): use traits to get unsigned type for data_type (if
+ // TODO(Q3): use traits to get unsigned type for value_type (if
// not already)
return (static_cast<unsigned int>(*current(d.x,d.y) &
- get_mask<data_type, bits_per_pixel, MsbFirst>(remainder))
+ get_mask<value_type, bits_per_pixel, MsbFirst>(remainder))
>> get_shift<num_intraword_positions, bits_per_pixel, MsbFirst>(remainder));
}
void set( value_type v ) const
{
const int remainder( x % num_intraword_positions );
- const int mask( get_mask<data_type, bits_per_pixel, MsbFirst>(remainder) );
+ const int mask( get_mask<value_type, bits_per_pixel, MsbFirst>(remainder) );
const value_type pixel_value(
(v <<
get_shift<num_intraword_positions, bits_per_pixel, MsbFirst>(remainder))
@@ -661,7 +659,7 @@ public:
void set( value_type v, difference_type const & d ) const
{
const int remainder( (x + d.x) % num_intraword_positions );
- const int mask( get_mask<data_type, bits_per_pixel, MsbFirst>(remainder) );
+ const int mask( get_mask<value_type, bits_per_pixel, MsbFirst>(remainder) );
const value_type pixel_value(
(v <<
get_shift<num_intraword_positions, bits_per_pixel, MsbFirst>(remainder))
diff --git a/basebmp/inc/basebmp/paletteimageaccessor.hxx b/basebmp/inc/basebmp/paletteimageaccessor.hxx
index c70dc5606cd0..66d3ee6b30a6 100644
--- a/basebmp/inc/basebmp/paletteimageaccessor.hxx
+++ b/basebmp/inc/basebmp/paletteimageaccessor.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: paletteimageaccessor.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: thb $ $Date: 2006-05-31 10:12:12 $
+ * last change: $Author: thb $ $Date: 2006-06-02 08:36:14 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -36,7 +36,8 @@
#ifndef INCLUDED_BASEBMP_PALETTEIMAGEACCESSOR_HXX
#define INCLUDED_BASEBMP_PALETTEIMAGEACCESSOR_HXX
-#include "metafunctions.hxx"
+#include <basebmp/metafunctions.hxx>
+#include <basebmp/accessor.hxx>
#include <vigra/numerictraits.hxx>
#include <vigra/mathutil.hxx>
@@ -103,9 +104,9 @@ public:
{}
PaletteImageAccessor( const value_type* pPalette,
- data_type entries ) :
+ data_type numEntries ) :
palette(pPalette),
- num_entries(entries)
+ num_entries(numEntries)
{}
template< class Iterator >
@@ -136,6 +137,29 @@ public:
}
};
+
+/// Retrieve raw pixel data accessor for given Accessor type
+template< class Accessor > struct rawAccessor
+{
+ // generic case: both accessors are the same
+ typedef Accessor type;
+};
+
+template< typename ValueType > struct RawAccessor : public StandardAccessor< ValueType >
+{
+ RawAccessor() {}
+ template< typename DataType > explicit RawAccessor(
+ const PaletteImageAccessor< ValueType, DataType >& a ) {}
+};
+
+// specialization for PaletteImageAccessor, to provide the
+// corresponding StandardAccessor to the pixel index values
+template< typename ValueType, typename DataType >
+struct rawAccessor< PaletteImageAccessor< ValueType, DataType > >
+{
+ typedef RawAccessor< ValueType > type;
+};
+
} // namespace basebmp
#endif /* INCLUDED_BASEBMP_PALETTEIMAGEACCESSOR_HXX */
diff --git a/basebmp/inc/basebmp/pixeliterator.hxx b/basebmp/inc/basebmp/pixeliterator.hxx
index b90dc05d4d03..c3b2bf01ec03 100644
--- a/basebmp/inc/basebmp/pixeliterator.hxx
+++ b/basebmp/inc/basebmp/pixeliterator.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: pixeliterator.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: thb $ $Date: 2006-05-31 10:12:12 $
+ * last change: $Author: thb $ $Date: 2006-06-02 08:36:14 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -36,8 +36,8 @@
#ifndef INCLUDED_BASEBMP_PIXELITERATOR_HXX
#define INCLUDED_BASEBMP_PIXELITERATOR_HXX
-#include "metafunctions.hxx"
-#include "stridedarrayiterator.hxx"
+#include <basebmp/metafunctions.hxx>
+#include <basebmp/stridedarrayiterator.hxx>
#include <boost/static_assert.hpp>
#include <vigra/metaprogramming.hxx>
diff --git a/basebmp/inc/basebmp/scanlineformats.hxx b/basebmp/inc/basebmp/scanlineformats.hxx
index 70c5f5007020..db7befdedc2d 100644
--- a/basebmp/inc/basebmp/scanlineformats.hxx
+++ b/basebmp/inc/basebmp/scanlineformats.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: scanlineformats.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: thb $ $Date: 2006-05-31 10:12:12 $
+ * last change: $Author: thb $ $Date: 2006-06-02 08:36:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,17 +62,23 @@
#ifndef INCLUDED_BASEBMP_SCANLINEFORMATS_HXX
#define INCLUDED_BASEBMP_SCANLINEFORMATS_HXX
+#ifndef _SAL_TYPES_H_
+#include <sal/types.h>
+#endif
+
/* Definition of Scanline formats */
namespace basebmp { namespace Format
{
- static const sal_Int32 ONE_BIT_MSB_PAL = (sal_Int32)0x01;
- static const sal_Int32 ONE_BIT_LSB_PAL = (sal_Int32)0x02;
- static const sal_Int32 TWO_BIT_MSB_PAL = (sal_Int32)0x03;
- static const sal_Int32 TWO_BIT_LSB_PAL = (sal_Int32)0x04;
- static const sal_Int32 FOUR_BIT_MSB_PAL = (sal_Int32)0x05;
- static const sal_Int32 FOUR_BIT_LSB_PAL = (sal_Int32)0x06;
- static const sal_Int32 EIGHT_BIT_PAL = (sal_Int32)0x07;
+ static const sal_Int32 ONE_BIT_MSB_TC_MASK = (sal_Int32)0x01;
+ static const sal_Int32 ONE_BIT_LSB_TC_MASK = (sal_Int32)0x02;
+ static const sal_Int32 ONE_BIT_MSB_PAL = (sal_Int32)0x03;
+ static const sal_Int32 ONE_BIT_LSB_PAL = (sal_Int32)0x04;
+ static const sal_Int32 TWO_BIT_MSB_PAL = (sal_Int32)0x05;
+ static const sal_Int32 TWO_BIT_LSB_PAL = (sal_Int32)0x06;
+ static const sal_Int32 FOUR_BIT_MSB_PAL = (sal_Int32)0x07;
+ static const sal_Int32 FOUR_BIT_LSB_PAL = (sal_Int32)0x08;
+ static const sal_Int32 EIGHT_BIT_PAL = (sal_Int32)0x09;
static const sal_Int32 EIGHT_BIT_TC_MASK = (sal_Int32)0x0A;
static const sal_Int32 SIXTEEN_BIT_TC_MASK = (sal_Int32)0x0B;
static const sal_Int32 TWENTYFOUR_BIT_TC_MASK = (sal_Int32)0x0C;