summaryrefslogtreecommitdiff
path: root/basebmp/inc/basebmp/paletteimageaccessor.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'basebmp/inc/basebmp/paletteimageaccessor.hxx')
-rw-r--r--basebmp/inc/basebmp/paletteimageaccessor.hxx34
1 files changed, 29 insertions, 5 deletions
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 */