From: asterix Date: Thu, 13 Mar 2008 09:29:02 +0000 (+0000) Subject: Add icons folder for demo app. X-Git-Tag: 1.0.0~68 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=a774dc8bae93ac59a4b618348ee8b471bf289d1a;p=bertos.git Add icons folder for demo app. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1184 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/icons/Makefile b/icons/Makefile new file mode 100644 index 00000000..50469549 --- /dev/null +++ b/icons/Makefile @@ -0,0 +1,45 @@ +# +# $Id: Makefile 18234 2007-10-08 13:39:48Z rasky $ +# Copyright 2004, 2006 Develer S.r.l. (http://www.develer.com/) +# All rights reserved. +# +# Author: Stefano Fedrigo +# +# $Log$ +# Revision 1.2 2006/09/20 14:18:01 marco +# Use only icons neede by demo. +# +# Revision 1.1 2006/09/19 17:48:00 bernie +# Add temporary logo. +# +# + +# Set to 1 for debug builds +DEBUG = 1 + +RASTERS = logo.raster + +FLIPIMAGE = flipimage +flipimage_SRC = flipimage.cpp +flipimage_OBJ = $(flipimage_SRC:%.cpp=%.o) + +.PHONY: all +all: $(RASTERS) + +# Link rule +$(FLIPIMAGE): $(flipimage_OBJ) + $(CXX) $^ $(flipimage_LIBS) $(LDFLAGS) -o $@ + +.PHONY: clean +clean: + rm -f $(TRG) $(flipimage_OBJ) + rm -f $(RASTERS) + +.PHONY: rasters +rasters: $(FLIPIMAGE) $(RASTERS) + +%.raster: %.png $(FLIPIMAGE) + convert $< txt:- | ./flipimage >$@ + +# Include dependencies +-include *.d diff --git a/icons/flipimage.cpp b/icons/flipimage.cpp new file mode 100644 index 00000000..f28af7da --- /dev/null +++ b/icons/flipimage.cpp @@ -0,0 +1,120 @@ +/** + * \file + * + * + * \version $Id$ + * \author Stefano Fedrigo + * + * \brief Conversion tool from image TXT format to LCD bitmap + */ + +/* + * $Log$ + * Revision 1.1 2006/09/19 17:48:00 bernie + * Add temporary logo. + * + * Revision 1.3 2004/09/24 17:25:32 powersoft + * Fix for new version of ImageMagick. + * + * Revision 1.2 2004/03/13 22:52:54 aleph + * documentation fixes + * + * Revision 1.1 2004/01/26 15:31:17 aleph + * Add boot images and tools for importing them + * + */ + +#include +#include +#include + +#define RASTER_WIDTH 82 +#define RASTER_HEIGHT 64 + +// Minimum color level to consider a pixel on +#define COLOR_THRESHOLD 128 + + +using namespace std; + + +int main(void) +{ + char buf[64]; + int n; + unsigned char mask; + unsigned char line[RASTER_WIDTH]; + + for (int l = 0; l < RASTER_HEIGHT/8; l++) + { + mask = 1; + memset(line, 0, sizeof(line)); + + do + { + for (int x = 0; x < RASTER_WIDTH; x++) + { + if (!cin.getline(buf, sizeof(buf))) + goto print_line; + + istringstream ss(buf); + string s; + char c; + + ss + >> s // skip glob coord spec + >> c // skip open paren + >> n; // this is the red level + + //DEBUG + //cout << "s='" << s << "' n='" << n << "'" << endl; + + if (n < COLOR_THRESHOLD) + line[x] |= mask; + } + } + while (mask <<= 1); + +print_line: + cout << "\n\t"; + for (int x = 0; x < RASTER_WIDTH; x++) + { + printf("0x%02X", line[x]); + if (x % 8 == 7) + cout << ",\n\t"; + else + cout << ", "; + } + cout << endl; + } + + return 0; +} diff --git a/icons/logo.png b/icons/logo.png new file mode 100755 index 00000000..e3ab3eb0 Binary files /dev/null and b/icons/logo.png differ