Squashed commit of the following:

apps/graphics/slcd:  With these changes the CSLcd class now compiles
    successfully.  Still untested.

    apps/graphics/slcd:  Finish off rendering.  Hook into configuration and build system.

    apps/graphics/nxglyphs:  Add images that will eventually be used for clock icons

    apps/graphics/slcd:  Completes all CLcd methods except for rendering to the window.

    apps/graphics/slcd:  Add beginning of SLCD class.

    Add ASCII to SLCD character mapping.

    apps/graphics/slcd:  Represent segments as runs rather than trapezoids.  Trapezoids will be synthesized later.

    A little more SLCD logic

    apps/graphics/slcd:  Flesh out more trapezoids in the decomposition.
This commit is contained in:
Gregory Nutt 2019-05-31 20:44:02 -06:00
parent 9fd60f1908
commit 51c3d3a054
20 changed files with 2212 additions and 9 deletions

View File

@ -48,7 +48,7 @@ CXXSRCS += glyph_capslock.cxx glyph_radiobuttonon.cxx glyph_windowdepthdown.cxx
CXXSRCS += glyph_checkboxmu.cxx glyph_return.cxx glyph_windowdepthup.cxx
CXXSRCS += glyph_checkboxoff.cxx glyph_screendepthdown.cxx
# Glyphs used by NxWM and Twm4Nx
# Glyphs used by NxWM, Twm4Nx, and SLcd
ifeq ($(CONFIG_NXGLYPHS_LARGE_ICONS),y)
# Large icons
@ -57,7 +57,7 @@ CXXSRCS += glyph_calculator47x49.cxx glyph_calibration48x42.cxx glyph_cmd49x43.c
CXXSRCS += glyph_minimize42x42.cxx glyph_play48x48.cxx glyph_stop42x42.cxx
CXXSRCS += glyph_menu42x42.cxx glyph_resize42x42.cxx glyph_nxicon42x42.cxx
CXXSRCS += glpyh_menu2-42x42.cxx glpyh_minimize2-42x42.cxx glpyh_resize2-42x42.cxx
CXXSRCS += glyph_stop2-42x42.cxx
CXXSRCS += glyph_stop2-42x42.cxx glyph_lcdclock102x48.cxx
else
# Small icons
@ -66,7 +66,7 @@ CXXSRCS += glyph_calculator24x25.cxx glyph_calibration24x21.cxx glyph_cmd25x22.c
CXXSRCS += glyph_minimize21x21.cxx glyph_play24x24.cxx glyph_stop21x21.cxx
CXXSRCS += glyph_menu21x21.cxx glyph_resize21x21.cxx glyph_nxicon21x21.cxx
CXXSRCS += glpyh_menu2-21x21.cxx glpyh_minimize2-21x21.cxx glpyh_resize2-21x21.cxx
CXXSRCS += glpyh_stop2-21x21.cxx
CXXSRCS += glpyh_stop2-21x21.cxx glyph_lcdclock51x24.cxx
endif
ifeq ($(CONFIG_NXGLYPHS_LARGE_ICONS),y)

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,311 @@
/********************************************************************************************
* apps/graphics/nxglyphs/src/glyph_lcdclock102x48.cxx
*
* Copyright (C) 2019 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include "graphics/nxwidgets/crlepalettebitmap.hxx"
#include "graphics/nxglyphs.hxx"
/********************************************************************************************
* Pre-Processor Definitions
********************************************************************************************/
#define BITMAP_NROWS 48
#define BITMAP_NCOLUMNS 102
#define BITMAP_NLUTCODES 53
/********************************************************************************************
* Private Bitmap Data
********************************************************************************************/
using namespace NXWidgets;
#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32
// RGB24 (8-8-8) Colors
static const uint32_t g_lcdClockNormalLut[BITMAP_NLUTCODES] =
{
0x808c80, 0x748474, 0x607060, 0x7c887c, 0x6c786c, 0x445844, 0x3c503c, 0x385038, /* Codes 0-7 */
0x243c24, 0x002000, 0x707c70, 0x344c34, 0x102c10, 0x6c7c6c, 0x4c604c, 0x405440, /* Codes 8-15 */
0x042404, 0x0c2c0c, 0x687868, 0x042004, 0x788478, 0x284428, 0x2c442c, 0x546854, /* Codes 16-23 */
0x5c6c5c, 0x788878, 0x143014, 0x183418, 0x506450, 0x546454, 0x1c381c, 0x485c48, /* Codes 24-31 */
0x244024, 0x647464, 0x082408, 0x586858, 0x082808, 0x586c58, 0x486048, 0x405840, /* Codes 32-39 */
0x304830, 0x103010, 0x3c543c, 0x687468, 0x708070, 0x284028, 0x203820, 0x748074, /* Codes 40-47 */
0x143414, 0x203c20, 0x5c705c, 0x7c8c7c, 0xd4d828, /* Codes 48-52 */
};
static const uint32_t g_lcdClockBrightLut[BITMAP_NLUTCODES] =
{
0x9fa89f, 0x96a296, 0x879387, 0x9ca59c, 0x909990, 0x728172, 0x6c7b6c, 0x697b69, /* Codes 0-7 */
0x5a6c5a, 0x3f573f, 0x939c93, 0x667866, 0x4b604b, 0x909c90, 0x788778, 0x6f7e6f, /* Codes 8-15 */
0x425a42, 0x486048, 0x8d998d, 0x425742, 0x99a299, 0x5d725d, 0x607260, 0x7e8d7e, /* Codes 16-23 */
0x849084, 0x99a599, 0x4e634e, 0x516651, 0x7b8a7b, 0x7e8a7e, 0x546954, 0x758475, /* Codes 24-31 */
0x5a6f5a, 0x8a968a, 0x455a45, 0x818d81, 0x455d45, 0x819081, 0x758775, 0x6f816f, /* Codes 32-39 */
0x637563, 0x4b634b, 0x6c7e6c, 0x8d968d, 0x939f93, 0x5d6f5d, 0x576957, 0x969f96, /* Codes 40-47 */
0x4e664e, 0x576c57, 0x849384, 0x9ca89c, 0xdee15d, /* Codes 48-52 */
};
#elif CONFIG_NXWIDGETS_BPP == 16
// RGB16 (565) Colors (four of the colors in this map are duplicates)
static const uint16_t g_lcdClockNormalLut[BITMAP_NLUTCODES] =
{
0x8470, 0x742e, 0x638c, 0x7c4f, 0x6bcd, 0x42c8, 0x3a87, 0x3a87, 0x21e4, 0x0100, /* Codes 0-9 */
0x73ee, 0x3266, 0x1162, 0x6bed, 0x4b09, 0x42a8, 0x0120, 0x0961, 0x6bcd, 0x0100, /* Codes 10-19 */
0x7c2f, 0x2a25, 0x2a25, 0x534a, 0x5b6b, 0x7c4f, 0x1182, 0x19a3, 0x532a, 0x532a, /* Codes 20-29 */
0x19c3, 0x4ae9, 0x2204, 0x63ac, 0x0921, 0x5b4b, 0x0941, 0x5b6b, 0x4b09, 0x42c8, /* Codes 30-39 */
0x3246, 0x1182, 0x3aa7, 0x6bad, 0x740e, 0x2a05, 0x21c4, 0x740e, 0x11a2, 0x21e4, /* Codes 40-49 */
0x5b8b, 0x7c6f, 0xd6c5, /* Codes 50-52 */
};
static const uint16_t g_lcdClockBrightLut[BITMAP_NLUTCODES] =
{
0x9d53, 0x9512, 0x8490, 0x9d33, 0x94d2, 0x740e, 0x6bcd, 0x6bcd, 0x5b6b, 0x3aa7, /* Codes 0-9 */
0x94f2, 0x63cc, 0x4b09, 0x94f2, 0x7c2f, 0x6bed, 0x42c8, 0x4b09, 0x8cd1, 0x42a8, /* Codes 10-19 */
0x9d13, 0x5b8b, 0x638c, 0x7c6f, 0x8490, 0x9d33, 0x4b09, 0x532a, 0x7c4f, 0x7c4f, /* Codes 20-29 */
0x534a, 0x742e, 0x5b6b, 0x8cb1, 0x42c8, 0x8470, 0x42e8, 0x8490, 0x742e, 0x6c0d, /* Codes 30-39 */
0x63ac, 0x4b09, 0x6bed, 0x8cb1, 0x94f2, 0x5b6b, 0x534a, 0x94f2, 0x4b29, 0x536a, /* Codes 40-49 */
0x8490, 0x9d53, 0xdf0b, /* Codes 50-52 */
};
#elif CONFIG_NXWIDGETS_BPP == 8
// 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.
///
# ifdef CONFIG_NXWIDGETS_GREYSCALE
// 8-bit Greyscale
static const uint8_t g_lcdClockNormalLut[BITMAP_NLUTCODES] =
{
0x87, 0x7d, 0x69, 0x83, 0x73, 0x4f, 0x47, 0x46, 0x32, 0x12, 0x77, 0x42, 0x20, 0x75, 0x57, 0x4b, /* Codes 0-15 */
0x16, 0x1e, 0x71, 0x14, 0x7f, 0x38, 0x3a, 0x5f, 0x65, 0x81, 0x24, 0x28, 0x5b, 0x5d, 0x2c, 0x53, /* Codes 16-31 */
0x34, 0x6d, 0x18, 0x61, 0x1a, 0x63, 0x56, 0x4e, 0x3e, 0x22, 0x4a, 0x6f, 0x79, 0x36, 0x2e, 0x7b, /* Codes 32-47 */
0x26, 0x30, 0x67, 0x85, 0xc2, /* Codes 48-52 */
}
static const uint8_t g_lcdClockBrightLut[BITMAP_NLUTCODES] =
{
0xa4, 0x9d, 0x8e, 0xa1, 0x95, 0x7a, 0x74, 0x73, 0x64, 0x4d, 0x98, 0x70, 0x57, 0x97, 0x80, 0x77, /* Codes 0-15 */
0x50, 0x56, 0x94, 0x4e, 0x9e, 0x69, 0x6a, 0x86, 0x8b, 0xa0, 0x5a, 0x5d, 0x83, 0x85, 0x60, 0x7d, /* Codes 16-31 */
0x66, 0x91, 0x51, 0x88, 0x53, 0x89, 0x7f, 0x79, 0x6d, 0x59, 0x76, 0x92, 0x9a, 0x67, 0x61, 0x9b, /* Codes 32-47 */
0x5c, 0x63, 0x8c, 0xa3, 0xd1, /* Codes 48-52 */
};
# else /* CONFIG_NXWIDGETS_GREYSCALE */
// RGB8 (332) Colors
static const nxgl_mxpixel_t g_lcdClockNormalLut[BITMAP_NLUTCODES] =
{
0x92, 0x71, 0x6d, 0x72, 0x6d, 0x49, 0x29, 0x28, 0x24, 0x04, 0x6d, 0x28, 0x04, 0x6d, 0x4d, 0x49, /* Codes 0-15 */
0x04, 0x04, 0x6d, 0x04, 0x71, 0x28, 0x28, 0x4d, 0x4d, 0x71, 0x04, 0x04, 0x4d, 0x4d, 0x04, 0x49, /* Codes 16-31 */
0x28, 0x6d, 0x04, 0x4d, 0x04, 0x4d, 0x4d, 0x49, 0x28, 0x04, 0x29, 0x6d, 0x71, 0x28, 0x24, 0x71, /* Codes 32-47 */
0x04, 0x24, 0x4d, 0x72, 0xd8, /* Codes 48-52 */
};
static const uint8_t g_lcdClockBrightLut[BITMAP_NLUTCODES] =
{
0xb6, 0x96, 0x92, 0x96, 0x92, 0x71, 0x6d, 0x6d, 0x4d, 0x49, 0x92, 0x6d, 0x4d, 0x92, 0x71, 0x71, /* Codes 0-15 */
0x49, 0x4d, 0x92, 0x49, 0x96, 0x4d, 0x6d, 0x92, 0x92, 0x96, 0x4d, 0x4d, 0x71, 0x92, 0x4d, 0x71, /* Codes 16-31 */
0x4d, 0x92, 0x49, 0x92, 0x49, 0x92, 0x71, 0x71, 0x6d, 0x4d, 0x71, 0x92, 0x96, 0x4d, 0x4d, 0x96, /* Codes 32-47 */
0x4d, 0x4d, 0x92, 0x96, 0xfd, /* Codes 48-52 */
};
# endif
#else
# error Unsupported pixel format
#endif
static const struct SRlePaletteBitmapEntry g_lcdClockRleEntries[] =
{
{102, 0}, // Row 0
{102, 0}, // Row 1
{102, 0}, // Row 2
{ 23, 0}, { 1, 1}, { 12, 2}, { 1, 3}, { 21, 0}, { 1, 4}, { 12, 2}, { 31, 0}, // Row 3
{ 13, 0}, { 1, 5}, { 1, 6}, { 7, 0}, { 1, 7}, { 1, 8}, { 12, 9}, { 1, 10}, // Row 4
{ 2, 11}, { 1, 3}, { 17, 0}, { 1, 11}, { 1, 12}, { 12, 9}, { 1, 13}, { 1, 2},
{ 8, 0}, { 1, 5}, { 12, 11}, { 8, 0},
{ 12, 0}, { 1, 14}, { 2, 9}, { 1, 15}, { 5, 0}, { 1, 7}, { 14, 9}, { 1, 10}, // Row 5
{ 2, 9}, { 1, 16}, { 16, 0}, { 1, 17}, { 13, 9}, { 1, 18}, { 1, 2}, { 1, 19},
{ 1, 20}, { 6, 0}, { 1, 14}, { 13, 9}, { 1, 0}, { 1, 21}, { 1, 17}, { 5, 0},
{ 11, 0}, { 1, 3}, { 1, 11}, { 3, 9}, { 1, 18}, { 5, 0}, { 1, 22}, { 11, 9}, // Row 6
{ 1, 16}, { 1, 23}, { 1, 17}, { 3, 9}, { 16, 0}, { 1, 22}, { 11, 9}, { 1, 16},
{ 1, 23}, { 1, 24}, { 3, 9}, { 5, 0}, { 1, 25}, { 1, 26}, { 11, 9}, { 1, 27},
{ 1, 0}, { 1, 28}, { 2, 9}, { 1, 11}, { 4, 0},
{ 11, 0}, { 1, 20}, { 4, 9}, { 1, 18}, { 6, 0}, { 1, 29}, { 1, 30}, { 9, 9}, // Row 7
{ 1, 26}, { 1, 29}, { 1, 16}, { 3, 9}, { 17, 0}, { 1, 29}, { 1, 30}, { 9, 9},
{ 1, 26}, { 1, 0}, { 1, 17}, { 3, 9}, { 5, 0}, { 1, 22}, { 1, 6}, { 1, 29},
{ 1, 31}, { 9, 9}, { 1, 28}, { 1, 0}, { 1, 30}, { 2, 9}, { 1, 11}, { 4, 0},
{ 10, 0}, { 1, 3}, { 4, 9}, { 1, 6}, { 10, 0}, { 8, 9}, { 1, 0}, { 1, 6}, // Row 8
{ 4, 9}, { 19, 0}, { 9, 9}, { 1, 0}, { 1, 6}, { 4, 9}, { 4, 0}, { 1, 32},
{ 2, 9}, { 1, 2}, { 1, 0}, { 1, 5}, { 7, 9}, { 1, 32}, { 1, 0}, { 1, 3},
{ 3, 9}, { 1, 11}, { 4, 0},
{ 10, 0}, { 1, 32}, { 4, 9}, { 1, 6}, { 18, 0}, { 1, 18}, { 5, 9}, { 28, 0}, // Row 9
{ 1, 20}, { 1, 32}, { 4, 9}, { 4, 0}, { 1, 32}, { 3, 9}, { 1, 28}, { 1, 33},
{ 8, 0}, { 1, 2}, { 4, 9}, { 1, 11}, { 4, 0},
{ 10, 0}, { 1, 32}, { 4, 9}, { 1, 6}, { 18, 0}, { 1, 30}, { 4, 9}, { 1, 23}, // Row 10
{ 28, 0}, { 1, 18}, { 5, 9}, { 4, 0}, { 1, 32}, { 4, 9}, { 1, 6}, { 8, 0},
{ 1, 22}, { 4, 9}, { 1, 11}, { 4, 0},
{ 10, 0}, { 1, 32}, { 4, 9}, { 1, 6}, { 18, 0}, { 5, 9}, { 1, 20}, { 28, 0}, // Row 11
{ 1, 18}, { 4, 9}, { 1, 20}, { 4, 0}, { 1, 32}, { 3, 9}, { 1, 17}, { 9, 0},
{ 1, 22}, { 3, 9}, { 1, 34}, { 5, 0},
{ 10, 0}, { 1, 32}, { 3, 9}, { 1, 16}, { 1, 35}, { 18, 0}, { 5, 9}, { 1, 20}, // Row 12
{ 28, 0}, { 1, 6}, { 4, 9}, { 1, 20}, { 4, 0}, { 1, 32}, { 3, 9}, { 1, 17},
{ 9, 0}, { 1, 22}, { 3, 9}, { 1, 34}, { 5, 0},
{ 9, 0}, { 1, 24}, { 1, 34}, { 3, 9}, { 1, 17}, { 19, 0}, { 5, 9}, { 1, 20}, // Row 13
{ 28, 0}, { 5, 9}, { 1, 20}, { 3, 0}, { 1, 24}, { 1, 34}, { 3, 9}, { 1, 17},
{ 8, 0}, { 1, 2}, { 1, 36}, { 3, 9}, { 1, 34}, { 5, 0},
{ 9, 0}, { 1, 28}, { 4, 9}, { 1, 17}, { 19, 0}, { 5, 9}, { 1, 20}, { 28, 0}, // Row 14
{ 5, 9}, { 1, 20}, { 3, 0}, { 1, 28}, { 4, 9}, { 1, 17}, { 8, 0}, { 1, 37},
{ 4, 9}, { 1, 34}, { 5, 0},
{ 9, 0}, { 1, 28}, { 4, 9}, { 1, 17}, { 19, 0}, { 4, 9}, { 1, 8}, { 1, 3}, // Row 15
{ 28, 0}, { 5, 9}, { 1, 20}, { 3, 0}, { 1, 28}, { 4, 9}, { 1, 17}, { 8, 0},
{ 1, 37}, { 4, 9}, { 1, 34}, { 5, 0},
{ 9, 0}, { 1, 28}, { 4, 9}, { 1, 17}, { 18, 0}, { 1, 32}, { 4, 9}, { 1, 38}, // Row 16
{ 29, 0}, { 5, 9}, { 1, 20}, { 3, 0}, { 1, 28}, { 4, 9}, { 1, 17}, { 8, 0},
{ 1, 37}, { 4, 9}, { 1, 34}, { 5, 0},
{ 9, 0}, { 1, 39}, { 4, 9}, { 1, 32}, { 18, 0}, { 1, 26}, { 4, 9}, { 1, 38}, // Row 17
{ 28, 0}, { 1, 26}, { 4, 9}, { 1, 38}, { 4, 0}, { 1, 39}, { 4, 9}, { 1, 32},
{ 8, 0}, { 1, 31}, { 4, 9}, { 6, 0},
{ 9, 0}, { 5, 9}, { 19, 0}, { 1, 26}, { 4, 9}, { 1, 38}, { 28, 0}, { 1, 26}, // Row 18
{ 4, 9}, { 1, 38}, { 4, 0}, { 5, 9}, { 9, 0}, { 5, 9}, { 6, 0},
{ 9, 0}, { 5, 9}, { 19, 0}, { 1, 26}, { 4, 9}, { 1, 38}, { 28, 0}, { 1, 26}, // Row 19
{ 4, 9}, { 1, 38}, { 4, 0}, { 5, 9}, { 9, 0}, { 5, 9}, { 6, 0},
{ 9, 0}, { 5, 9}, { 19, 0}, { 1, 26}, { 4, 9}, { 1, 38}, { 28, 0}, { 1, 26}, // Row 20
{ 4, 9}, { 1, 38}, { 4, 0}, { 5, 9}, { 9, 0}, { 5, 9}, { 6, 0},
{ 9, 0}, { 1, 40}, { 4, 9}, { 19, 0}, { 1, 26}, { 3, 9}, { 1, 41}, { 1, 4}, // Row 21
{ 28, 0}, { 1, 26}, { 3, 9}, { 1, 41}, { 1, 4}, { 4, 0}, { 4, 9}, { 1, 6},
{ 9, 0}, { 5, 9}, { 6, 0},
{ 9, 0}, { 1, 3}, { 1, 8}, { 3, 9}, { 9, 0}, { 10, 19}, { 2, 33}, { 2, 9}, // Row 22
{ 1, 30}, { 19, 0}, { 1, 24}, { 8, 19}, { 1, 42}, { 1, 3}, { 3, 9}, { 1, 30},
{ 4, 0}, { 1, 19}, { 2, 9}, { 1, 16}, { 2, 3}, { 8, 19}, { 1, 20}, { 1, 35},
{ 4, 9}, { 6, 0},
{ 11, 0}, { 1, 32}, { 2, 9}, { 6, 0}, { 1, 1}, { 1, 8}, { 12, 9}, { 1, 23}, // Row 23
{ 1, 42}, { 1, 16}, { 1, 30}, { 17, 0}, { 1, 43}, { 1, 23}, { 11, 9}, { 1, 24},
{ 1, 28}, { 1, 16}, { 1, 30}, { 4, 0}, { 2, 9}, { 1, 30}, { 1, 3}, { 1, 40},
{ 10, 9}, { 1, 27}, { 1, 44}, { 1, 45}, { 1, 9}, { 1, 37}, { 6, 0},
{ 11, 0}, { 1, 3}, { 2, 23}, { 6, 0}, { 1, 46}, { 14, 9}, { 1, 5}, { 1, 24}, // Row 24
{ 1, 2}, { 16, 0}, { 1, 45}, { 1, 12}, { 12, 9}, { 1, 16}, { 1, 23}, { 1, 24},
{ 1, 2}, { 4, 0}, { 2, 23}, { 1, 11}, { 1, 32}, { 12, 9}, { 1, 27}, { 1, 45},
{ 1, 23}, { 1, 47}, { 6, 0},
{ 10, 0}, { 1, 3}, { 1, 47}, { 1, 9}, { 1, 2}, { 3, 0}, { 1, 18}, { 2, 9}, // Row 25
{ 1, 3}, { 1, 11}, { 12, 9}, { 1, 27}, { 19, 0}, { 1, 2}, { 13, 9}, { 1, 27},
{ 1, 3}, { 1, 17}, { 1, 30}, { 6, 0}, { 1, 45}, { 13, 9}, { 1, 29}, { 1, 3},
{ 1, 28}, { 1, 37}, { 6, 0},
{ 9, 0}, { 1, 14}, { 1, 48}, { 2, 9}, { 1, 2}, { 3, 0}, { 1, 18}, { 2, 9}, // Row 26
{ 1, 41}, { 1, 4}, { 1, 11}, { 9, 9}, { 1, 48}, { 1, 44}, { 21, 0}, { 1, 28},
{ 1, 40}, { 8, 9}, { 1, 16}, { 1, 40}, { 1, 44}, { 1, 15}, { 2, 9}, { 1, 30},
{ 7, 0}, { 1, 22}, { 10, 9}, { 1, 22}, { 1, 7}, { 1, 14}, { 2, 9}, { 1, 37},
{ 6, 0},
{ 8, 0}, { 1, 49}, { 4, 9}, { 1, 2}, { 3, 0}, { 1, 18}, { 3, 9}, { 1, 26}, // Row 27
{ 1, 49}, { 9, 50}, { 1, 13}, { 24, 0}, { 8, 50}, { 1, 2}, { 1, 28}, { 1, 49},
{ 3, 9}, { 1, 30}, { 7, 0}, { 1, 3}, { 10, 50}, { 1, 8}, { 1, 27}, { 3, 9},
{ 1, 37}, { 6, 0},
{ 7, 0}, { 1, 22}, { 5, 9}, { 1, 2}, { 3, 0}, { 1, 18}, { 5, 9}, { 42, 0}, // Row 28
{ 1, 10}, { 5, 9}, { 18, 0}, { 1, 11}, { 5, 9}, { 1, 37}, { 6, 0},
{ 7, 0}, { 1, 22}, { 4, 9}, { 1, 27}, { 1, 13}, { 3, 0}, { 1, 7}, { 5, 9}, // Row 29
{ 42, 0}, { 1, 10}, { 5, 9}, { 18, 0}, { 1, 11}, { 5, 9}, { 1, 37}, { 6, 0},
{ 7, 0}, { 1, 22}, { 4, 9}, { 1, 11}, { 4, 0}, { 6, 9}, { 42, 0}, { 1, 10}, // Row 30
{ 5, 9}, { 18, 0}, { 1, 11}, { 4, 9}, { 1, 8}, { 1, 20}, { 6, 0},
{ 7, 0}, { 1, 22}, { 4, 9}, { 1, 11}, { 4, 0}, { 5, 9}, { 1, 20}, { 42, 0}, // Row 31
{ 1, 10}, { 5, 9}, { 18, 0}, { 1, 11}, { 4, 9}, { 1, 22}, { 7, 0},
{ 7, 0}, { 1, 22}, { 4, 9}, { 1, 11}, { 4, 0}, { 5, 9}, { 1, 20}, { 42, 0}, // Row 32
{ 1, 11}, { 5, 9}, { 18, 0}, { 1, 11}, { 4, 9}, { 1, 22}, { 7, 0},
{ 6, 0}, { 1, 50}, { 1, 16}, { 4, 9}, { 1, 11}, { 4, 0}, { 5, 9}, { 1, 20}, // Row 33
{ 42, 0}, { 6, 9}, { 18, 0}, { 1, 11}, { 4, 9}, { 1, 22}, { 7, 0},
{ 6, 0}, { 1, 37}, { 5, 9}, { 1, 11}, { 4, 0}, { 5, 9}, { 1, 20}, { 42, 0}, // Row 34
{ 5, 9}, { 1, 10}, { 17, 0}, { 1, 2}, { 5, 9}, { 1, 22}, { 7, 0},
{ 6, 0}, { 1, 37}, { 4, 9}, { 1, 16}, { 1, 2}, { 3, 0}, { 1, 5}, { 5, 9}, // Row 35
{ 1, 20}, { 42, 0}, { 5, 9}, { 1, 10}, { 17, 0}, { 1, 2}, { 5, 9}, { 1, 24},
{ 7, 0},
{ 6, 0}, { 1, 37}, { 4, 9}, { 1, 34}, { 4, 0}, { 1, 26}, { 5, 9}, { 1, 20}, // Row 36
{ 42, 0}, { 5, 9}, { 1, 10}, { 17, 0}, { 1, 2}, { 5, 9}, { 8, 0},
{ 6, 0}, { 1, 37}, { 4, 9}, { 1, 34}, { 4, 0}, { 1, 26}, { 4, 9}, { 1, 38}, // Row 37
{ 43, 0}, { 5, 9}, { 1, 10}, { 17, 0}, { 1, 2}, { 5, 9}, { 8, 0},
{ 6, 0}, { 1, 37}, { 4, 9}, { 1, 34}, { 4, 0}, { 1, 26}, { 4, 9}, { 1, 38}, // Row 38
{ 43, 0}, { 5, 9}, { 1, 10}, { 17, 0}, { 1, 2}, { 5, 9}, { 8, 0},
{ 6, 0}, { 1, 37}, { 4, 9}, { 1, 34}, { 4, 0}, { 1, 26}, { 2, 9}, { 1, 10}, // Row 39
{ 1, 3}, { 1, 51}, { 43, 0}, { 5, 9}, { 1, 10}, { 17, 0}, { 1, 2}, { 5, 9},
{ 8, 0},
{ 6, 0}, { 1, 37}, { 4, 9}, { 1, 34}, { 4, 0}, { 1, 7}, { 1, 20}, { 2, 29}, // Row 40
{ 1, 9}, { 1, 40}, { 8, 29}, { 1, 47}, { 21, 0}, { 1, 18}, { 11, 29}, { 1, 47},
{ 1, 32}, { 3, 9}, { 1, 48}, { 1, 1}, { 6, 0}, { 10, 29}, { 1, 25}, { 1, 4},
{ 1, 12}, { 4, 9}, { 8, 0},
{ 6, 0}, { 1, 47}, { 1, 46}, { 3, 9}, { 1, 24}, { 4, 0}, { 1, 11}, { 1, 46}, // Row 41
{ 12, 9}, { 1, 2}, { 19, 0}, { 1, 11}, { 1, 32}, { 1, 12}, { 11, 9}, { 1, 30},
{ 1, 10}, { 3, 9}, { 1, 5}, { 4, 0}, { 1, 33}, { 2, 32}, { 10, 9}, { 1, 49},
{ 1, 6}, { 1, 11}, { 4, 9}, { 8, 0},
{ 7, 0}, { 1, 40}, { 2, 9}, { 1, 16}, { 5, 0}, { 1, 26}, { 14, 9}, { 19, 0}, // Row 42
{ 1, 26}, { 14, 9}, { 1, 4}, { 1, 19}, { 2, 9}, { 1, 5}, { 4, 0}, { 14, 9},
{ 1, 30}, { 1, 3}, { 1, 34}, { 2, 9}, { 9, 0},
{ 8, 0}, { 2, 9}, { 1, 37}, { 5, 0}, { 1, 26}, { 14, 9}, { 1, 28}, { 18, 0}, // Row 43
{ 1, 15}, { 14, 9}, { 1, 17}, { 1, 5}, { 1, 9}, { 1, 36}, { 1, 24}, { 4, 0},
{ 1, 8}, { 14, 9}, { 1, 38}, { 1, 34}, { 1, 9}, { 1, 49}, { 9, 0},
{ 8, 0}, { 1, 2}, { 1, 49}, { 1, 1}, { 5, 0}, { 1, 33}, { 14, 9}, { 1, 17}, // Row 44
{ 19, 0}, { 1, 28}, { 13, 9}, { 1, 19}, { 1, 12}, { 1, 9}, { 1, 33}, { 5, 0},
{ 1, 37}, { 14, 9}, { 1, 12}, { 1, 9}, { 1, 30}, { 1, 47}, { 9, 0},
{ 18, 0}, { 1, 5}, { 13, 17}, { 1, 5}, { 18, 0}, { 1, 4}, { 2, 17}, { 12, 9}, // Row 45
{ 1, 5}, { 9, 0}, { 1, 17}, { 13, 9}, { 1, 20}, { 11, 0},
{ 54, 0}, { 11, 6}, { 1, 5}, { 11, 0}, { 13, 6}, { 1, 3}, { 11, 0}, // Row 46
{ 1, 52}, {101, 0}, // Row 47
};
/********************************************************************************************
* Public Bitmap Structure Definitions
********************************************************************************************/
const struct SRlePaletteBitmap NXWidgets::g_lcdClockBitmap =
{
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_lcdClockNormalLut, // Index 0: Unselected LUT
g_lcdClockBrightLut, // Index 1: Selected LUT
},
g_lcdClockRleEntries // data - Pointer to the beginning of the RLE data
};

View File

@ -0,0 +1,399 @@
/********************************************************************************************
* apps/graphics/nxglyphs/src/glyph_lcdclock136x64.cxx
*
* Copyright (C) 2019 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include "graphics/nxwidgets/crlepalettebitmap.hxx"
#include "graphics/nxglyphs.hxx"
/********************************************************************************************
* Pre-Processor Definitions
********************************************************************************************/
#define BITMAP_NROWS 64
#define BITMAP_NCOLUMNS 136
#define BITMAP_NLUTCODES 56
/********************************************************************************************
* Private Bitmap Data
********************************************************************************************/
using namespace NXWidgets;
#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32
// RGB24 (8-8-8) Colors
static const uint32_t g_lcdClockNormalLut[BITMAP_NLUTCODES] =
{
0x808c80, 0x7c887c, 0x748474, 0x788478, 0x748074, 0x788878, 0x3c543c, 0x002000, /* Codes 0-7 */
0x586c58, 0x647464, 0x304830, 0x546854, 0x203c20, 0x405440, 0x586858, 0x042404, /* Codes 8-15 */
0x385038, 0x4c604c, 0x2c442c, 0x6c786c, 0x708070, 0x607060, 0x506450, 0x082408, /* Codes 16-23 */
0x082808, 0x1c381c, 0x405840, 0x2c482c, 0x0c280c, 0x6c7c6c, 0x0c2c0c, 0x546454, /* Codes 24-31 */
0x284028, 0x506050, 0x5c705c, 0x243c24, 0x445844, 0x102c10, 0x103010, 0x687868, /* Codes 32-39 */
0x707c70, 0x344c34, 0x143014, 0x5c6c5c, 0x244024, 0x485c48, 0x203820, 0x3c503c, /* Codes 40-47 */
0x183418, 0x284428, 0x384c38, 0x143414, 0x445c44, 0x607460, 0x042004, 0xfcfc00, /* Codes 48-55 */
};
static const uint32_t g_lcdClockBrightLut[BITMAP_NLUTCODES] =
{
0x9fa89f, 0x9ca59c, 0x96a296, 0x99a299, 0x969f96, 0x99a599, 0x6c7e6c, 0x3f573f, /* Codes 0-7 */
0x819081, 0x8a968a, 0x637563, 0x7e8d7e, 0x576c57, 0x6f7e6f, 0x818d81, 0x425a42, /* Codes 8-15 */
0x697b69, 0x788778, 0x607260, 0x909990, 0x939f93, 0x879387, 0x7b8a7b, 0x455a45, /* Codes 16-23 */
0x455d45, 0x546954, 0x6f816f, 0x607560, 0x485d48, 0x909c90, 0x486048, 0x7e8a7e, /* Codes 24-31 */
0x5d6f5d, 0x7b877b, 0x849384, 0x5a6c5a, 0x728172, 0x4b604b, 0x4b634b, 0x8d998d, /* Codes 32-39 */
0x939c93, 0x667866, 0x4e634e, 0x849084, 0x5a6f5a, 0x758475, 0x576957, 0x6c7b6c, /* Codes 40-47 */
0x516651, 0x5d725d, 0x697869, 0x4e664e, 0x728472, 0x879687, 0x425742, 0xfcfc3f, /* Codes 48-55 */
};
#elif CONFIG_NXWIDGETS_BPP == 16
// RGB16 (565) Colors (four of the colors in this map are duplicates)
static const uint16_t g_lcdClockNormalLut[BITMAP_NLUTCODES] =
{
0x8470, 0x7c4f, 0x742e, 0x7c2f, 0x740e, 0x7c4f, 0x3aa7, 0x0100, 0x5b6b, 0x63ac, /* Codes 0-9 */
0x3246, 0x534a, 0x21e4, 0x42a8, 0x5b4b, 0x0120, 0x3a87, 0x4b09, 0x2a25, 0x6bcd, /* Codes 10-19 */
0x740e, 0x638c, 0x532a, 0x0921, 0x0941, 0x19c3, 0x42c8, 0x2a45, 0x0941, 0x6bed, /* Codes 20-29 */
0x0961, 0x532a, 0x2a05, 0x530a, 0x5b8b, 0x21e4, 0x42c8, 0x1162, 0x1182, 0x6bcd, /* Codes 30-39 */
0x73ee, 0x3266, 0x1182, 0x5b6b, 0x2204, 0x4ae9, 0x21c4, 0x3a87, 0x19a3, 0x2a25, /* Codes 40-49 */
0x3a67, 0x11a2, 0x42e8, 0x63ac, 0x0100, 0xffe0, /* Codes 50-55 */
};
static const uint16_t g_lcdClockBrightLut[BITMAP_NLUTCODES] =
{
0x9d53, 0x9d33, 0x9512, 0x9d13, 0x94f2, 0x9d33, 0x6bed, 0x3aa7, 0x8490, 0x8cb1, /* Codes 0-9 */
0x63ac, 0x7c6f, 0x536a, 0x6bed, 0x8470, 0x42c8, 0x6bcd, 0x7c2f, 0x638c, 0x94d2, /* Codes 10-19 */
0x94f2, 0x8490, 0x7c4f, 0x42c8, 0x42e8, 0x534a, 0x6c0d, 0x63ac, 0x4ae9, 0x94f2, /* Codes 20-29 */
0x4b09, 0x7c4f, 0x5b6b, 0x7c2f, 0x8490, 0x5b6b, 0x740e, 0x4b09, 0x4b09, 0x8cd1, /* Codes 30-39 */
0x94f2, 0x63cc, 0x4b09, 0x8490, 0x5b6b, 0x742e, 0x534a, 0x6bcd, 0x532a, 0x5b8b, /* Codes 40-49 */
0x6bcd, 0x4b29, 0x742e, 0x84b0, 0x42a8, 0xffe7, /* Codes 50-55 */
};
#elif CONFIG_NXWIDGETS_BPP == 8
// 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.
///
# ifdef CONFIG_NXWIDGETS_GREYSCALE
// 8-bit Greyscale
static const uint8_t g_lcdClockNormalLut[BITMAP_NLUTCODES] =
{
0x87, 0x83, 0x7d, 0x7f, 0x7b, 0x81, 0x4a, 0x12, 0x63, 0x6d, 0x3e, 0x5f, 0x30, 0x4b, 0x61, 0x16, /* Codes 0-15 */
0x46, 0x57, 0x3a, 0x73, 0x79, 0x69, 0x5b, 0x18, 0x1a, 0x2c, 0x4e, 0x3c, 0x1c, 0x75, 0x1e, 0x5d, /* Codes 16-31 */
0x36, 0x59, 0x67, 0x32, 0x4f, 0x20, 0x22, 0x71, 0x77, 0x42, 0x24, 0x65, 0x34, 0x53, 0x2e, 0x47, /* Codes 32-47 */
0x28, 0x38, 0x43, 0x26, 0x52, 0x6b, 0x14, 0xdf, /* Codes 48-55 */
}
static const uint8_t g_lcdClockBrightLut[BITMAP_NLUTCODES] =
{
0xa4, 0xa1, 0x9d, 0x9e, 0x9b, 0xa0, 0x76, 0x4d, 0x89, 0x91, 0x6d, 0x86, 0x63, 0x77, 0x88, 0x50, /* Codes 0-15 */
0x73, 0x80, 0x6a, 0x95, 0x9a, 0x8e, 0x83, 0x51, 0x53, 0x60, 0x79, 0x6c, 0x54, 0x97, 0x56, 0x85, /* Codes 16-31 */
0x67, 0x82, 0x8c, 0x64, 0x7a, 0x57, 0x59, 0x94, 0x98, 0x70, 0x5a, 0x8b, 0x66, 0x7d, 0x61, 0x74, /* Codes 32-47 */
0x5d, 0x69, 0x71, 0x5c, 0x7c, 0x8f, 0x4e, 0xe6, /* Codes 48-55 */
};
# else /* CONFIG_NXWIDGETS_GREYSCALE */
// RGB8 (332) Colors
static const nxgl_mxpixel_t g_lcdClockNormalLut[BITMAP_NLUTCODES] =
{
0x92, 0x72, 0x71, 0x71, 0x71, 0x71, 0x29, 0x04, 0x4d, 0x6d, 0x28, 0x4d, 0x24, 0x49, 0x4d, 0x04, /* Codes 0-15 */
0x28, 0x4d, 0x28, 0x6d, 0x71, 0x6d, 0x4d, 0x04, 0x04, 0x04, 0x49, 0x28, 0x04, 0x6d, 0x04, 0x4d, /* Codes 16-31 */
0x28, 0x4d, 0x4d, 0x24, 0x49, 0x04, 0x04, 0x6d, 0x6d, 0x28, 0x04, 0x4d, 0x28, 0x49, 0x24, 0x29, /* Codes 32-47 */
0x04, 0x28, 0x28, 0x04, 0x49, 0x6d, 0x04, 0xfc, /* Codes 48-55 */
};
static const uint8_t g_lcdClockBrightLut[BITMAP_NLUTCODES] =
{
0xb6, 0x96, 0x96, 0x96, 0x96, 0x96, 0x71, 0x49, 0x92, 0x92, 0x6d, 0x92, 0x4d, 0x71, 0x92, 0x49, /* Codes 0-15 */
0x6d, 0x71, 0x6d, 0x92, 0x96, 0x92, 0x71, 0x49, 0x49, 0x4d, 0x71, 0x6d, 0x49, 0x92, 0x4d, 0x92, /* Codes 16-31 */
0x4d, 0x71, 0x92, 0x4d, 0x71, 0x4d, 0x4d, 0x92, 0x92, 0x6d, 0x4d, 0x92, 0x4d, 0x71, 0x4d, 0x6d, /* Codes 32-47 */
0x4d, 0x4d, 0x6d, 0x4d, 0x71, 0x92, 0x49, 0xfd, /* Codes 48-55 */
};
# endif
#else
# error Unsupported pixel format
#endif
static const struct SRlePaletteBitmapEntry g_lcdClockRleEntries[] =
{
{136, 0}, // Row 0
{136, 0}, // Row 1
{136, 0}, // Row 2
{136, 0}, // Row 3
{ 31, 0}, { 1, 1}, { 16, 2}, { 1, 1}, { 28, 0}, { 1, 1}, { 16, 2}, { 1, 3}, // Row 4
{ 41, 0},
{ 17, 0}, { 1, 1}, { 1, 4}, { 1, 3}, { 9, 0}, { 1, 5}, { 1, 4}, { 1, 6}, // Row 5
{ 16, 7}, { 1, 8}, { 1, 3}, { 2, 4}, { 1, 1}, { 22, 0}, { 1, 1}, { 1, 4},
{ 1, 9}, { 16, 7}, { 1, 10}, { 1, 1}, { 1, 3}, { 11, 0}, { 1, 3}, { 16, 4},
{ 1, 1}, { 10, 0},
{ 16, 0}, { 1, 1}, { 1, 11}, { 1, 7}, { 1, 12}, { 1, 2}, { 7, 0}, { 1, 3}, // Row 6
{ 1, 13}, { 18, 7}, { 1, 8}, { 1, 12}, { 2, 7}, { 1, 14}, { 1, 1}, { 20, 0},
{ 1, 1}, { 1, 9}, { 17, 7}, { 1, 15}, { 1, 16}, { 1, 17}, { 1, 10}, { 1, 3},
{ 9, 0}, { 1, 3}, { 1, 18}, { 16, 7}, { 1, 19}, { 1, 0}, { 1, 4}, { 1, 20},
{ 1, 1}, { 6, 0},
{ 16, 0}, { 1, 21}, { 3, 7}, { 1, 12}, { 1, 4}, { 6, 0}, { 1, 22}, { 1, 23}, // Row 7
{ 17, 7}, { 1, 24}, { 1, 11}, { 1, 25}, { 3, 7}, { 1, 9}, { 20, 0}, { 1, 4},
{ 17, 7}, { 1, 15}, { 1, 16}, { 1, 3}, { 1, 26}, { 1, 7}, { 1, 10}, { 1, 3},
{ 7, 0}, { 1, 3}, { 1, 27}, { 16, 7}, { 1, 28}, { 1, 29}, { 1, 20}, { 1, 30},
{ 1, 7}, { 1, 9}, { 1, 1}, { 5, 0},
{ 15, 0}, { 1, 1}, { 1, 31}, { 4, 7}, { 1, 32}, { 7, 0}, { 1, 33}, { 1, 24}, // Row 8
{ 15, 7}, { 1, 28}, { 1, 34}, { 1, 35}, { 4, 7}, { 1, 9}, { 20, 0}, { 1, 4},
{ 1, 30}, { 15, 7}, { 1, 15}, { 1, 16}, { 1, 3}, { 1, 36}, { 3, 7}, { 1, 16},
{ 7, 0}, { 1, 13}, { 1, 15}, { 15, 7}, { 1, 30}, { 1, 29}, { 1, 0}, { 1, 37},
{ 3, 7}, { 1, 4}, { 5, 0},
{ 15, 0}, { 1, 21}, { 5, 7}, { 1, 32}, { 8, 0}, { 1, 17}, { 1, 38}, { 1, 24}, // Row 9
{ 13, 7}, { 1, 14}, { 1, 20}, { 1, 25}, { 4, 7}, { 1, 9}, { 21, 0}, { 1, 4},
{ 1, 38}, { 1, 37}, { 13, 7}, { 1, 18}, { 1, 0}, { 1, 22}, { 4, 7}, { 1, 16},
{ 6, 0}, { 1, 4}, { 1, 29}, { 1, 16}, { 2, 38}, { 1, 15}, { 12, 7}, { 1, 39},
{ 1, 0}, { 1, 40}, { 1, 30}, { 3, 7}, { 1, 4}, { 5, 0},
{ 14, 0}, { 1, 1}, { 1, 22}, { 4, 7}, { 1, 15}, { 1, 41}, { 10, 0}, { 1, 17}, // Row 10
{ 1, 42}, { 1, 24}, { 10, 7}, { 1, 30}, { 1, 43}, { 1, 44}, { 5, 7}, { 1, 9},
{ 23, 0}, { 1, 40}, { 1, 37}, { 11, 7}, { 1, 15}, { 1, 16}, { 1, 3}, { 1, 26},
{ 4, 7}, { 1, 16}, { 5, 0}, { 1, 4}, { 1, 10}, { 1, 7}, { 1, 6}, { 1, 3},
{ 1, 0}, { 1, 6}, { 1, 23}, { 10, 7}, { 1, 37}, { 1, 19}, { 1, 0}, { 1, 42},
{ 4, 7}, { 1, 4}, { 5, 0},
{ 13, 0}, { 1, 5}, { 1, 22}, { 5, 7}, { 1, 44}, { 13, 0}, { 1, 45}, { 10, 42}, // Row 11
{ 1, 43}, { 1, 40}, { 1, 46}, { 5, 7}, { 1, 9}, { 24, 0}, { 1, 40}, { 11, 42},
{ 1, 16}, { 1, 0}, { 1, 22}, { 5, 7}, { 1, 16}, { 5, 0}, { 1, 16}, { 3, 7},
{ 1, 6}, { 1, 2}, { 1, 0}, { 1, 47}, { 10, 42}, { 1, 39}, { 1, 0}, { 1, 29},
{ 1, 37}, { 4, 7}, { 1, 4}, { 5, 0},
{ 13, 0}, { 1, 9}, { 6, 7}, { 1, 44}, { 25, 0}, { 1, 32}, { 6, 7}, { 1, 9}, // Row 12
{ 37, 0}, { 1, 2}, { 1, 26}, { 5, 7}, { 1, 16}, { 5, 0}, { 1, 16}, { 4, 7},
{ 1, 6}, { 1, 9}, { 1, 2}, { 11, 0}, { 1, 19}, { 1, 37}, { 5, 7}, { 1, 4},
{ 5, 0},
{ 13, 0}, { 1, 9}, { 6, 7}, { 1, 44}, { 24, 0}, { 1, 29}, { 1, 46}, { 5, 7}, // Row 13
{ 1, 42}, { 1, 39}, { 37, 0}, { 1, 31}, { 6, 7}, { 1, 16}, { 5, 0}, { 1, 16},
{ 6, 7}, { 1, 22}, { 11, 0}, { 1, 48}, { 6, 7}, { 1, 4}, { 5, 0},
{ 13, 0}, { 1, 9}, { 6, 7}, { 1, 44}, { 24, 0}, { 1, 49}, { 6, 7}, { 1, 21}, // Row 14
{ 38, 0}, { 1, 31}, { 5, 7}, { 1, 28}, { 1, 45}, { 5, 0}, { 1, 16}, { 5, 7},
{ 1, 37}, { 1, 43}, { 11, 0}, { 1, 48}, { 5, 7}, { 1, 48}, { 1, 3}, { 5, 0},
{ 13, 0}, { 1, 9}, { 6, 7}, { 1, 44}, { 24, 0}, { 1, 49}, { 6, 7}, { 1, 21}, // Row 15
{ 38, 0}, { 1, 31}, { 5, 7}, { 1, 50}, { 6, 0}, { 1, 16}, { 5, 7}, { 1, 22},
{ 12, 0}, { 1, 48}, { 5, 7}, { 1, 4}, { 6, 0},
{ 13, 0}, { 1, 9}, { 5, 7}, { 1, 24}, { 1, 6}, { 24, 0}, { 1, 49}, { 6, 7}, // Row 16
{ 1, 21}, { 37, 0}, { 1, 4}, { 1, 6}, { 5, 7}, { 1, 50}, { 6, 0}, { 1, 16},
{ 5, 7}, { 1, 22}, { 12, 0}, { 1, 48}, { 5, 7}, { 1, 4}, { 6, 0},
{ 12, 0}, { 1, 3}, { 1, 45}, { 5, 7}, { 1, 35}, { 25, 0}, { 1, 49}, { 6, 7}, // Row 17
{ 1, 21}, { 37, 0}, { 1, 11}, { 6, 7}, { 1, 50}, { 5, 0}, { 1, 29}, { 1, 49},
{ 5, 7}, { 1, 22}, { 11, 0}, { 1, 9}, { 1, 37}, { 5, 7}, { 1, 4}, { 6, 0},
{ 12, 0}, { 1, 39}, { 6, 7}, { 1, 35}, { 25, 0}, { 1, 49}, { 6, 7}, { 1, 21}, // Row 18
{ 37, 0}, { 1, 11}, { 6, 7}, { 1, 50}, { 5, 0}, { 1, 6}, { 6, 7}, { 1, 22},
{ 11, 0}, { 1, 48}, { 6, 7}, { 1, 4}, { 6, 0},
{ 12, 0}, { 1, 39}, { 6, 7}, { 1, 35}, { 25, 0}, { 1, 49}, { 6, 7}, { 1, 21}, // Row 19
{ 37, 0}, { 1, 11}, { 6, 7}, { 1, 50}, { 5, 0}, { 1, 6}, { 6, 7}, { 1, 22},
{ 11, 0}, { 1, 48}, { 6, 7}, { 1, 4}, { 6, 0},
{ 12, 0}, { 1, 39}, { 6, 7}, { 1, 35}, { 25, 0}, { 1, 49}, { 5, 7}, { 1, 25}, // Row 20
{ 1, 19}, { 37, 0}, { 1, 11}, { 6, 7}, { 1, 50}, { 5, 0}, { 1, 6}, { 6, 7},
{ 1, 22}, { 11, 0}, { 1, 48}, { 6, 7}, { 1, 4}, { 6, 0},
{ 12, 0}, { 1, 39}, { 6, 7}, { 1, 35}, { 24, 0}, { 1, 9}, { 1, 25}, { 5, 7}, // Row 21
{ 1, 21}, { 38, 0}, { 1, 11}, { 6, 7}, { 1, 50}, { 5, 0}, { 1, 6}, { 6, 7},
{ 1, 22}, { 11, 0}, { 1, 48}, { 6, 7}, { 1, 4}, { 6, 0},
{ 12, 0}, { 1, 39}, { 6, 7}, { 1, 35}, { 24, 0}, { 1, 18}, { 6, 7}, { 1, 21}, // Row 22
{ 37, 0}, { 1, 20}, { 1, 50}, { 5, 7}, { 1, 38}, { 1, 22}, { 5, 0}, { 1, 6},
{ 6, 7}, { 1, 22}, { 11, 0}, { 1, 48}, { 5, 7}, { 1, 32}, { 1, 3}, { 6, 0},
{ 11, 0}, { 1, 3}, { 1, 26}, { 5, 7}, { 1, 28}, { 1, 36}, { 24, 0}, { 1, 18}, // Row 23
{ 6, 7}, { 1, 21}, { 37, 0}, { 1, 14}, { 6, 7}, { 1, 41}, { 5, 0}, { 1, 39},
{ 1, 44}, { 5, 7}, { 1, 25}, { 1, 21}, { 10, 0}, { 1, 8}, { 1, 37}, { 5, 7},
{ 1, 20}, { 7, 0},
{ 11, 0}, { 1, 39}, { 6, 7}, { 1, 12}, { 25, 0}, { 1, 18}, { 6, 7}, { 1, 21}, // Row 24
{ 37, 0}, { 1, 14}, { 6, 7}, { 1, 41}, { 5, 0}, { 1, 6}, { 6, 7}, { 1, 17},
{ 11, 0}, { 1, 48}, { 6, 7}, { 1, 20}, { 7, 0},
{ 11, 0}, { 1, 39}, { 6, 7}, { 1, 12}, { 25, 0}, { 1, 18}, { 6, 7}, { 1, 21}, // Row 25
{ 37, 0}, { 1, 14}, { 6, 7}, { 1, 41}, { 5, 0}, { 1, 6}, { 6, 7}, { 1, 17},
{ 11, 0}, { 1, 48}, { 6, 7}, { 1, 20}, { 7, 0},
{ 11, 0}, { 1, 39}, { 6, 7}, { 1, 12}, { 25, 0}, { 1, 18}, { 6, 7}, { 1, 21}, // Row 26
{ 37, 0}, { 1, 14}, { 6, 7}, { 1, 41}, { 5, 0}, { 1, 6}, { 6, 7}, { 1, 17},
{ 11, 0}, { 1, 48}, { 6, 7}, { 1, 20}, { 7, 0},
{ 11, 0}, { 1, 39}, { 6, 7}, { 1, 12}, { 25, 0}, { 1, 18}, { 6, 7}, { 1, 21}, // Row 27
{ 37, 0}, { 1, 14}, { 6, 7}, { 1, 41}, { 5, 0}, { 1, 6}, { 6, 7}, { 1, 17},
{ 11, 0}, { 1, 48}, { 6, 7}, { 1, 20}, { 7, 0},
{ 11, 0}, { 1, 4}, { 1, 18}, { 5, 7}, { 1, 12}, { 25, 0}, { 1, 18}, { 5, 7}, // Row 28
{ 1, 49}, { 1, 29}, { 37, 0}, { 1, 14}, { 5, 7}, { 1, 42}, { 1, 11}, { 5, 0},
{ 1, 6}, { 5, 7}, { 1, 12}, { 1, 9}, { 11, 0}, { 1, 48}, { 6, 7}, { 1, 20},
{ 7, 0},
{ 12, 0}, { 1, 20}, { 1, 27}, { 4, 7}, { 1, 12}, { 11, 0}, { 1, 9}, { 13, 36}, // Row 29
{ 1, 6}, { 1, 16}, { 1, 38}, { 3, 7}, { 1, 34}, { 25, 0}, { 1, 3}, { 11, 36},
{ 1, 11}, { 1, 39}, { 1, 44}, { 4, 7}, { 1, 41}, { 5, 0}, { 1, 21}, { 1, 12},
{ 3, 7}, { 1, 12}, { 1, 16}, { 1, 9}, { 1, 43}, { 10, 36}, { 1, 20}, { 1, 45},
{ 1, 28}, { 5, 7}, { 1, 20}, { 7, 0},
{ 13, 0}, { 1, 20}, { 1, 10}, { 3, 7}, { 1, 12}, { 9, 0}, { 1, 9}, { 1, 26}, // Row 30
{ 1, 35}, { 13, 7}, { 1, 18}, { 1, 19}, { 1, 22}, { 1, 38}, { 2, 7}, { 1, 34},
{ 24, 0}, { 1, 3}, { 1, 16}, { 11, 7}, { 1, 42}, { 1, 26}, { 1, 13}, { 1, 47},
{ 1, 44}, { 2, 7}, { 1, 41}, { 5, 0}, { 1, 13}, { 3, 7}, { 1, 12}, { 1, 21},
{ 1, 43}, { 1, 26}, { 1, 48}, { 10, 7}, { 1, 41}, { 1, 26}, { 1, 6}, { 1, 47},
{ 1, 24}, { 2, 7}, { 1, 41}, { 1, 3}, { 7, 0},
{ 14, 0}, { 1, 20}, { 1, 10}, { 2, 7}, { 1, 12}, { 8, 0}, { 1, 9}, { 1, 44}, // Row 31
{ 16, 7}, { 1, 49}, { 2, 13}, { 1, 37}, { 1, 7}, { 1, 34}, { 22, 0}, { 1, 5},
{ 1, 13}, { 1, 16}, { 14, 7}, { 1, 42}, { 1, 11}, { 1, 39}, { 1, 44}, { 1, 7},
{ 1, 41}, { 5, 0}, { 1, 13}, { 2, 7}, { 1, 12}, { 1, 21}, { 1, 43}, { 1, 48},
{ 14, 7}, { 1, 41}, { 1, 4}, { 1, 45}, { 1, 24}, { 1, 7}, { 1, 40}, { 8, 0},
{ 15, 0}, { 1, 20}, { 2, 13}, { 1, 22}, { 7, 0}, { 1, 9}, { 1, 44}, { 19, 7}, // Row 32
{ 1, 14}, { 1, 22}, { 1, 13}, { 1, 40}, { 20, 0}, { 1, 1}, { 1, 6}, { 1, 16},
{ 17, 7}, { 1, 42}, { 1, 11}, { 1, 39}, { 1, 13}, { 1, 8}, { 5, 0}, { 1, 21},
{ 3, 13}, { 1, 6}, { 1, 48}, { 16, 7}, { 1, 10}, { 1, 6}, { 2, 13}, { 1, 3},
{ 8, 0},
{ 15, 0}, { 1, 40}, { 1, 47}, { 1, 17}, { 5, 0}, { 1, 39}, { 2, 47}, { 1, 6}, // Row 33
{ 1, 26}, { 1, 44}, { 17, 7}, { 1, 18}, { 1, 29}, { 23, 0}, { 1, 1}, { 1, 6},
{ 18, 7}, { 1, 51}, { 1, 14}, { 1, 9}, { 1, 47}, { 1, 14}, { 8, 0}, { 1, 16},
{ 18, 7}, { 1, 41}, { 1, 26}, { 1, 2}, { 1, 36}, { 1, 3}, { 8, 0},
{ 13, 0}, { 1, 20}, { 1, 16}, { 1, 18}, { 1, 7}, { 1, 12}, { 5, 0}, { 1, 31}, // Row 34
{ 2, 7}, { 1, 42}, { 1, 11}, { 1, 9}, { 1, 44}, { 14, 7}, { 1, 18}, { 1, 36},
{ 1, 29}, { 25, 0}, { 1, 1}, { 1, 6}, { 15, 7}, { 1, 42}, { 1, 36}, { 1, 13},
{ 1, 16}, { 1, 35}, { 1, 7}, { 1, 41}, { 8, 0}, { 1, 21}, { 1, 25}, { 16, 7},
{ 1, 41}, { 1, 4}, { 1, 52}, { 1, 16}, { 1, 23}, { 1, 40}, { 8, 0},
{ 11, 0}, { 1, 4}, { 1, 16}, { 1, 18}, { 3, 7}, { 1, 12}, { 5, 0}, { 1, 31}, // Row 35
{ 3, 7}, { 1, 42}, { 1, 11}, { 1, 9}, { 1, 44}, { 12, 7}, { 1, 18}, { 1, 19},
{ 28, 0}, { 1, 5}, { 1, 52}, { 1, 6}, { 11, 7}, { 1, 42}, { 1, 52}, { 1, 14},
{ 1, 39}, { 1, 35}, { 3, 7}, { 1, 41}, { 9, 0}, { 1, 21}, { 1, 25}, { 13, 7},
{ 1, 41}, { 1, 52}, { 1, 47}, { 1, 16}, { 1, 24}, { 2, 7}, { 1, 40}, { 8, 0},
{ 10, 0}, { 1, 4}, { 1, 18}, { 5, 7}, { 1, 12}, { 5, 0}, { 1, 31}, { 4, 7}, // Row 36
{ 1, 42}, { 1, 41}, { 1, 6}, { 12, 45}, { 1, 19}, { 31, 0}, { 1, 3}, { 11, 45},
{ 1, 14}, { 1, 39}, { 1, 41}, { 1, 35}, { 4, 7}, { 1, 41}, { 10, 0}, { 1, 21},
{ 13, 45}, { 1, 16}, { 1, 41}, { 1, 24}, { 4, 7}, { 1, 40}, { 8, 0},
{ 9, 0}, { 1, 4}, { 1, 18}, { 6, 7}, { 1, 12}, { 5, 0}, { 1, 31}, { 6, 7}, // Row 37
{ 1, 16}, { 56, 0}, { 1, 39}, { 1, 35}, { 5, 7}, { 1, 25}, { 1, 21}, { 23, 0},
{ 1, 52}, { 1, 28}, { 6, 7}, { 1, 40}, { 8, 0},
{ 9, 0}, { 1, 29}, { 7, 7}, { 1, 12}, { 5, 0}, { 1, 31}, { 6, 7}, { 1, 16}, // Row 38
{ 56, 0}, { 1, 8}, { 6, 7}, { 1, 10}, { 24, 0}, { 1, 25}, { 7, 7}, { 1, 40},
{ 8, 0},
{ 9, 0}, { 1, 29}, { 6, 7}, { 1, 38}, { 1, 43}, { 4, 0}, { 1, 9}, { 1, 46}, // Row 39
{ 6, 7}, { 1, 16}, { 56, 0}, { 1, 8}, { 6, 7}, { 1, 10}, { 24, 0}, { 1, 25},
{ 7, 7}, { 1, 40}, { 8, 0},
{ 9, 0}, { 1, 29}, { 6, 7}, { 1, 25}, { 5, 0}, { 1, 11}, { 7, 7}, { 1, 16}, // Row 40
{ 56, 0}, { 1, 8}, { 6, 7}, { 1, 10}, { 24, 0}, { 1, 25}, { 6, 7}, { 1, 36},
{ 1, 3}, { 8, 0},
{ 9, 0}, { 1, 29}, { 6, 7}, { 1, 25}, { 5, 0}, { 1, 11}, { 6, 7}, { 1, 35}, // Row 41
{ 1, 9}, { 56, 0}, { 1, 8}, { 6, 7}, { 1, 10}, { 24, 0}, { 1, 25}, { 6, 7},
{ 1, 29}, { 9, 0},
{ 9, 0}, { 1, 29}, { 6, 7}, { 1, 25}, { 5, 0}, { 1, 11}, { 6, 7}, { 1, 50}, // Row 42
{ 57, 0}, { 1, 8}, { 6, 7}, { 1, 10}, { 24, 0}, { 1, 25}, { 6, 7}, { 1, 29},
{ 9, 0},
{ 9, 0}, { 1, 29}, { 6, 7}, { 1, 25}, { 5, 0}, { 1, 11}, { 6, 7}, { 1, 50}, // Row 43
{ 56, 0}, { 1, 39}, { 1, 25}, { 6, 7}, { 1, 10}, { 24, 0}, { 1, 25}, { 6, 7},
{ 1, 29}, { 9, 0},
{ 8, 0}, { 1, 4}, { 1, 12}, { 6, 7}, { 1, 25}, { 5, 0}, { 1, 11}, { 6, 7}, // Row 44
{ 1, 50}, { 56, 0}, { 1, 43}, { 7, 7}, { 1, 10}, { 24, 0}, { 1, 25}, { 6, 7},
{ 1, 29}, { 9, 0},
{ 8, 0}, { 1, 40}, { 7, 7}, { 1, 25}, { 5, 0}, { 1, 11}, { 6, 7}, { 1, 50}, // Row 45
{ 56, 0}, { 1, 43}, { 6, 7}, { 1, 12}, { 1, 39}, { 23, 0}, { 1, 47}, { 1, 24},
{ 6, 7}, { 1, 29}, { 9, 0},
{ 8, 0}, { 1, 40}, { 7, 7}, { 1, 25}, { 5, 0}, { 1, 11}, { 6, 7}, { 1, 50}, // Row 46
{ 56, 0}, { 1, 43}, { 6, 7}, { 1, 10}, { 24, 0}, { 1, 12}, { 7, 7}, { 1, 29},
{ 9, 0},
{ 8, 0}, { 1, 40}, { 6, 7}, { 1, 42}, { 1, 9}, { 4, 0}, { 1, 21}, { 1, 42}, // Row 47
{ 6, 7}, { 1, 50}, { 56, 0}, { 1, 43}, { 6, 7}, { 1, 10}, { 24, 0}, { 1, 12},
{ 6, 7}, { 1, 22}, { 1, 5}, { 9, 0},
{ 8, 0}, { 1, 40}, { 6, 7}, { 1, 25}, { 5, 0}, { 1, 14}, { 7, 7}, { 1, 50}, // Row 48
{ 56, 0}, { 1, 43}, { 6, 7}, { 1, 10}, { 24, 0}, { 1, 12}, { 6, 7}, { 1, 19},
{ 10, 0},
{ 8, 0}, { 1, 40}, { 6, 7}, { 1, 25}, { 5, 0}, { 1, 14}, { 6, 7}, { 1, 32}, // Row 49
{ 1, 40}, { 56, 0}, { 1, 43}, { 6, 7}, { 1, 10}, { 24, 0}, { 1, 12}, { 6, 7},
{ 1, 19}, { 10, 0},
{ 8, 0}, { 1, 40}, { 6, 7}, { 1, 25}, { 5, 0}, { 1, 14}, { 6, 7}, { 1, 41}, // Row 50
{ 57, 0}, { 1, 43}, { 6, 7}, { 1, 10}, { 24, 0}, { 1, 12}, { 6, 7}, { 1, 19},
{ 10, 0},
{ 8, 0}, { 1, 40}, { 6, 7}, { 1, 25}, { 5, 0}, { 1, 14}, { 6, 7}, { 1, 41}, // Row 51
{ 57, 0}, { 1, 43}, { 6, 7}, { 1, 10}, { 24, 0}, { 1, 12}, { 6, 7}, { 1, 19},
{ 10, 0},
{ 8, 0}, { 1, 40}, { 6, 7}, { 1, 25}, { 5, 0}, { 1, 14}, { 3, 7}, { 1, 44}, // Row 52
{ 2, 39}, { 1, 20}, { 57, 0}, { 1, 43}, { 6, 7}, { 1, 10}, { 24, 0}, { 1, 12},
{ 6, 7}, { 1, 19}, { 10, 0},
{ 8, 0}, { 1, 40}, { 6, 7}, { 1, 25}, { 5, 0}, { 1, 14}, { 1, 12}, { 2, 39}, // Row 53
{ 1, 20}, { 1, 11}, { 1, 42}, { 1, 26}, { 57, 0}, { 1, 43}, { 6, 7}, { 1, 10},
{ 24, 0}, { 1, 12}, { 6, 7}, { 1, 19}, { 10, 0},
{ 8, 0}, { 1, 40}, { 6, 7}, { 1, 25}, { 5, 0}, { 1, 3}, { 1, 20}, { 1, 8}, // Row 54
{ 2, 38}, { 1, 28}, { 1, 7}, { 1, 23}, { 11, 38}, { 1, 31}, { 28, 0}, { 1, 1},
{ 15, 38}, { 1, 27}, { 1, 5}, { 1, 17}, { 4, 7}, { 1, 44}, { 1, 4}, { 8, 0},
{ 1, 45}, { 13, 38}, { 1, 21}, { 1, 0}, { 1, 20}, { 1, 48}, { 5, 7}, { 1, 19},
{ 10, 0},
{ 8, 0}, { 1, 1}, { 1, 34}, { 4, 7}, { 1, 48}, { 1, 20}, { 5, 0}, { 1, 43}, // Row 55
{ 1, 37}, { 1, 24}, { 16, 7}, { 1, 17}, { 26, 0}, { 3, 37}, { 15, 7}, { 1, 15},
{ 1, 27}, { 1, 8}, { 4, 7}, { 1, 18}, { 6, 0}, { 1, 17}, { 2, 37}, { 1, 23},
{ 13, 7}, { 1, 28}, { 1, 37}, { 1, 53}, { 1, 25}, { 5, 7}, { 1, 19}, { 10, 0},
{ 9, 0}, { 1, 29}, { 4, 7}, { 1, 48}, { 6, 0}, { 1, 14}, { 18, 7}, { 1, 24}, // Row 56
{ 1, 31}, { 25, 0}, { 19, 7}, { 1, 12}, { 1, 8}, { 4, 7}, { 1, 18}, { 5, 0},
{ 1, 17}, { 1, 23}, { 18, 7}, { 1, 34}, { 1, 4}, { 1, 48}, { 3, 7}, { 1, 43},
{ 1, 1}, { 10, 0},
{ 9, 0}, { 1, 1}, { 1, 21}, { 2, 7}, { 1, 42}, { 1, 4}, { 6, 0}, { 1, 14}, // Row 57
{ 19, 7}, { 1, 17}, { 25, 0}, { 19, 7}, { 1, 54}, { 1, 49}, { 1, 22}, { 3, 7},
{ 1, 18}, { 5, 0}, { 1, 52}, { 19, 7}, { 1, 24}, { 1, 9}, { 1, 25}, { 3, 7},
{ 1, 39}, { 11, 0},
{ 10, 0}, { 1, 19}, { 2, 7}, { 1, 48}, { 7, 0}, { 1, 14}, { 19, 7}, { 1, 15}, // Row 58
{ 1, 31}, { 24, 0}, { 1, 4}, { 19, 7}, { 1, 35}, { 1, 14}, { 2, 7}, { 1, 32},
{ 1, 3}, { 5, 0}, { 1, 5}, { 1, 6}, { 19, 7}, { 1, 21}, { 1, 25}, { 2, 7},
{ 1, 34}, { 1, 1}, { 11, 0},
{ 10, 0}, { 1, 1}, { 1, 21}, { 1, 42}, { 1, 3}, { 7, 0}, { 1, 1}, { 1, 33}, // Row 59
{ 19, 7}, { 1, 22}, { 25, 0}, { 1, 2}, { 19, 7}, { 1, 15}, { 1, 7}, { 1, 44},
{ 1, 3}, { 7, 0}, { 1, 36}, { 19, 7}, { 1, 15}, { 2, 7}, { 1, 34}, { 1, 1},
{ 12, 0},
{ 11, 0}, { 1, 1}, { 1, 3}, { 9, 0}, { 1, 1}, { 1, 3}, { 1, 17}, { 17, 7}, // Row 60
{ 1, 15}, { 1, 31}, { 24, 0}, { 1, 1}, { 19, 7}, { 1, 35}, { 1, 3}, { 1, 5},
{ 8, 0}, { 1, 1}, { 1, 3}, { 1, 6}, { 18, 7}, { 1, 43}, { 1, 3}, { 1, 1},
{ 13, 0},
{ 24, 0}, { 1, 1}, { 18, 5}, { 1, 1}, { 25, 0}, { 2, 5}, { 1, 4}, { 15, 7}, // Row 61
{ 1, 12}, { 1, 1}, { 12, 0}, { 1, 1}, { 1, 47}, { 17, 7}, { 1, 21}, { 15, 0},
{ 72, 0}, { 16, 1}, { 14, 0}, { 19, 1}, { 15, 0}, // Row 62
{ 1, 55}, {135, 0}, // Row 63
};
/********************************************************************************************
* Public Bitmap Structure Definitions
********************************************************************************************/
const struct SRlePaletteBitmap NXWidgets::g_lcdClockBitmap =
{
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_lcdClockNormalLut, // Index 0: Unselected LUT
g_lcdClockBrightLut, // Index 1: Selected LUT
},
g_lcdClockRleEntries // data - Pointer to the beginning of the RLE data
};

View File

@ -0,0 +1,254 @@
/********************************************************************************************
* apps/graphics/nxglyphs/src/glyph_lcdclock51x24.cxx
*
* Copyright (C) 2019 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include "graphics/nxwidgets/crlepalettebitmap.hxx"
#include "graphics/nxglyphs.hxx"
/********************************************************************************************
* Pre-Processor Definitions
********************************************************************************************/
#define BITMAP_NROWS 24
#define BITMAP_NCOLUMNS 51
#define BITMAP_NLUTCODES 51
/********************************************************************************************
* Private Bitmap Data
********************************************************************************************/
using namespace NXWidgets;
#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32
// RGB24 (8-8-8) Colors
static const uint32_t g_lcdClockNormalLut[BITMAP_NLUTCODES] =
{
0x808c80, 0x7c887c, 0x5c6c5c, 0x607060, 0x788478, 0x687868, 0x707c70, 0x485c48, /* Codes 0-7 */
0x445844, 0x6c786c, 0x0c2c0c, 0x042404, 0x102c10, 0x284028, 0x082808, 0x0c280c, /* Codes 8-15 */
0x344c34, 0x244024, 0x647464, 0x002000, 0x304830, 0x143014, 0x203820, 0x183418, /* Codes 16-23 */
0x2c442c, 0x203c20, 0x4c604c, 0x3c543c, 0x506450, 0x1c381c, 0x405840, 0x082408, /* Codes 24-31 */
0x748074, 0x385038, 0x103010, 0x788878, 0x586c58, 0x042004, 0x486048, 0x546854, /* Codes 32-39 */
0x3c503c, 0x708070, 0x546454, 0x6c7c6c, 0x243c24, 0x748474, 0x405440, 0x445c44, /* Codes 40-47 */
0x2c482c, 0x5c705c, 0x90986c, /* Codes 48-50 */
};
static const uint32_t g_lcdClockBrightLut[BITMAP_NLUTCODES] =
{
0x9fa89f, 0x9ca59c, 0x849084, 0x879387, 0x99a299, 0x8d998d, 0x939c93, 0x758475, /* Codes 0-7 */
0x728172, 0x909990, 0x486048, 0x425a42, 0x4b604b, 0x5d6f5d, 0x455d45, 0x485d48, /* Codes 8-15 */
0x667866, 0x5a6f5a, 0x8a968a, 0x3f573f, 0x637563, 0x4e634e, 0x576957, 0x516651, /* Codes 16-23 */
0x607260, 0x576c57, 0x788778, 0x6c7e6c, 0x7b8a7b, 0x546954, 0x6f816f, 0x455a45, /* Codes 24-31 */
0x969f96, 0x697b69, 0x4b634b, 0x99a599, 0x819081, 0x425742, 0x758775, 0x7e8d7e, /* Codes 32-39 */
0x6c7b6c, 0x939f93, 0x7e8a7e, 0x909c90, 0x5a6c5a, 0x96a296, 0x6f7e6f, 0x728472, /* Codes 40-47 */
0x607560, 0x849384, 0xabb190, /* Codes 48-50 */
};
#elif CONFIG_NXWIDGETS_BPP == 16
// RGB16 (565) Colors (four of the colors in this map are duplicates)
static const uint16_t g_lcdClockNormalLut[BITMAP_NLUTCODES] =
{
0x8470, 0x7c4f, 0x5b6b, 0x638c, 0x7c2f, 0x6bcd, 0x73ee, 0x4ae9, 0x42c8, 0x6bcd, /* Codes 0-9 */
0x0961, 0x0120, 0x1162, 0x2a05, 0x0941, 0x0941, 0x3266, 0x2204, 0x63ac, 0x0100, /* Codes 10-19 */
0x3246, 0x1182, 0x21c4, 0x19a3, 0x2a25, 0x21e4, 0x4b09, 0x3aa7, 0x532a, 0x19c3, /* Codes 20-29 */
0x42c8, 0x0921, 0x740e, 0x3a87, 0x1182, 0x7c4f, 0x5b6b, 0x0100, 0x4b09, 0x534a, /* Codes 30-39 */
0x3a87, 0x740e, 0x532a, 0x6bed, 0x21e4, 0x742e, 0x42a8, 0x42e8, 0x2a45, 0x5b8b, /* Codes 40-49 */
0x94cd, /* Codes 50-50 */
};
static const uint16_t g_lcdClockBrightLut[BITMAP_NLUTCODES] =
{
0x9d53, 0x9d33, 0x8490, 0x8490, 0x9d13, 0x8cd1, 0x94f2, 0x742e, 0x740e, 0x94d2, /* Codes 0-9 */
0x4b09, 0x42c8, 0x4b09, 0x5b6b, 0x42e8, 0x4ae9, 0x63cc, 0x5b6b, 0x8cb1, 0x3aa7, /* Codes 10-19 */
0x63ac, 0x4b09, 0x534a, 0x532a, 0x638c, 0x536a, 0x7c2f, 0x6bed, 0x7c4f, 0x534a, /* Codes 20-29 */
0x6c0d, 0x42c8, 0x94f2, 0x6bcd, 0x4b09, 0x9d33, 0x8490, 0x42a8, 0x742e, 0x7c6f, /* Codes 30-39 */
0x6bcd, 0x94f2, 0x7c4f, 0x94f2, 0x5b6b, 0x9512, 0x6bed, 0x742e, 0x63ac, 0x8490, /* Codes 40-49 */
0xad92, /* Codes 50-50 */
};
#elif CONFIG_NXWIDGETS_BPP == 8
// 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.
///
# ifdef CONFIG_NXWIDGETS_GREYSCALE
// 8-bit Greyscale
static const uint8_t g_lcdClockNormalLut[BITMAP_NLUTCODES] =
{
0x87, 0x83, 0x65, 0x69, 0x7f, 0x71, 0x77, 0x53, 0x4f, 0x73, 0x1e, 0x16, 0x20, 0x36, 0x1a, 0x1c, /* Codes 0-15 */
0x42, 0x34, 0x6d, 0x12, 0x3e, 0x24, 0x2e, 0x28, 0x3a, 0x30, 0x57, 0x4a, 0x5b, 0x2c, 0x4e, 0x18, /* Codes 16-31 */
0x7b, 0x46, 0x22, 0x81, 0x63, 0x14, 0x56, 0x5f, 0x47, 0x79, 0x5d, 0x75, 0x32, 0x7d, 0x4b, 0x52, /* Codes 32-47 */
0x3c, 0x67, 0x90, /* Codes 48-50 */
}
static const uint8_t g_lcdClockBrightLut[BITMAP_NLUTCODES] =
{
0xa4, 0xa1, 0x8b, 0x8e, 0x9e, 0x94, 0x98, 0x7d, 0x7a, 0x95, 0x56, 0x50, 0x57, 0x67, 0x53, 0x54, /* Codes 0-15 */
0x70, 0x66, 0x91, 0x4d, 0x6d, 0x5a, 0x61, 0x5d, 0x6a, 0x63, 0x80, 0x76, 0x83, 0x60, 0x79, 0x51, /* Codes 16-31 */
0x9b, 0x73, 0x59, 0xa0, 0x89, 0x4e, 0x7f, 0x86, 0x74, 0x9a, 0x85, 0x97, 0x64, 0x9d, 0x77, 0x7c, /* Codes 32-47 */
0x6c, 0x8c, 0xab, /* Codes 48-50 */
};
# else /* CONFIG_NXWIDGETS_GREYSCALE */
// RGB8 (332) Colors
static const nxgl_mxpixel_t g_lcdClockNormalLut[BITMAP_NLUTCODES] =
{
0x92, 0x72, 0x4d, 0x6d, 0x71, 0x6d, 0x6d, 0x49, 0x49, 0x6d, 0x04, 0x04, 0x04, 0x28, 0x04, 0x04, /* Codes 0-15 */
0x28, 0x28, 0x6d, 0x04, 0x28, 0x04, 0x24, 0x04, 0x28, 0x24, 0x4d, 0x29, 0x4d, 0x04, 0x49, 0x04, /* Codes 16-31 */
0x71, 0x28, 0x04, 0x71, 0x4d, 0x04, 0x4d, 0x4d, 0x29, 0x71, 0x4d, 0x6d, 0x24, 0x71, 0x49, 0x49, /* Codes 32-47 */
0x28, 0x4d, 0x91, /* Codes 48-50 */
};
static const uint8_t g_lcdClockBrightLut[BITMAP_NLUTCODES] =
{
0xb6, 0x96, 0x92, 0x92, 0x96, 0x92, 0x92, 0x71, 0x71, 0x92, 0x4d, 0x49, 0x4d, 0x4d, 0x49, 0x49, /* Codes 0-15 */
0x6d, 0x4d, 0x92, 0x49, 0x6d, 0x4d, 0x4d, 0x4d, 0x6d, 0x4d, 0x71, 0x71, 0x71, 0x4d, 0x71, 0x49, /* Codes 16-31 */
0x96, 0x6d, 0x4d, 0x96, 0x92, 0x49, 0x71, 0x92, 0x6d, 0x96, 0x92, 0x92, 0x4d, 0x96, 0x71, 0x71, /* Codes 32-47 */
0x6d, 0x92, 0xb6, /* Codes 48-50 */
};
# endif
#else
# error Unsupported pixel format
#endif
static const struct SRlePaletteBitmapEntry g_lcdClockRleEntries[] =
{
{ 51, 0}, // Row 0
{ 11, 0}, { 1, 1}, { 5, 2}, { 1, 3}, { 1, 4}, { 9, 0}, { 1, 1}, { 1, 5}, // Row 1
{ 5, 2}, { 1, 6}, { 15, 0},
{ 6, 0}, { 1, 7}, { 1, 8}, { 2, 0}, { 1, 9}, { 1, 10}, { 5, 11}, { 1, 12}, // Row 2
{ 2, 13}, { 8, 0}, { 1, 13}, { 1, 14}, { 4, 11}, { 1, 15}, { 1, 16}, { 1, 3},
{ 3, 0}, { 1, 7}, { 5, 10}, { 1, 17}, { 1, 2}, { 1, 18}, { 2, 0},
{ 5, 0}, { 1, 4}, { 1, 12}, { 1, 11}, { 3, 0}, { 1, 16}, { 1, 12}, { 4, 19}, // Row 3
{ 1, 20}, { 1, 21}, { 1, 19}, { 8, 0}, { 1, 16}, { 1, 15}, { 4, 19}, { 1, 16},
{ 1, 17}, { 1, 19}, { 2, 0}, { 1, 5}, { 1, 22}, { 1, 12}, { 4, 19}, { 1, 7},
{ 1, 23}, { 1, 10}, { 2, 0},
{ 5, 0}, { 1, 24}, { 1, 19}, { 1, 25}, { 3, 0}, { 1, 1}, { 1, 5}, { 4, 26}, // Row 4
{ 1, 27}, { 2, 19}, { 8, 0}, { 1, 1}, { 1, 3}, { 4, 26}, { 1, 28}, { 1, 11},
{ 1, 19}, { 2, 0}, { 1, 21}, { 1, 29}, { 1, 8}, { 4, 26}, { 1, 30}, { 1, 11},
{ 1, 10}, { 2, 0},
{ 5, 0}, { 1, 31}, { 1, 19}, { 1, 13}, { 9, 0}, { 2, 19}, { 1, 16}, { 14, 0}, // Row 5
{ 1, 16}, { 1, 19}, { 1, 23}, { 2, 0}, { 1, 31}, { 1, 19}, { 1, 27}, { 3, 0},
{ 1, 1}, { 1, 17}, { 1, 19}, { 1, 13}, { 2, 0},
{ 4, 0}, { 1, 32}, { 1, 11}, { 1, 19}, { 1, 8}, { 9, 0}, { 2, 19}, { 1, 33}, // Row 6
{ 14, 0}, { 1, 34}, { 1, 19}, { 1, 33}, { 1, 0}, { 1, 32}, { 1, 11}, { 1, 19},
{ 1, 28}, { 3, 0}, { 1, 35}, { 1, 23}, { 1, 19}, { 1, 7}, { 2, 0},
{ 4, 0}, { 1, 36}, { 1, 37}, { 1, 19}, { 1, 28}, { 9, 0}, { 2, 19}, { 1, 7}, // Row 7
{ 14, 0}, { 2, 19}, { 1, 33}, { 1, 0}, { 1, 36}, { 1, 37}, { 1, 19}, { 1, 28},
{ 3, 0}, { 1, 4}, { 2, 19}, { 1, 7}, { 2, 0},
{ 4, 0}, { 1, 36}, { 1, 37}, { 1, 19}, { 1, 28}, { 8, 0}, { 1, 38}, { 2, 19}, // Row 8
{ 1, 6}, { 13, 0}, { 1, 18}, { 2, 19}, { 1, 39}, { 1, 0}, { 1, 36}, { 1, 37},
{ 1, 19}, { 1, 28}, { 3, 0}, { 1, 4}, { 2, 19}, { 1, 18}, { 2, 0},
{ 4, 0}, { 1, 16}, { 1, 19}, { 1, 34}, { 1, 5}, { 8, 0}, { 1, 38}, { 2, 19}, // Row 9
{ 1, 6}, { 13, 0}, { 1, 38}, { 2, 19}, { 1, 6}, { 1, 0}, { 1, 16}, { 1, 19},
{ 1, 34}, { 1, 5}, { 3, 0}, { 1, 40}, { 2, 19}, { 3, 0},
{ 4, 0}, { 1, 30}, { 1, 19}, { 1, 34}, { 1, 5}, { 8, 0}, { 1, 38}, { 1, 19}, // Row 10
{ 1, 15}, { 1, 32}, { 13, 0}, { 1, 38}, { 1, 19}, { 1, 15}, { 1, 32}, { 1, 0},
{ 1, 16}, { 1, 19}, { 1, 23}, { 1, 41}, { 3, 0}, { 1, 40}, { 2, 19}, { 3, 0},
{ 5, 0}, { 1, 24}, { 1, 21}, { 1, 5}, { 1, 0}, { 1, 1}, { 1, 18}, { 1, 29}, // Row 11
{ 4, 19}, { 1, 23}, { 1, 7}, { 1, 17}, { 1, 4}, { 6, 0}, { 1, 1}, { 1, 4},
{ 1, 42}, { 4, 19}, { 1, 20}, { 1, 16}, { 1, 17}, { 1, 4}, { 1, 41}, { 1, 29},
{ 1, 22}, { 1, 7}, { 1, 14}, { 3, 19}, { 1, 33}, { 1, 17}, { 1, 29}, { 3, 0},
{ 5, 0}, { 1, 18}, { 1, 33}, { 1, 4}, { 1, 0}, { 1, 7}, { 1, 20}, { 5, 19}, // Row 12
{ 1, 14}, { 1, 16}, { 1, 43}, { 1, 1}, { 6, 0}, { 1, 4}, { 1, 16}, { 5, 19},
{ 1, 14}, { 1, 20}, { 1, 26}, { 1, 4}, { 1, 1}, { 1, 3}, { 1, 16}, { 6, 19},
{ 1, 27}, { 1, 26}, { 3, 0},
{ 3, 0}, { 1, 4}, { 1, 33}, { 1, 10}, { 1, 17}, { 2, 0}, { 1, 19}, { 1, 25}, // Row 13
{ 5, 20}, { 1, 3}, { 1, 4}, { 9, 0}, { 1, 6}, { 1, 7}, { 3, 20}, { 1, 27},
{ 1, 40}, { 1, 15}, { 1, 44}, { 1, 4}, { 2, 0}, { 1, 9}, { 6, 20}, { 1, 12},
{ 1, 16}, { 3, 0},
{ 3, 0}, { 1, 3}, { 2, 19}, { 1, 24}, { 1, 0}, { 1, 45}, { 2, 19}, { 1, 8}, // Row 14
{ 20, 0}, { 1, 3}, { 1, 14}, { 1, 19}, { 1, 8}, { 8, 0}, { 1, 28}, { 2, 19},
{ 1, 16}, { 3, 0},
{ 3, 0}, { 1, 3}, { 2, 19}, { 1, 28}, { 1, 0}, { 1, 46}, { 2, 19}, { 1, 3}, // Row 15
{ 20, 0}, { 1, 3}, { 1, 14}, { 1, 19}, { 1, 8}, { 8, 0}, { 1, 28}, { 2, 19},
{ 1, 39}, { 3, 0},
{ 3, 0}, { 1, 26}, { 2, 19}, { 1, 28}, { 1, 0}, { 1, 46}, { 2, 19}, { 21, 0}, // Row 16
{ 1, 7}, { 2, 19}, { 1, 8}, { 8, 0}, { 1, 28}, { 2, 19}, { 1, 3}, { 3, 0},
{ 3, 0}, { 1, 20}, { 2, 19}, { 1, 2}, { 1, 0}, { 1, 20}, { 2, 19}, { 21, 0}, // Row 17
{ 1, 8}, { 1, 19}, { 1, 14}, { 1, 3}, { 8, 0}, { 1, 17}, { 1, 19}, { 1, 11},
{ 1, 18}, { 3, 0},
{ 3, 0}, { 1, 20}, { 2, 19}, { 2, 0}, { 2, 19}, { 1, 23}, { 21, 0}, { 1, 8}, // Row 18
{ 1, 19}, { 1, 14}, { 1, 3}, { 8, 0}, { 1, 17}, { 1, 19}, { 1, 23}, { 1, 6},
{ 3, 0},
{ 3, 0}, { 1, 20}, { 2, 19}, { 2, 0}, { 1, 19}, { 1, 21}, { 1, 28}, { 21, 0}, // Row 19
{ 1, 8}, { 1, 19}, { 1, 14}, { 1, 3}, { 8, 0}, { 1, 17}, { 1, 19}, { 1, 23},
{ 1, 6}, { 3, 0},
{ 3, 0}, { 1, 27}, { 1, 19}, { 1, 12}, { 2, 0}, { 1, 47}, { 1, 17}, { 1, 23}, // Row 20
{ 3, 48}, { 1, 20}, { 1, 18}, { 9, 0}, { 1, 49}, { 1, 27}, { 4, 48}, { 1, 20},
{ 1, 33}, { 1, 11}, { 1, 34}, { 1, 32}, { 1, 0}, { 1, 18}, { 1, 30}, { 4, 48},
{ 1, 46}, { 1, 27}, { 1, 19}, { 1, 29}, { 1, 41}, { 3, 0},
{ 3, 0}, { 1, 5}, { 1, 12}, { 1, 3}, { 2, 0}, { 7, 19}, { 1, 33}, { 1, 1}, // Row 21
{ 8, 0}, { 1, 21}, { 6, 19}, { 1, 29}, { 1, 14}, { 1, 17}, { 2, 0}, { 1, 23},
{ 6, 19}, { 1, 16}, { 1, 19}, { 1, 33}, { 1, 1}, { 3, 0},
{ 4, 0}, { 1, 5}, { 1, 1}, { 2, 0}, { 1, 2}, { 1, 21}, { 5, 19}, { 1, 12}, // Row 22
{ 1, 43}, { 8, 0}, { 1, 1}, { 7, 19}, { 1, 20}, { 1, 1}, { 2, 0}, { 1, 26},
{ 1, 15}, { 6, 19}, { 1, 46}, { 1, 1}, { 4, 0},
{ 1, 50}, { 25, 0}, { 1, 4}, { 1, 36}, { 4, 42}, { 1, 49}, { 1, 1}, { 4, 0}, // Row 23
{ 1, 18}, { 6, 42}, { 6, 0},
};
/********************************************************************************************
* Public Bitmap Structure Definitions
********************************************************************************************/
const struct SRlePaletteBitmap NXWidgets::g_lcdClockBitmap =
{
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_lcdClockNormalLut, // Index 0: Unselected LUT
g_lcdClockBrightLut, // Index 1: Selected LUT
},
g_lcdClockRleEntries // data - Pointer to the beginning of the RLE data
};

View File

@ -1,2 +0,0 @@
/Kconfig

12
graphics/slcd/.gitignore vendored Normal file
View File

@ -0,0 +1,12 @@
/twm4nx
/Make.dep
/.depend
/.built
/*.asm
/*.obj
/*.rel
/*.lst
/*.sym
/*.adb
/*.lib
/*.src

15
graphics/slcd/Kconfig Normal file
View File

@ -0,0 +1,15 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
menuconfig GRAPHICS_SLCD
bool "Segment LCD Emulaton"
default n
select NXWIDGETS
depends on NX && HAVE_CXX
---help---
Enable the CLcd class which implements an NX LCD simulation.
if GRAPHICS_SLCD
endif # GRAPHICS_SLCD

39
graphics/slcd/Make.defs Normal file
View File

@ -0,0 +1,39 @@
############################################################################
# apps/graphics/slcd/Make.defs
# Adds selected applications to apps/ build
#
# Copyright (C) 2019 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# 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 nor the names of its contributors may 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.
#
############################################################################
ifeq ($(CONFIG_GRAPHICS_SLCD),y)
CONFIGURED_APPS += graphics/slcd
endif

46
graphics/slcd/Makefile Normal file
View File

@ -0,0 +1,46 @@
############################################################################
# apps/graphics/slcd/Makefile
#
# Copyright (C) 2019 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# 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 nor the names of its contributors may 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.
#
############################################################################
-include $(TOPDIR)/Make.defs
-include $(APPDIR)/Make.defs
# SLcd
ASRCS =
CSRCS =
CXXSRCS = cslcd.cxx slcd_mapping.cxx slcd_trapezoids.cxx
MAINSRC =
include $(APPDIR)/Application.mk

290
graphics/slcd/cslcd.cxx Normal file
View File

@ -0,0 +1,290 @@
/////////////////////////////////////////////////////////////////////////////
// apps/graphics/slcd/cslcd.cxx
//
// Copyright (C) 2019 Gregory Nutt. All rights reserved.
// Author: Gregory Nutt <gnutt@nuttx.org>
//
// 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 nor the names of its contributors may 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 <fixedmath.h>
#include <debug.h>
#include <nuttx/nx/nx.h>
#include "graphics/nxwidgets/inxwindow.hxx"
#include "graphics/slcd.hxx"
#include "slcd.hxx"
// Segment
//
// 11111111
// 2 3
// 2 3
// 2 3
// 44444444
// 5 6
// 5 6
// 5 6
// 77777777
/////////////////////////////////////////////////////////////////////////////
// CSLcd Method implementations
/////////////////////////////////////////////////////////////////////////////
using namespace SLcd;
/**
* CSLcd Constructor
*
* @param wnd Identifies the window to draw into
* @param height The initial height of the SLCD image
*/
CSLcd::CSLcd(NXWidgets::INxWindow *wnd, nxgl_coord_t height)
{
m_window = wnd;
scale(height);
}
/**
* Created scaled trapezoids for the specified height
*
* @param height The height of the SLCD image
*/
void CSLcd::scale(nxgl_coord_t height)
{
// Scale each segment
scaleSegment(GTop_Runs, m_top, NTOP_TRAPEZOIDS + 1);
scaleSegment(GTopLeft_Runs, m_topLeft, NTOPLEFT_TRAPEZOIDS + 1);
scaleSegment(GTopRight_Runs, m_topRight, NTOPRIGHT_TRAPEZOIDS + 1);
scaleSegment(GMiddle_Runs, m_middle, NMIDDLE_TRAPEZOIDS + 1);
scaleSegment(GBottomLeft_Runs, m_bottomLeft, NBOTTOMLEFT_TRAPEZOIDS + 1);
scaleSegment(GBottomRight_Runs, m_bottom, NBOTTOMRIGHT_TRAPEZOIDS + 1);
scaleSegment(GBottom_Runs, m_top, NBOTTOM_TRAPEZOIDS + 1);
}
/**
* Get the SLcd image width. No since the images are
* slight slanted, this includes some minimal intra-image
* spacing
*
* @return The width of the SLCD image (in pixels)
*/
nxgl_coord_t CSLcd::getWidth(void)
{
return b16toi(m_height * SLCD_ASPECT_B16);
}
/**
* Erase the SLCD image at this position
*
* @param pos The upper left position of the SLCD image
*/
void CSLcd::erase(FAR const nxgl_point_s &pos)
{
struct nxgl_rect_s rect;
rect.pt1.x = pos.x;
rect.pt1.y = pos.y;
rect.pt2.x = pos.x + getWidth() - 1;
rect.pt2.y = pos.y + getHeight() - 1;
bool success = m_window->fill(&rect, SLCD_BACKGROUND);
if (!success)
{
gerr("ERROR: fill() failed\n");
}
}
/**
* Return a the code associated with this ASCII character
*
* @param ch The ASCII encoded character to be converted
* @param code The location to return the code
* @return True if the character can be represented
*/
bool CSLcd::convert(char ch, FAR uint8_t &code)
{
if (ch >= '0' && ch <= '9')
{
code = GSLcdDigits[ch - '0'];
return true;
}
else if (ch >= 'A' && ch <= 'Z')
{
code = GSLcdUpperCase[ch - 'A'];
return true;
}
else if (ch >= 'a' && ch <= 'z')
{
code = GSLcdLowerCase[ch - 'a'];
return true;
}
else
{
for (int i = 0; i < NMISC_MAPPINGS; i++)
{
if (SSLcdMisc[i].ch == ch)
{
code = SSLcdMisc[i].segments;
return true;
}
}
}
return false;
}
/* Show the SCLD image at the provided position on the
* display.
*
* @param code The encode value that describes the SLCD image
* @param pos The location to show the SLCD image in the window
* @return True if the display update was successfully queued
*/
bool CSLcd::show(uint8_t code, FAR const struct nxgl_point_s &pos)
{
// Show each segment in the encoded segment set
if ((code & SEGMENT_1) != 0)
{
showSegment(m_top, pos, NTOP_TRAPEZOIDS);
}
if ((code & SEGMENT_2) != 0)
{
showSegment(m_topLeft, pos, NTOPLEFT_TRAPEZOIDS);
}
if ((code & SEGMENT_3) != 0)
{
showSegment(m_topRight, pos, NTOPRIGHT_TRAPEZOIDS);
}
if ((code & SEGMENT_4) != 0)
{
showSegment(m_middle, pos, NMIDDLE_TRAPEZOIDS);
}
if ((code & SEGMENT_5) != 0)
{
showSegment(m_bottomLeft, pos, NBOTTOMLEFT_TRAPEZOIDS);
}
if ((code & SEGMENT_6) != 0)
{
showSegment(m_bottom, pos, NBOTTOMRIGHT_TRAPEZOIDS);
}
if ((code & SEGMENT_7) != 0)
{
showSegment(m_top, pos, NBOTTOM_TRAPEZOIDS);
}
return true;
}
/**
* Created scaled trapezoids for the specified height
*
* @param run A pointer to the beginning of an array of runs
* @param trapezoid A pointer to a trapezoid array to catch the
* output
* @param nRuns The number of runs in the array. The number of
* trapezoids will be be nRuns - 1;
*/
void CSLcd::scaleSegment(FAR const struct SLcdTrapezoidRun *run,
FAR struct nxgl_trapezoid_s *trapezoid,
int nRuns)
{
// Get the top of the first trapezoid
trapezoid[0].top.x1 = m_height * run[0].leftx;
trapezoid[0].top.x2 = m_height * run[0].rightx;
trapezoid[0].top.y = b16toi(m_height * run[0].y);
for (int i = 1; i <= nRuns; i++)
{
// Get the bottom of the previous trapezoid
trapezoid[i - 1].bot.x1 = m_height * run[i].leftx;
trapezoid[i - 1].bot.x2 = m_height * run[i].rightx;
trapezoid[i - 1].bot.y = b16toi(m_height * run[i].y);
if (i < nRuns)
{
// Get the top of the current trapezoid
trapezoid[i].top.x1 = trapezoid[i - 1].bot.x1;
trapezoid[i].top.x2 = trapezoid[i - 1].bot.x2;
trapezoid[i].top.y = trapezoid[i - 1].bot.y;
}
}
}
/**
* Rend one segment of the SLCD image in the window at the provided
* position.
*
* @param trapezoid A pointer to the trapezoid array to show.
* @param pos The offset position of the SLCD image in the window
* @param nTraps The number of trapezoids in the the array
*/
void CSLcd::showSegment(FAR const struct nxgl_trapezoid_s *trapezoid,
FAR const struct nxgl_point_s &pos,
int nTraps)
{
for (int i = 0; i < nTraps; i++)
{
// Translate the trapezoid by the requested offset
struct nxgl_trapezoid_s trap;
nxgl_trapoffset(&trap, &trapezoid[i], pos.x, pos.y);
bool success =
m_window->fillTrapezoid((FAR const struct nxgl_rect_s *)0,
&trap, SLCD_FOREGROUND);
if (!success)
{
gerr("ERROR: fillTapezoid failed\n");
}
}
}

150
graphics/slcd/slcd.hxx Normal file
View File

@ -0,0 +1,150 @@
/////////////////////////////////////////////////////////////////////////////
// apps/graphics/slcd/slcd.hxx
//
// Copyright (C) 2019 Gregory Nutt. All rights reserved.
// Author: Gregory Nutt <gnutt@nuttx.org>
//
// 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 nor the names of its contributors may 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.
//
/////////////////////////////////////////////////////////////////////////////
#ifndef __APPS_GRAPHICS_SLCD_SLCD_H
#define __APPS_GRAPHICS_SLCD_SLCD_H 1
/////////////////////////////////////////////////////////////////////////////
// Included Files
/////////////////////////////////////////////////////////////////////////////
#include <cstdint>
#include <fixedmath.h>
#include "graphics/nxwidgets/nxconfig.hxx"
#include "graphics/slcd.hxx"
/////////////////////////////////////////////////////////////////////////////
// Pre-processor definitions
/////////////////////////////////////////////////////////////////////////////
// Default colors: Light grey-green background, greenish-black foreground.
// Similar to what you would see on a classic LCD.
#define SLCD_BACKGROUND MKRGB(128, 140, 128)
#define SLCD_FOREGROUND MKRGB(0, 16, 0)
// Segment encoding:
//
// 11111111
// 2 3
// 2 3
// 2 3
// 44444444
// 5 6
// 5 6
// 5 6
// 77777777
#define SEGMENT_1 (1 << 0)
#define SEGMENT_2 (1 << 1)
#define SEGMENT_3 (1 << 2)
#define SEGMENT_4 (1 << 3)
#define SEGMENT_5 (1 << 4)
#define SEGMENT_6 (1 << 5)
#define SEGMENT_7 (1 << 6)
// Number of segments
#define NSEGMENTS 7
// Segment image aspect ratio width:height
#define SLCD_ASPECT 0.577381L // Width / Height
#define SLCD_ASPECT_B16 37577 // Width / Height
// Number of miscellaneous character mappings
#define NMISC_MAPPINGS 5
namespace SLcd
{
/////////////////////////////////////////////////////////////////////////////
// Public Types
/////////////////////////////////////////////////////////////////////////////
// Each trapezoid is represented by a sequence of runs. The first run
// provides the top of the first trapezoid; the following provide the
// bottom of each successive trapezoid. The top of each subsequent
// trapezoid is the bottom of the trapezoid above it
struct SLcdTrapezoidRun
{
b16_t leftx; // Left X position of run
b16_t rightx; // Right X position of run
b16_t y; // Y position of run
};
// Used to implement a sparse array that matches a few miscellaneous
// ASCII characters to an LCD segment set.
struct SSLcdCharset
{
char ch; // ASCII character to be mapped
uint8_t segments; // Segment set that represents that character
};
/////////////////////////////////////////////////////////////////////////////
// Public Data
/////////////////////////////////////////////////////////////////////////////
// An arrays of runs. The number of runs in each array is equal to the
// number of trapezoids + 1
extern const struct SLcdTrapezoidRun
GTop_Runs[NTOP_TRAPEZOIDS + 1];
extern const struct SLcdTrapezoidRun
GTopLeft_Runs[NTOPLEFT_TRAPEZOIDS + 1];
extern const struct SLcdTrapezoidRun
GTopRight_Runs[NTOPRIGHT_TRAPEZOIDS + 1];
extern const struct SLcdTrapezoidRun
GMiddle_Runs[NMIDDLE_TRAPEZOIDS + 1];
extern const struct SLcdTrapezoidRun
GBottomLeft_Runs[NBOTTOMLEFT_TRAPEZOIDS + 1];
extern const struct SLcdTrapezoidRun
GBottomRight_Runs[NBOTTOMRIGHT_TRAPEZOIDS + 1];
extern const struct SLcdTrapezoidRun
GBottom_Runs[NBOTTOM_TRAPEZOIDS + 1];
// ASCII to segment set mapping arrays
extern const uint8_t GSLcdDigits[10];
extern const uint8_t GSLcdLowerCase[26];
extern const uint8_t GSLcdUpperCase[26];
extern const struct SSLcdCharset SSLcdMisc[NMISC_MAPPINGS];
}
#endif /* __APPS_GRAPHICS_SLCD_SLCD_H */

View File

@ -0,0 +1,196 @@
/////////////////////////////////////////////////////////////////////////////
// apps/graphics/slcd/slcd_mapping.cxx
//
// Copyright (C) 2019 Gregory Nutt. All rights reserved.
// Author: Gregory Nutt <gnutt@nuttx.org>
//
// 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 nor the names of its contributors may 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.
//
/////////////////////////////////////////////////////////////////////////////
// Segment
//
// 11111111
// 2 3
// 2 3
// 2 3
// 44444444
// 5 6
// 5 6
// 5 6
// 77777777
/////////////////////////////////////////////////////////////////////////////
// Included Files
/////////////////////////////////////////////////////////////////////////////
#include <cstdint>
#include "graphics/slcd.hxx"
#include "slcd.hxx"
/////////////////////////////////////////////////////////////////////////////
// Public Data
/////////////////////////////////////////////////////////////////////////////
namespace SLcd
{
const uint8_t GSLcdDigits[10] =
{
SEGMENT_1 | SEGMENT_2 | SEGMENT_3 | SEGMENT_5 | // 0
SEGMENT_6 | SEGMENT_7,
SEGMENT_2 | SEGMENT_5, // 1
SEGMENT_1 | SEGMENT_3 | SEGMENT_4 | SEGMENT_5 | // 2
SEGMENT_7,
SEGMENT_1 | SEGMENT_3 | SEGMENT_4 | SEGMENT_6 | // 3
SEGMENT_7,
SEGMENT_2 | SEGMENT_3 | SEGMENT_4 | SEGMENT_6, // 4
SEGMENT_1 | SEGMENT_2 | SEGMENT_4 | SEGMENT_6 | // 5
SEGMENT_7,
SEGMENT_1 | SEGMENT_2 | SEGMENT_4 | SEGMENT_5 | // 6
SEGMENT_6 | SEGMENT_7, // 7
SEGMENT_1 | SEGMENT_2 | SEGMENT_3 | SEGMENT_6,
SEGMENT_1 | SEGMENT_2 | SEGMENT_3 | SEGMENT_4 | // 8
SEGMENT_5 | SEGMENT_6 | SEGMENT_7,
SEGMENT_1 | SEGMENT_2 | SEGMENT_3 | SEGMENT_4 | // 9
SEGMENT_6 | SEGMENT_7
};
const uint8_t GSLcdLowerCase[26] =
{
SEGMENT_1 | SEGMENT_3 | SEGMENT_4 | SEGMENT_5 | // a
SEGMENT_6 | SEGMENT_7,
SEGMENT_2 | SEGMENT_4 | SEGMENT_5 | SEGMENT_6 | // b
SEGMENT_7,
SEGMENT_4 | SEGMENT_5 | SEGMENT_7, // c
SEGMENT_3 | SEGMENT_4 | SEGMENT_5 | SEGMENT_6 | // d
SEGMENT_7,
SEGMENT_1 | SEGMENT_2 | SEGMENT_3 | SEGMENT_4 | // e
SEGMENT_5 | SEGMENT_7,
SEGMENT_1 | SEGMENT_2 | SEGMENT_4 | SEGMENT_5, // f
SEGMENT_1 | SEGMENT_2 | SEGMENT_3 | SEGMENT_4 | // g
SEGMENT_6 | SEGMENT_7,
SEGMENT_2 | SEGMENT_4 | SEGMENT_5 | SEGMENT_6, // h
SEGMENT_5, // i
SEGMENT_6 | SEGMENT_7, // j
SEGMENT_1 | SEGMENT_2 | SEGMENT_4 | SEGMENT_5 | // k
SEGMENT_6,
SEGMENT_2 | SEGMENT_5, // l
SEGMENT_5 | SEGMENT_6, // m
SEGMENT_4 | SEGMENT_5 | SEGMENT_6, // n
SEGMENT_4 | SEGMENT_5 | SEGMENT_6 | SEGMENT_7, // o
SEGMENT_1 | SEGMENT_2 | SEGMENT_3 | SEGMENT_4 | // p
SEGMENT_5,
SEGMENT_1 | SEGMENT_2 | SEGMENT_3 | SEGMENT_4 | // q
SEGMENT_6,
SEGMENT_4 | SEGMENT_5, // r
SEGMENT_1 | SEGMENT_2 | SEGMENT_4 | SEGMENT_6 | // s
SEGMENT_7,
SEGMENT_2 | SEGMENT_4 | SEGMENT_5 | SEGMENT_7, // t
SEGMENT_5 | SEGMENT_6 | SEGMENT_7, // u
SEGMENT_5 | SEGMENT_6 | SEGMENT_7, // v
SEGMENT_5 | SEGMENT_6, // w
SEGMENT_2 | SEGMENT_3 | SEGMENT_4 | SEGMENT_5 | // x
SEGMENT_6,
SEGMENT_2 | SEGMENT_3 | SEGMENT_4 | SEGMENT_6 | // y
SEGMENT_7,
SEGMENT_1 | SEGMENT_3 | SEGMENT_4 | SEGMENT_5 | // z
SEGMENT_7
};
const uint8_t GSLcdUpperCase[26] =
{
SEGMENT_1 | SEGMENT_2 | SEGMENT_3 | SEGMENT_4 | // A
SEGMENT_5 | SEGMENT_6,
SEGMENT_1 | SEGMENT_2 | SEGMENT_3 | SEGMENT_4 | // B
SEGMENT_5 | SEGMENT_6 | SEGMENT_7,
SEGMENT_1 | SEGMENT_2 | SEGMENT_5 | SEGMENT_7, // C
SEGMENT_3 | SEGMENT_4 | SEGMENT_5 | SEGMENT_6 | // D
SEGMENT_7,
SEGMENT_1 | SEGMENT_2 | SEGMENT_4 | SEGMENT_5 | // E
SEGMENT_7,
SEGMENT_1 | SEGMENT_2 | SEGMENT_4 | SEGMENT_5, // F
SEGMENT_1 | SEGMENT_2 | SEGMENT_5 | SEGMENT_6 | // G
SEGMENT_7,
SEGMENT_2 | SEGMENT_3 | SEGMENT_4 | SEGMENT_5 | // H
SEGMENT_6,
SEGMENT_2 | SEGMENT_5, // I
SEGMENT_3 | SEGMENT_5 | SEGMENT_6 | SEGMENT_7, // J
SEGMENT_1 | SEGMENT_2 | SEGMENT_4 | SEGMENT_5 | // K
SEGMENT_6,
SEGMENT_2 | SEGMENT_5 | SEGMENT_7, // L
SEGMENT_1 | SEGMENT_5 | SEGMENT_6, // M
SEGMENT_1 | SEGMENT_2 | SEGMENT_3 | SEGMENT_5 | // N
SEGMENT_6,
SEGMENT_1 | SEGMENT_2 | SEGMENT_3 | SEGMENT_5 | // O
SEGMENT_6 | SEGMENT_7,
SEGMENT_1 | SEGMENT_2 | SEGMENT_3 | SEGMENT_4 | // P
SEGMENT_5,
SEGMENT_1 | SEGMENT_2 | SEGMENT_3 | SEGMENT_4 | // Q
SEGMENT_7,
SEGMENT_1 | SEGMENT_2 | SEGMENT_3 | SEGMENT_5, // R
SEGMENT_1 | SEGMENT_2 | SEGMENT_4 | SEGMENT_6 | // S
SEGMENT_7,
SEGMENT_2 | SEGMENT_4 | SEGMENT_5 | SEGMENT_7, // T
SEGMENT_2 | SEGMENT_3 | SEGMENT_5 | SEGMENT_6 | // U
SEGMENT_7,
SEGMENT_2 | SEGMENT_3 | SEGMENT_5 | SEGMENT_6 | // V
SEGMENT_7,
SEGMENT_2 | SEGMENT_3 | SEGMENT_7, // W
SEGMENT_2 | SEGMENT_3 | SEGMENT_4 | SEGMENT_5 | // X
SEGMENT_6,
SEGMENT_2 | SEGMENT_3 | SEGMENT_4 | SEGMENT_6 | // Y
SEGMENT_7,
SEGMENT_1 | SEGMENT_3 | SEGMENT_4 | SEGMENT_5 | // Z
SEGMENT_7
};
const struct SSLcdCharset SSLcdMisc[NMISC_MAPPINGS] =
{
{
.ch = ' ',
.segments = 0
},
{
.ch = '-',
.segments = SEGMENT_4
},
{
.ch = '_',
.segments = SEGMENT_7
},
{
.ch = '"',
.segments = SEGMENT_3 | SEGMENT_3
},
{
.ch = ',',
.segments = SEGMENT_5
}
};
}

View File

@ -0,0 +1,289 @@
/////////////////////////////////////////////////////////////////////////////
// apps/graphics/slcd/slcd_trapezoids.cxx
//
// Copyright (C) 2019 Gregory Nutt. All rights reserved.
// Author: Gregory Nutt <gnutt@nuttx.org>
//
// 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 nor the names of its contributors may 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 "graphics/slcd.hxx"
#include "slcd.hxx"
/////////////////////////////////////////////////////////////////////////////
// Public Data
/////////////////////////////////////////////////////////////////////////////
namespace SLcd
{
// Top horizontal segment
const struct SLcdTrapezoidRun GTop_Runs[NTOP_TRAPEZOIDS + 1] =
{
[0] =
{
.leftx = 11703,
.rightx = 31208,
.y = 0
},
[1] =
{
.leftx = 8972,
.rightx = 27323,
.y = 780
},
[2] =
{
.leftx = 9655,
.rightx = 34328,
.y = 1560
},
[3] =
{
.leftx = 14434,
.rightx = 28867,
.y = 7022
}
};
// Top-left vertical segment
const struct SLcdTrapezoidRun GTopLeft_Runs[NTOPLEFT_TRAPEZOIDS + 1] =
{
[0] =
{
.leftx = 7022,
.rightx = 7022,
.y = 2341
},
[1] =
{
.leftx = 5461,
.rightx = 9362,
.y = 4681
},
[2] =
{
.leftx = 5098,
.rightx = 12873,
.y = 8192
},
[3] =
{
.leftx = 3193,
.rightx = 10923,
.y = 26526
},
[4] =
{
.leftx = 3121,
.rightx = 9986,
.y = 27307
},
[5] =
{
.leftx = 6242,
.rightx = 6242,
.y = 30427
}
};
// Top-right vertical segment
const struct SLcdTrapezoidRun GTopRight_Runs[NTOPRIGHT_TRAPEZOIDS + 1] =
{
[0] =
{
.leftx = 37059,
.rightx = 37059,
.y = 3901
},
[1] =
{
.leftx = 33997,
.rightx = 37839,
.y = 6242
},
[2] =
{
.leftx = 30427,
.rightx = 37591,
.y = 8972
},
[3] =
{
.leftx = 28477,
.rightx = 35924,
.y = 27307
},
[4] =
{
.leftx = 28518,
.rightx = 35889,
.y = 27697
},
[5] =
{
.leftx = 32378,
.rightx = 32378,
.y =30818
}
};
// Middle horizontal segment
const struct SLcdTrapezoidRun GMiddle_Runs[NMIDDLE_TRAPEZOIDS + 1] =
{
[0] =
{
.leftx = 12483,
.rightx = 27307,
.y = 28867
},
[1] =
{
.leftx = 8192,
.rightx = 30427,
.y = 32378
},
[2] =
{
.leftx = 11703,
.rightx = 25746,
.y = 36279
}
};
// Bottom-left vertical segment
const struct SLcdTrapezoidRun GBottomLeft_Runs[NBOTTOMLEFT_TRAPEZOIDS + 1] =
{
[0] =
{
.leftx = 5851,
.rightx = 5851,
.y = 33938
,
},
[1] =
{
.leftx = 1950,
.rightx = 9752,
.y = 37449
},
[2] =
{
.leftx = 370,
.rightx = 8192,
.y = 55784
},
[3] =
{
.leftx = 0,
.rightx = 3364,
.y = 60075
},
[4] =
{
.leftx = 1170,
.rightx = 1170,
.y = 62025
}
};
// Bottom-right vertical segment
const struct SLcdTrapezoidRun GBottomRight_Runs[NBOTTOMRIGHT_TRAPEZOIDS + 1] =
{
[0] =
{
.leftx = 31988,
.rightx = 31988,
.y = 34328
},
[1] =
{
.leftx = 28769,
.rightx = 35109,
.y = 37059
},
[2] =
{
.leftx = 27307,
.rightx = 34996,
.y = 38229
},
[3] =
{
.leftx = 25746,
.rightx = 33183,
.y = 56954
},
[4] =
{
.leftx = 30324,
.rightx = 32768,
.y = 61245
},
[5] =
{
.leftx = 31988,
.rightx = 31988,
.y = 62805
}
};
// Bottom horizontal segment
const struct SLcdTrapezoidRun GBottom_Runs[NBOTTOM_TRAPEZOIDS + 1] =
{
[0] =
{
.leftx = 9362,
.rightx = 24576,
.y = 58124
},
[1] =
{
.leftx = 2731,
.rightx = 31988,
.y = 63976
},
[2] =
{
.leftx = 4681,
.rightx = 28477,
.y = 65536
}
};
}

View File

@ -8,7 +8,7 @@ menuconfig GRAPHICS_TWM4NX
default n
select NX_RAMBACKED
select NXWIDGETS
depends on NX && EXPERIMENTAL
depends on NX && HAVE_CXX
---help---
Enable Tom's Window Manager (TWM) for NuttX (Twm4Nx).

View File

@ -36,7 +36,7 @@
-include $(TOPDIR)/Make.defs
-include $(APPDIR)/Make.defs
# Add patch to cursor images to CXXFLAGS
# Add path to cursor images to CXXFLAGS
CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(APPDIR)/graphics/nxglyphs/include"}

View File

@ -101,7 +101,7 @@ namespace NXWidgets
extern const struct SBitmap g_capslock;
extern const struct SBitmap g_control;
// Bitmaps used by NxWM and Twm4Nx
// Bitmaps used by NxWM, Twm4Nx, and SLcd
// Global RLE Paletted Bitmaps
extern const struct SRlePaletteBitmap g_calculatorBitmap;
@ -112,8 +112,9 @@ namespace NXWidgets
extern const struct SRlePaletteBitmap g_resizeBitmap;
extern const struct SRlePaletteBitmap g_resize2Bitmap;
extern const struct SRlePaletteBitmap g_nxiconBitmap;
extern const struct SRlePaletteBitmap g_lcdClockBitmap;
// Used by NxWM meda player
// Used by NxWM media player
extern const struct SRlePaletteBitmap g_mediaplayerBitmap;
extern const struct SRlePaletteBitmap g_mplayerFwdBitmap;

203
include/graphics/slcd.hxx Normal file
View File

@ -0,0 +1,203 @@
/////////////////////////////////////////////////////////////////////////////
// apps/include/graphics/slcd.hxx
//
// Copyright (C) 2019 Gregory Nutt. All rights reserved.
// Author: Gregory Nutt <gnutt@nuttx.org>
//
// 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 nor the names of its contributors may 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.
//
/////////////////////////////////////////////////////////////////////////////
#ifndef __APPS_INCLUDE_GRAPHICS_SLCD_H
#define __APPS_INCLUDE_GRAPHICS_SLCD_H 1
/////////////////////////////////////////////////////////////////////////////
// Included Files
/////////////////////////////////////////////////////////////////////////////
#include <nuttx/nx/nxglib.h>
/////////////////////////////////////////////////////////////////////////////
// Pre-processor definitions
/////////////////////////////////////////////////////////////////////////////
// Segment
//
// 11111111
// 2 3
// 2 3
// 2 3
// 44444444
// 5 6
// 5 6
// 5 6
// 77777777
// Number of trapezoids in each segment
#define NTOP_TRAPEZOIDS 3
#define NTOPLEFT_TRAPEZOIDS 5
#define NTOPRIGHT_TRAPEZOIDS 5
#define NMIDDLE_TRAPEZOIDS 2
#define NBOTTOMLEFT_TRAPEZOIDS 4
#define NBOTTOMRIGHT_TRAPEZOIDS 5
#define NBOTTOM_TRAPEZOIDS 2
/////////////////////////////////////////////////////////////////////////////
// CSLcd Implementation Class
/////////////////////////////////////////////////////////////////////////////
namespace NXWidgets
{
class INxWindow; // Forward Reference
}
namespace SLcd
{
class CSLcd
{
private:
FAR NXWidgets::INxWindow *m_window; /**< Drawing window */
nxgl_coord_t m_height;
// Scaled trapezoids
struct nxgl_trapezoid_s m_top[NTOP_TRAPEZOIDS];
struct nxgl_trapezoid_s m_topLeft[NTOPLEFT_TRAPEZOIDS];
struct nxgl_trapezoid_s m_topRight[NTOPRIGHT_TRAPEZOIDS];
struct nxgl_trapezoid_s m_middle[NMIDDLE_TRAPEZOIDS];
struct nxgl_trapezoid_s m_bottomLeft[NBOTTOMLEFT_TRAPEZOIDS];
struct nxgl_trapezoid_s m_bottomRight[NBOTTOMRIGHT_TRAPEZOIDS];
struct nxgl_trapezoid_s m_bottom[NBOTTOM_TRAPEZOIDS];
/**
* Created scaled trapezoids for the specified height
*
* @param run A pointer to the beginning of an array of runs
* @param trapezoid A pointer to a trapezoid array to catch the
* output
* @param nRuns The number of runs in the array. The number of
* trapezoids will be be nRuns - 1;
*/
void scaleSegment(FAR const struct SLcdTrapezoidRun *run,
FAR struct nxgl_trapezoid_s *trapezoid,
int nRuns);
/**
* Rend one segment of the SLCD image in the window at the provided
* position.
*
* @param trapezoid A pointer to the trapezoid array to show.
* @param pos The offset position of the SLCD image in the window
* @param nTraps The number of trapezoids in the the array
*/
void showSegment(FAR const struct nxgl_trapezoid_s *trapezoid,
FAR const struct nxgl_point_s &pos,
int nTraps);
public:
/**
* CSLcd Constructor
*
* @param wnd Identifies the window to draw into
* @param height The initial height of the SLCD image
*/
CSLcd(NXWidgets::INxWindow *wnd, nxgl_coord_t height);
/**
* CSLcd Destructor
*/
inline ~CSLcd(void)
{
}
/**
* Created scaled trapezoids for the specified height
*
* @param height The height of the SLCD image
*/
void scale(nxgl_coord_t height);
/**
* Get the SLcd image height
*
* @return The height of the SLCD image (in rows)
*/
inline nxgl_coord_t getHeight(void)
{
return m_height;
}
/**
* Get the SLcd image width. No since the images are
* slight slanted, this includes some minimal intra-image
* spacing
*
* @return The width of the SLCD image (in pixels)
*/
nxgl_coord_t getWidth(void);
/**
* Erase the SLCD image at this position
*
* @param pos The upper left position of the SLCD image
*/
void erase(FAR const nxgl_point_s &pos);
/**
* Return a the code associated with this ASCII character
*
* @param ch The ASCII encoded character to be converted
* @param code The location to return the code
* @return True if the character can be represented
*/
bool convert(char ch, FAR uint8_t &code);
/* Show the SCLD image at the provided position on the
* display.
*
* @param code The encode value that describes the SLCD image
* @param pos The location to show the SLCD image in the window
* @return True if the display update was successfully queued
*/
bool show(uint8_t code, FAR const struct nxgl_point_s &pos);
};
}
#endif /* __APPS_INCLUDE_GRAPHICS_SLCD_H */