From f92f9d7fec30cd8ea592df33c7126b9531eca834 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 17 Oct 2013 15:19:26 -0600 Subject: Minor tweaks to debug output; started renaming some icons to include size in the name; SAMA5 NxWM config needs libm --- NxWidgets/Kconfig | 6 +- NxWidgets/nxwm/Makefile | 2 +- NxWidgets/nxwm/images/calculator.png | Bin 263 -> 0 bytes NxWidgets/nxwm/images/calculator24x25.png | Bin 0 -> 263 bytes NxWidgets/nxwm/images/calibration.png | Bin 415 -> 0 bytes NxWidgets/nxwm/images/calibration24x21.png | Bin 0 -> 415 bytes NxWidgets/nxwm/images/cmd.png | Bin 264 -> 0 bytes NxWidgets/nxwm/images/cmd25x22.png | Bin 0 -> 264 bytes NxWidgets/nxwm/images/minimize.png | Bin 284 -> 0 bytes NxWidgets/nxwm/images/minimize21x21.png | Bin 0 -> 284 bytes NxWidgets/nxwm/images/nxlogo.png | Bin 608 -> 0 bytes NxWidgets/nxwm/images/nxlogo25x25.png | Bin 0 -> 608 bytes NxWidgets/nxwm/images/play.png | Bin 233 -> 0 bytes NxWidgets/nxwm/images/play24x24.png | Bin 0 -> 233 bytes NxWidgets/nxwm/images/play48x48.png | Bin 0 -> 374 bytes NxWidgets/nxwm/images/start.png | Bin 719 -> 0 bytes NxWidgets/nxwm/images/start25x25.png | Bin 0 -> 719 bytes NxWidgets/nxwm/images/stop.png | Bin 381 -> 0 bytes NxWidgets/nxwm/images/stop21x21.png | Bin 0 -> 381 bytes NxWidgets/nxwm/include/nxwmconfig.hxx | 2 +- NxWidgets/nxwm/include/nxwmglyphs.hxx | 2 +- NxWidgets/nxwm/src/ccalibration.cxx | 33 ++-- NxWidgets/nxwm/src/ctouchscreen.cxx | 2 +- NxWidgets/nxwm/src/glyph_play.cxx | 258 ----------------------------- NxWidgets/nxwm/src/glyph_play24x24.cxx | 258 +++++++++++++++++++++++++++++ nuttx/configs/sama5d3x-ek/nxwm/defconfig | 2 +- 26 files changed, 288 insertions(+), 277 deletions(-) delete mode 100644 NxWidgets/nxwm/images/calculator.png create mode 100644 NxWidgets/nxwm/images/calculator24x25.png delete mode 100644 NxWidgets/nxwm/images/calibration.png create mode 100644 NxWidgets/nxwm/images/calibration24x21.png delete mode 100644 NxWidgets/nxwm/images/cmd.png create mode 100644 NxWidgets/nxwm/images/cmd25x22.png delete mode 100644 NxWidgets/nxwm/images/minimize.png create mode 100644 NxWidgets/nxwm/images/minimize21x21.png delete mode 100644 NxWidgets/nxwm/images/nxlogo.png create mode 100644 NxWidgets/nxwm/images/nxlogo25x25.png delete mode 100644 NxWidgets/nxwm/images/play.png create mode 100644 NxWidgets/nxwm/images/play24x24.png create mode 100644 NxWidgets/nxwm/images/play48x48.png delete mode 100644 NxWidgets/nxwm/images/start.png create mode 100644 NxWidgets/nxwm/images/start25x25.png delete mode 100644 NxWidgets/nxwm/images/stop.png create mode 100644 NxWidgets/nxwm/images/stop21x21.png delete mode 100644 NxWidgets/nxwm/src/glyph_play.cxx create mode 100644 NxWidgets/nxwm/src/glyph_play24x24.cxx diff --git a/NxWidgets/Kconfig b/NxWidgets/Kconfig index 7c7b0b8d4..ef512a5e5 100644 --- a/NxWidgets/Kconfig +++ b/NxWidgets/Kconfig @@ -567,15 +567,15 @@ config NXWM_CUSTOM_STARTWINDOW_ICON bool "Custom Start Window Icon" default n ---help--- - Select to override the default Start Window Icon: NxWM::g_playBitmap + Select to override the default Start Window Icon: NxWM::g_playBitmap24x24 if NXWM_CUSTOM_STARTWINDOW_ICON config NXWM_STARTWINDOW_ICON string "StartWindow Icon" - default "NxWM::g_playBitmap" + default "NxWM::g_playBitmap24x24" ---help--- - The glyph to use as the start window icon. Default: NxWM::g_playBitmap + The glyph to use as the start window icon. Default: NxWM::g_playBitmap24x24 endif # NXWM_CUSTOM_STARTWINDOW_ICON diff --git a/NxWidgets/nxwm/Makefile b/NxWidgets/nxwm/Makefile index f4d148316..6efb464cf 100644 --- a/NxWidgets/nxwm/Makefile +++ b/NxWidgets/nxwm/Makefile @@ -72,7 +72,7 @@ endif # Images CXXSRCS += glyph_calculator.cxx glyph_calibration.cxx glyph_cmd.cxx -CXXSRCS += glyph_minimize.cxx glyph_nsh.cxx glyph_play.cxx glyph_start.cxx +CXXSRCS += glyph_minimize.cxx glyph_nsh.cxx glyph_play24x24.cxx glyph_start.cxx CXXSRCS += glyph_stop.cxx ifeq ($(CONFIG_NXWM_MEDIAPLAYER),y) diff --git a/NxWidgets/nxwm/images/calculator.png b/NxWidgets/nxwm/images/calculator.png deleted file mode 100644 index fe3ad3e86..000000000 Binary files a/NxWidgets/nxwm/images/calculator.png and /dev/null differ diff --git a/NxWidgets/nxwm/images/calculator24x25.png b/NxWidgets/nxwm/images/calculator24x25.png new file mode 100644 index 000000000..fe3ad3e86 Binary files /dev/null and b/NxWidgets/nxwm/images/calculator24x25.png differ diff --git a/NxWidgets/nxwm/images/calibration.png b/NxWidgets/nxwm/images/calibration.png deleted file mode 100644 index 76a84127f..000000000 Binary files a/NxWidgets/nxwm/images/calibration.png and /dev/null differ diff --git a/NxWidgets/nxwm/images/calibration24x21.png b/NxWidgets/nxwm/images/calibration24x21.png new file mode 100644 index 000000000..76a84127f Binary files /dev/null and b/NxWidgets/nxwm/images/calibration24x21.png differ diff --git a/NxWidgets/nxwm/images/cmd.png b/NxWidgets/nxwm/images/cmd.png deleted file mode 100644 index 3e6cf667c..000000000 Binary files a/NxWidgets/nxwm/images/cmd.png and /dev/null differ diff --git a/NxWidgets/nxwm/images/cmd25x22.png b/NxWidgets/nxwm/images/cmd25x22.png new file mode 100644 index 000000000..3e6cf667c Binary files /dev/null and b/NxWidgets/nxwm/images/cmd25x22.png differ diff --git a/NxWidgets/nxwm/images/minimize.png b/NxWidgets/nxwm/images/minimize.png deleted file mode 100644 index 7080533dd..000000000 Binary files a/NxWidgets/nxwm/images/minimize.png and /dev/null differ diff --git a/NxWidgets/nxwm/images/minimize21x21.png b/NxWidgets/nxwm/images/minimize21x21.png new file mode 100644 index 000000000..7080533dd Binary files /dev/null and b/NxWidgets/nxwm/images/minimize21x21.png differ diff --git a/NxWidgets/nxwm/images/nxlogo.png b/NxWidgets/nxwm/images/nxlogo.png deleted file mode 100644 index 63ece46e5..000000000 Binary files a/NxWidgets/nxwm/images/nxlogo.png and /dev/null differ diff --git a/NxWidgets/nxwm/images/nxlogo25x25.png b/NxWidgets/nxwm/images/nxlogo25x25.png new file mode 100644 index 000000000..63ece46e5 Binary files /dev/null and b/NxWidgets/nxwm/images/nxlogo25x25.png differ diff --git a/NxWidgets/nxwm/images/play.png b/NxWidgets/nxwm/images/play.png deleted file mode 100644 index 02ff75414..000000000 Binary files a/NxWidgets/nxwm/images/play.png and /dev/null differ diff --git a/NxWidgets/nxwm/images/play24x24.png b/NxWidgets/nxwm/images/play24x24.png new file mode 100644 index 000000000..02ff75414 Binary files /dev/null and b/NxWidgets/nxwm/images/play24x24.png differ diff --git a/NxWidgets/nxwm/images/play48x48.png b/NxWidgets/nxwm/images/play48x48.png new file mode 100644 index 000000000..24dddd781 Binary files /dev/null and b/NxWidgets/nxwm/images/play48x48.png differ diff --git a/NxWidgets/nxwm/images/start.png b/NxWidgets/nxwm/images/start.png deleted file mode 100644 index 8cad18756..000000000 Binary files a/NxWidgets/nxwm/images/start.png and /dev/null differ diff --git a/NxWidgets/nxwm/images/start25x25.png b/NxWidgets/nxwm/images/start25x25.png new file mode 100644 index 000000000..8cad18756 Binary files /dev/null and b/NxWidgets/nxwm/images/start25x25.png differ diff --git a/NxWidgets/nxwm/images/stop.png b/NxWidgets/nxwm/images/stop.png deleted file mode 100644 index 365068b4a..000000000 Binary files a/NxWidgets/nxwm/images/stop.png and /dev/null differ diff --git a/NxWidgets/nxwm/images/stop21x21.png b/NxWidgets/nxwm/images/stop21x21.png new file mode 100644 index 000000000..365068b4a Binary files /dev/null and b/NxWidgets/nxwm/images/stop21x21.png differ diff --git a/NxWidgets/nxwm/include/nxwmconfig.hxx b/NxWidgets/nxwm/include/nxwmconfig.hxx index a10491d39..5b42e3a70 100644 --- a/NxWidgets/nxwm/include/nxwmconfig.hxx +++ b/NxWidgets/nxwm/include/nxwmconfig.hxx @@ -312,7 +312,7 @@ */ #ifndef CONFIG_NXWM_STARTWINDOW_ICON -# define CONFIG_NXWM_STARTWINDOW_ICON NxWM::g_playBitmap +# define CONFIG_NXWM_STARTWINDOW_ICON NxWM::g_playBitmap24x24 #endif /** diff --git a/NxWidgets/nxwm/include/nxwmglyphs.hxx b/NxWidgets/nxwm/include/nxwmglyphs.hxx index 5bcd4fb83..799ca61b6 100644 --- a/NxWidgets/nxwm/include/nxwmglyphs.hxx +++ b/NxWidgets/nxwm/include/nxwmglyphs.hxx @@ -70,7 +70,7 @@ namespace NxWM #endif extern const struct NXWidgets::SRlePaletteBitmap g_minimizeBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_nshBitmap; - extern const struct NXWidgets::SRlePaletteBitmap g_playBitmap; + extern const struct NXWidgets::SRlePaletteBitmap g_playBitmap24x24; extern const struct NXWidgets::SRlePaletteBitmap g_startBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_stopBitmap; } diff --git a/NxWidgets/nxwm/src/ccalibration.cxx b/NxWidgets/nxwm/src/ccalibration.cxx index 01bdf3b44..51b536db0 100644 --- a/NxWidgets/nxwm/src/ccalibration.cxx +++ b/NxWidgets/nxwm/src/ccalibration.cxx @@ -73,6 +73,17 @@ #define CALIBRATION_CIRCLE_RADIUS 16 #define CALIBRATION_LINE_THICKNESS 2 +/* We want debug output from some logic in this file if either input/touchscreen + * or graphics debug is enabled. + */ + +#ifndef CONFIG_DEBUG_INPUT +# undef idbg +# define idbg gdbg +# undef ivdbg +# define ivdbg gvdbg +#endif + /**************************************************************************** * Private Data ****************************************************************************/ @@ -341,7 +352,7 @@ void CCalibration::touchscreenInput(struct touch_sample_s &sample) m_touchPos.x = sample.point[0].x; m_touchPos.y = sample.point[0].y; - gvdbg("Touch id: %d flags: %02x x: %d y: %d h: %d w: %d pressure: %d\n", + ivdbg("Touch id: %d flags: %02x x: %d y: %d h: %d w: %d pressure: %d\n", sample.point[0].id, sample.point[0].flags, sample.point[0].x, sample.point[0].y, sample.point[0].h, sample.point[0].w, sample.point[0].pressure); @@ -379,7 +390,7 @@ void CCalibration::touchscreenInput(struct touch_sample_s &sample) { // Yes.. invoke the state machine. - gvdbg("State: %d Screen x: %d y: %d Touch x: %d y: %d\n", + ivdbg("State: %d Screen x: %d y: %d Touch x: %d y: %d\n", m_calphase, m_screenInfo.pos.x, m_screenInfo.pos.y, m_touchPos.x, m_touchPos.y); @@ -682,7 +693,7 @@ bool CCalibration::averageSamples(struct nxgl_point_s &average) // Save the sample data - gvdbg("Sample %d: Touch x: %d y: %d\n", m_nsamples+1, m_touchPos.x, m_touchPos.y); + ivdbg("Sample %d: Touch x: %d y: %d\n", m_nsamples+1, m_touchPos.x, m_touchPos.y); m_sampleData[m_nsamples].x = m_touchPos.x; m_sampleData[m_nsamples].y = m_touchPos.y; @@ -771,7 +782,7 @@ bool CCalibration::averageSamples(struct nxgl_point_s &average) average.y = m_sampleData[0].y; #endif - gvdbg("Average: Touch x: %d y: %d\n", average.x, average.y); + ivdbg("Average: Touch x: %d y: %d\n", average.x, average.y); m_nsamples = 0; return true; } @@ -1016,7 +1027,7 @@ void CCalibration::stateMachine(void) break; } - gvdbg("New m_calphase=%d Screen x: %d y: %d\n", + ivdbg("New m_calphase=%d Screen x: %d y: %d\n", m_calphase, m_screenInfo.pos.x, m_screenInfo.pos.y); } @@ -1145,7 +1156,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.left.slope = (bottomX - topX) / (bottomY - topY); data.left.offset = topX - topY * data.left.slope; - gdbg("Left slope: %f offset: %f\n", data.left.slope, data.left.offset); + idbg("Left slope: %f offset: %f\n", data.left.slope, data.left.offset); topX = (float)m_calibData[CALIB_UPPER_RIGHT_INDEX].x; bottomX = (float)m_calibData[CALIB_LOWER_RIGHT_INDEX].x; @@ -1156,7 +1167,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.right.slope = (bottomX - topX) / (bottomY - topY); data.right.offset = topX - topY * data.right.slope; - gdbg("Right slope: %f offset: %f\n", data.right.slope, data.right.offset); + idbg("Right slope: %f offset: %f\n", data.right.slope, data.right.offset); // Y lines: // @@ -1174,7 +1185,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.top.slope = (rightY - leftY) / (rightX - leftX); data.top.offset = leftY - leftX * data.top.slope; - gdbg("Top slope: %f offset: %f\n", data.top.slope, data.top.offset); + idbg("Top slope: %f offset: %f\n", data.top.slope, data.top.offset); leftX = (float)m_calibData[CALIB_LOWER_LEFT_INDEX].x; rightX = (float)m_calibData[CALIB_LOWER_RIGHT_INDEX].x; @@ -1185,7 +1196,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.bottom.slope = (rightY - leftY) / (rightX - leftX); data.bottom.offset = leftY - leftX * data.bottom.slope; - gdbg("Bottom slope: %f offset: %f\n", data.bottom.slope, data.bottom.offset); + idbg("Bottom slope: %f offset: %f\n", data.bottom.slope, data.bottom.offset); // Save also the calibration screen positions @@ -1213,7 +1224,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.xSlope = b16divb16(itob16(CALIBRATION_RIGHTX - CALIBRATION_LEFTX), (rightX - leftX)); data.xOffset = itob16(CALIBRATION_LEFTX) - b16mulb16(leftX, data.xSlope); - gdbg("New xSlope: %08x xOffset: %08x\n", data.xSlope, data.xOffset); + idbg("New xSlope: %08x xOffset: %08x\n", data.xSlope, data.xOffset); // Similarly for Y // @@ -1234,7 +1245,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.ySlope = b16divb16(itob16(CALIBRATION_BOTTOMY - CALIBRATION_TOPY), (bottomY - topY)); data.yOffset = itob16(CALIBRATION_TOPY) - b16mulb16(topY, data.ySlope); - gdbg("New ySlope: %08x yOffset: %08x\n", data.ySlope, data.yOffset); + idbg("New ySlope: %08x yOffset: %08x\n", data.ySlope, data.yOffset); #endif return true; diff --git a/NxWidgets/nxwm/src/ctouchscreen.cxx b/NxWidgets/nxwm/src/ctouchscreen.cxx index 1b9c53e4d..105908859 100644 --- a/NxWidgets/nxwm/src/ctouchscreen.cxx +++ b/NxWidgets/nxwm/src/ctouchscreen.cxx @@ -579,7 +579,7 @@ void CTouchscreen::handleMouseInput(struct touch_sample_s *sample) #endif - gvdbg("raw: (%d, %d) scaled: (%d, %d)\n", rawX, rawY, x, y); + vdbg("raw: (%d, %d) scaled: (%d, %d)\n", rawX, rawY, x, y); } // Get the server handle and "inject the mouse data diff --git a/NxWidgets/nxwm/src/glyph_play.cxx b/NxWidgets/nxwm/src/glyph_play.cxx deleted file mode 100644 index 8c16addae..000000000 --- a/NxWidgets/nxwm/src/glyph_play.cxx +++ /dev/null @@ -1,258 +0,0 @@ -/******************************************************************************************** - * NxWidgets/nxwm/src/glyph_play.cxx - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX, NxWidgets, nor the names of its contributors - * me be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ********************************************************************************************/ - -/******************************************************************************************** - * Included Files - ********************************************************************************************/ - -#include - -#include -#include -#include - -#include -#include -#include - -#include "crlepalettebitmap.hxx" - -#include "nxwmconfig.hxx" -#include "nxwmglyphs.hxx" - -/******************************************************************************************** - * Pre-Processor Definitions - ********************************************************************************************/ - -#define BITMAP_NROWS 24 -#define BITMAP_NCOLUMNS 24 -#define BITMAP_NLUTCODES 5 - -#define DARK_PLAY_ICON 1 - -/******************************************************************************************** - * Private Bitmap Data - ********************************************************************************************/ - -using namespace NxWM; - -/* RGB24 (8-8-8) Colors */ - -#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 -# ifdef DARK_PLAY_ICON - -static const uint32_t g_playNormalLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x00bd00, 0x008100, 0x006300, 0x003600 /* Codes 1-4 */ -}; - -static const uint32_t g_playBrightlLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x00fc00, 0x00ac00, 0x008400, 0x004800 /* Codes 1-4 */ -}; - -# else /* DARK_PLAY_ICON */ - -static const uint32_t g_playNormalLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x00fc00, 0x00ac00, 0x008400, 0x004800 /* Codes 1-4 */ -}; - -static const uint32_t g_playBrightlLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x00fc00, 0x00c000, 0x00a200, 0x007500 /* Codes 1-4 */ -}; -# endif /* DARK_PLAY_ICON */ - -/* RGB16 (565) Colors (four of the colors in this map are duplicates) */ - -#elif CONFIG_NXWIDGETS_BPP == 16 -# ifdef DARK_PLAY_ICON - -static const uint16_t g_playNormalLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x05e0, 0x0400, 0x0300, 0x01a0 /* Codes 1-4 */ -}; - -static const uint16_t g_playBrightlLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x07e0, 0x0560, 0x0420, 0x0240 /* Codes 1-4 */ -}; - -# else /* DARK_PLAY_ICON */ - -static const uint16_t g_playNormalLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x07e0, 0x0560, 0x0420, 0x0240 /* Codes 1-4 */ -}; - -static const uint16_t g_playBrightlLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x07e0, 0x0600, 0x0500, 0x03a0 /* Codes 1-4 */ -}; - -# endif /* DARK_PLAY_ICON */ - -/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used - * to lookup an 8-bit value. There is no savings in that! It would be better to just put - * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these - * pointless lookups. But these p;ointless lookups do make the logic compatible with the - * 16- and 24-bit types. - */ - -#elif CONFIG_NXWIDGETS_BPP == 8 -# ifdef CONFIG_NXWIDGETS_GREYSCALE - -/* 8-bit Greyscale */ - -# ifdef DARK_PLAY_ICON - -static const uint8_t g_playNormalLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x6e, 0x4b, 0x3a, 0x1f /* Codes 1-4 */ -}; - -static const uint8_t g_playBrightlLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x93, 0x64, 0x4d, 0x2a /* Codes 1-4 */ -}; - -# else /* DARK_PLAY_ICON */ - -static const uint8_t g_playNormalLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x93, 0x64, 0x4d, 0x2a /* Codes 1-4 */ -}; - -static const uint8_t g_playBrightlLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x93, 0x70, 0x5f, 0x44 /* Codes 1-4 */ -}; - -# endif /* DARK_PLAY_ICON */ -# else /* CONFIG_NXWIDGETS_GREYSCALE */ - -/* RGB8 (332) Colors */ - -# ifdef DARK_PLAY_ICON -static const nxgl_mxpixel_t g_playNormalLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x14, 0x10, 0x0c, 0x04 /* Codes 1-4 */ -}; - -static const nxgl_mxpixel_t g_playBrightlLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x1c, 0x14, 0x10, 0x08 /* Codes 1-4 */ -}; - -# else /* DARK_PLAY_ICON */ - -static const nxgl_mxpixel_t g_playNormalLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x1c, 0x14, 0x10, 0x08 /* Codes 1-4 */ -}; - -static const nxgl_mxpixel_t g_playBrightlLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x1c, 0x18, 0x14, 0x0c /* Codes 1-4 */ -}; - -# endif /* DARK_PLAY_ICON */ -# endif /* CONFIG_NXWIDGETS_GREYSCALE */ -#else -# error "Unsupport pixel format" -#endif - -static const struct NXWidgets::SRlePaletteBitmapEntry g_playRleEntries[] = -{ - { 2, 1}, { 22, 0}, /* Row 0 */ - { 2, 2}, { 2, 1}, { 20, 0}, /* Row 1 */ - { 4, 2}, { 2, 1}, { 18, 0}, /* Row 2 */ - { 6, 2}, { 2, 1}, { 16, 0}, /* Row 3 */ - { 8, 2}, { 2, 1}, { 14, 0}, /* Row 4 */ - { 10, 2}, { 2, 1}, { 12, 0}, /* Row 5 */ - { 12, 2}, { 2, 1}, { 10, 0}, /* Row 6 */ - { 14, 2}, { 2, 1}, { 8, 0}, /* Row 7 */ - { 16, 2}, { 2, 1}, { 6, 0}, /* Row 8 */ - { 18, 2}, { 2, 1}, { 4, 0}, /* Row 9 */ - { 20, 2}, { 2, 1}, { 2, 0}, /* Row 10 */ - { 22, 2}, { 2, 1}, /* Row 11 */ - { 22, 3}, { 2, 4}, /* Row 12 */ - { 20, 3}, { 2, 4}, { 2, 0}, /* Row 13 */ - { 18, 3}, { 2, 4}, { 4, 0}, /* Row 14 */ - { 16, 3}, { 2, 4}, { 6, 0}, /* Row 15 */ - { 14, 3}, { 2, 4}, { 8, 0}, /* Row 16 */ - { 12, 3}, { 2, 4}, { 10, 0}, /* Row 17 */ - { 10, 3}, { 2, 4}, { 12, 0}, /* Row 18 */ - { 8, 3}, { 2, 4}, { 14, 0}, /* Row 19 */ - { 6, 3}, { 2, 4}, { 16, 0}, /* Row 20 */ - { 4, 3}, { 2, 4}, { 18, 0}, /* Row 21 */ - { 2, 3}, { 2, 4}, { 20, 0}, /* Row 22 */ - { 2, 4}, { 22, 0}, /* Row 23 */ -}; - -/******************************************************************************************** - * Public Bitmap Structure Defintions - ********************************************************************************************/ - -const struct NXWidgets::SRlePaletteBitmap NxWM::g_playBitmap = -{ - CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel - CONFIG_NXWIDGETS_FMT, // fmt - Color format - BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) - BITMAP_NCOLUMNS, // width - Width in pixels - BITMAP_NROWS, // height - Height in rows - { // lut - Pointer to the beginning of the Look-Up Table (LUT) - g_playNormalLut, // Index 0: Unselected LUT - g_playBrightlLut, // Index 1: Selected LUT - }, - g_playRleEntries // data - Pointer to the beginning of the RLE data -}; diff --git a/NxWidgets/nxwm/src/glyph_play24x24.cxx b/NxWidgets/nxwm/src/glyph_play24x24.cxx new file mode 100644 index 000000000..7ccce5e89 --- /dev/null +++ b/NxWidgets/nxwm/src/glyph_play24x24.cxx @@ -0,0 +1,258 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/glyph_play24x24.cxx + * + * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX, NxWidgets, nor the names of its contributors + * me be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "crlepalettebitmap.hxx" + +#include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +#define BITMAP_NROWS 24 +#define BITMAP_NCOLUMNS 24 +#define BITMAP_NLUTCODES 5 + +#define DARK_PLAY_ICON 1 + +/******************************************************************************************** + * Private Bitmap Data + ********************************************************************************************/ + +using namespace NxWM; + +/* RGB24 (8-8-8) Colors */ + +#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# ifdef DARK_PLAY_ICON + +static const uint32_t g_playNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x00bd00, 0x008100, 0x006300, 0x003600 /* Codes 1-4 */ +}; + +static const uint32_t g_playBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x00fc00, 0x00ac00, 0x008400, 0x004800 /* Codes 1-4 */ +}; + +# else /* DARK_PLAY_ICON */ + +static const uint32_t g_playNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x00fc00, 0x00ac00, 0x008400, 0x004800 /* Codes 1-4 */ +}; + +static const uint32_t g_playBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x00fc00, 0x00c000, 0x00a200, 0x007500 /* Codes 1-4 */ +}; +# endif /* DARK_PLAY_ICON */ + +/* RGB16 (565) Colors (four of the colors in this map are duplicates) */ + +#elif CONFIG_NXWIDGETS_BPP == 16 +# ifdef DARK_PLAY_ICON + +static const uint16_t g_playNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x05e0, 0x0400, 0x0300, 0x01a0 /* Codes 1-4 */ +}; + +static const uint16_t g_playBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x07e0, 0x0560, 0x0420, 0x0240 /* Codes 1-4 */ +}; + +# else /* DARK_PLAY_ICON */ + +static const uint16_t g_playNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x07e0, 0x0560, 0x0420, 0x0240 /* Codes 1-4 */ +}; + +static const uint16_t g_playBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x07e0, 0x0600, 0x0500, 0x03a0 /* Codes 1-4 */ +}; + +# endif /* DARK_PLAY_ICON */ + +/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used + * to lookup an 8-bit value. There is no savings in that! It would be better to just put + * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these + * pointless lookups. But these p;ointless lookups do make the logic compatible with the + * 16- and 24-bit types. + */ + +#elif CONFIG_NXWIDGETS_BPP == 8 +# ifdef CONFIG_NXWIDGETS_GREYSCALE + +/* 8-bit Greyscale */ + +# ifdef DARK_PLAY_ICON + +static const uint8_t g_playNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x6e, 0x4b, 0x3a, 0x1f /* Codes 1-4 */ +}; + +static const uint8_t g_playBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x93, 0x64, 0x4d, 0x2a /* Codes 1-4 */ +}; + +# else /* DARK_PLAY_ICON */ + +static const uint8_t g_playNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x93, 0x64, 0x4d, 0x2a /* Codes 1-4 */ +}; + +static const uint8_t g_playBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x93, 0x70, 0x5f, 0x44 /* Codes 1-4 */ +}; + +# endif /* DARK_PLAY_ICON */ +# else /* CONFIG_NXWIDGETS_GREYSCALE */ + +/* RGB8 (332) Colors */ + +# ifdef DARK_PLAY_ICON +static const nxgl_mxpixel_t g_playNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x14, 0x10, 0x0c, 0x04 /* Codes 1-4 */ +}; + +static const nxgl_mxpixel_t g_playBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x1c, 0x14, 0x10, 0x08 /* Codes 1-4 */ +}; + +# else /* DARK_PLAY_ICON */ + +static const nxgl_mxpixel_t g_playNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x1c, 0x14, 0x10, 0x08 /* Codes 1-4 */ +}; + +static const nxgl_mxpixel_t g_playBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x1c, 0x18, 0x14, 0x0c /* Codes 1-4 */ +}; + +# endif /* DARK_PLAY_ICON */ +# endif /* CONFIG_NXWIDGETS_GREYSCALE */ +#else +# error "Unsupport pixel format" +#endif + +static const struct NXWidgets::SRlePaletteBitmapEntry g_playRleEntries[] = +{ + { 2, 1}, { 22, 0}, /* Row 0 */ + { 2, 2}, { 2, 1}, { 20, 0}, /* Row 1 */ + { 4, 2}, { 2, 1}, { 18, 0}, /* Row 2 */ + { 6, 2}, { 2, 1}, { 16, 0}, /* Row 3 */ + { 8, 2}, { 2, 1}, { 14, 0}, /* Row 4 */ + { 10, 2}, { 2, 1}, { 12, 0}, /* Row 5 */ + { 12, 2}, { 2, 1}, { 10, 0}, /* Row 6 */ + { 14, 2}, { 2, 1}, { 8, 0}, /* Row 7 */ + { 16, 2}, { 2, 1}, { 6, 0}, /* Row 8 */ + { 18, 2}, { 2, 1}, { 4, 0}, /* Row 9 */ + { 20, 2}, { 2, 1}, { 2, 0}, /* Row 10 */ + { 22, 2}, { 2, 1}, /* Row 11 */ + { 22, 3}, { 2, 4}, /* Row 12 */ + { 20, 3}, { 2, 4}, { 2, 0}, /* Row 13 */ + { 18, 3}, { 2, 4}, { 4, 0}, /* Row 14 */ + { 16, 3}, { 2, 4}, { 6, 0}, /* Row 15 */ + { 14, 3}, { 2, 4}, { 8, 0}, /* Row 16 */ + { 12, 3}, { 2, 4}, { 10, 0}, /* Row 17 */ + { 10, 3}, { 2, 4}, { 12, 0}, /* Row 18 */ + { 8, 3}, { 2, 4}, { 14, 0}, /* Row 19 */ + { 6, 3}, { 2, 4}, { 16, 0}, /* Row 20 */ + { 4, 3}, { 2, 4}, { 18, 0}, /* Row 21 */ + { 2, 3}, { 2, 4}, { 20, 0}, /* Row 22 */ + { 2, 4}, { 22, 0}, /* Row 23 */ +}; + +/******************************************************************************************** + * Public Bitmap Structure Defintions + ********************************************************************************************/ + +const struct NXWidgets::SRlePaletteBitmap NxWM::g_playBitmap24x24 = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_playNormalLut, // Index 0: Unselected LUT + g_playBrightlLut, // Index 1: Selected LUT + }, + g_playRleEntries // data - Pointer to the beginning of the RLE data +}; diff --git a/nuttx/configs/sama5d3x-ek/nxwm/defconfig b/nuttx/configs/sama5d3x-ek/nxwm/defconfig index 403cc986f..b4279f283 100644 --- a/nuttx/configs/sama5d3x-ek/nxwm/defconfig +++ b/nuttx/configs/sama5d3x-ek/nxwm/defconfig @@ -605,7 +605,7 @@ CONFIG_STDIO_BUFFER_SIZE=64 CONFIG_STDIO_LINEBUFFER=y CONFIG_NUNGET_CHARS=2 CONFIG_LIB_HOMEDIR="/" -# CONFIG_LIBM is not set +CONFIG_LIBM=y # CONFIG_NOPRINTF_FIELDWIDTH is not set CONFIG_LIBC_FLOATINGPOINT=y CONFIG_LIB_RAND_ORDER=1 -- cgit v1.2.3