summaryrefslogtreecommitdiff
path: root/NxWidgets/libnxwidgets/src/crlepalettebitmap.cxx
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-04-28 17:36:53 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-04-28 17:36:53 +0000
commitfbfd97c209f99cf1a9e8190ba835c1b3bef64c2a (patch)
treeab42679f8868bdeaa101f569dab7500e2206ddf7 /NxWidgets/libnxwidgets/src/crlepalettebitmap.cxx
parentdd5155bc0f4765ad35cb485fb4eb9930ae365a7d (diff)
downloadnuttx-fbfd97c209f99cf1a9e8190ba835c1b3bef64c2a.tar.gz
nuttx-fbfd97c209f99cf1a9e8190ba835c1b3bef64c2a.tar.bz2
nuttx-fbfd97c209f99cf1a9e8190ba835c1b3bef64c2a.zip
A few pieces of what may become an NX window manager
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4669 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'NxWidgets/libnxwidgets/src/crlepalettebitmap.cxx')
-rw-r--r--NxWidgets/libnxwidgets/src/crlepalettebitmap.cxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/NxWidgets/libnxwidgets/src/crlepalettebitmap.cxx b/NxWidgets/libnxwidgets/src/crlepalettebitmap.cxx
index 25e9473ed..79a614349 100644
--- a/NxWidgets/libnxwidgets/src/crlepalettebitmap.cxx
+++ b/NxWidgets/libnxwidgets/src/crlepalettebitmap.cxx
@@ -101,6 +101,7 @@ using namespace NXWidgets;
CRlePaletteBitmap::CRlePaletteBitmap(const struct SRlePaletteBitmap *bitmap)
{
m_bitmap = bitmap;
+ m_lut = bitmap->lut[0];
startOfImage();
}
@@ -162,7 +163,19 @@ const nxgl_coord_t CRlePaletteBitmap::getStride(void) const
}
/**
- * Get one row from the bit map image.
+ * Use the colors associated with a selected image.
+ *
+ * @param selected. true: Use colors for a selected widget,
+ * false: Use normal (default) colors.
+ */
+
+void CRlePaletteBitmap::setSelected(bool selected)
+{
+ m_lut = m_bitmap->lut[selected ? 1 : 0];
+}
+
+/**
+ * Get one row from the bit map image using the selected LUT.
*
* @param x The offset into the row to get
* @param y The row number to get
@@ -337,7 +350,7 @@ void CRlePaletteBitmap::copyColor(nxgl_coord_t npixels, FAR void *data)
{
// Right now, only a single pixel depth is supported
- nxwidget_pixel_t *nxlut = (nxwidget_pixel_t *)m_bitmap->lut;
+ nxwidget_pixel_t *nxlut = (nxwidget_pixel_t *)m_lut;
nxwidget_pixel_t color = nxlut[m_rle->lookup];
// Copy the requested pixels