diff options
author | Harald Welte <laforge@gnumonks.org> | 2011-07-04 20:52:54 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2011-07-04 20:52:54 +0200 |
commit | 044ad7c3987460ede48ff27afd6bdb0ca05a0432 (patch) | |
tree | 924818cdb0d39ca08aec540d18da7bd406eaae8c /utility/demo-fw/pc-tools/CreateDemoBin/lib/EasyBMP/sample |
import at91lib from at91lib_20100901_softpack_1_9_v_1_0_svn_v1501120100901_softpack_1_9_v_1_0_svn_v15011
it's sad to see that atmel doesn't publish their svn repo or has
a centralized location or even puts proper version/release info
into the library itself
Diffstat (limited to 'utility/demo-fw/pc-tools/CreateDemoBin/lib/EasyBMP/sample')
-rw-r--r-- | utility/demo-fw/pc-tools/CreateDemoBin/lib/EasyBMP/sample/EasyBMPbackground.bmp | bin | 0 -> 308278 bytes | |||
-rw-r--r-- | utility/demo-fw/pc-tools/CreateDemoBin/lib/EasyBMP/sample/EasyBMPsample.cpp | 82 | ||||
-rw-r--r-- | utility/demo-fw/pc-tools/CreateDemoBin/lib/EasyBMP/sample/EasyBMPtext.bmp | bin | 0 -> 113266 bytes | |||
-rw-r--r-- | utility/demo-fw/pc-tools/CreateDemoBin/lib/EasyBMP/sample/makefile | 53 |
4 files changed, 135 insertions, 0 deletions
diff --git a/utility/demo-fw/pc-tools/CreateDemoBin/lib/EasyBMP/sample/EasyBMPbackground.bmp b/utility/demo-fw/pc-tools/CreateDemoBin/lib/EasyBMP/sample/EasyBMPbackground.bmp Binary files differnew file mode 100644 index 0000000..ae1dfa2 --- /dev/null +++ b/utility/demo-fw/pc-tools/CreateDemoBin/lib/EasyBMP/sample/EasyBMPbackground.bmp diff --git a/utility/demo-fw/pc-tools/CreateDemoBin/lib/EasyBMP/sample/EasyBMPsample.cpp b/utility/demo-fw/pc-tools/CreateDemoBin/lib/EasyBMP/sample/EasyBMPsample.cpp new file mode 100644 index 0000000..2b25ca2 --- /dev/null +++ b/utility/demo-fw/pc-tools/CreateDemoBin/lib/EasyBMP/sample/EasyBMPsample.cpp @@ -0,0 +1,82 @@ +/************************************************* +* * +* EasyBMP Cross-Platform Windows Bitmap Library * +* * +* Author: Paul Macklin * +* email: macklin01@users.sourceforge.net * +* support: http://easybmp.sourceforge.net * +* * +* file: EasyBMPsample.cpp * +* date added: 03-31-2006 * +* date modified: 12-01-2006 * +* version: 1.06 * +* * +* License: BSD (revised/modified) * +* Copyright: 2005-6 by the EasyBMP Project * +* * +* description: Sample application to demonstrate *
+* some functions and capabilities * +* * +*************************************************/
+
+#include "EasyBMP.h"
+using namespace std;
+
+int main( int argc, char* argv[] )
+{ + cout << endl + << "Using EasyBMP Version " << _EasyBMP_Version_ << endl << endl + << "Copyright (c) by the EasyBMP Project 2005-6" << endl + << "WWW: http://easybmp.sourceforge.net" << endl << endl; +
+ BMP Text; + Text.ReadFromFile("EasyBMPtext.bmp"); + + BMP Background; + Background.ReadFromFile("EasyBMPbackground.bmp"); + + BMP Output;
+ Output.SetSize( Background.TellWidth() , Background.TellHeight() );
+ Output.SetBitDepth( 24 ); + + RangedPixelToPixelCopy( Background, 0, Output.TellWidth()-1, + Output.TellHeight()-1 , 0, + Output, 0,0 ); + + RangedPixelToPixelCopyTransparent( Text, 0, 380, + 43, 0, + Output, 110,5, + *Text(0,0) ); + + RangedPixelToPixelCopyTransparent( Text, 0, Text.TellWidth()-1, + Text.TellWidth()-1, 50, + Output, 100,442, + *Text(0,49) ); + + Output.SetBitDepth( 32 ); + cout << "writing 32bpp ... " << endl; + Output.WriteToFile( "EasyBMPoutput32bpp.bmp" ); + + Output.SetBitDepth( 24 ); + cout << "writing 24bpp ... " << endl; + Output.WriteToFile( "EasyBMPoutput24bpp.bmp" ); + + Output.SetBitDepth( 8 ); + cout << "writing 8bpp ... " << endl; + Output.WriteToFile( "EasyBMPoutput8bpp.bmp" ); + + Output.SetBitDepth( 4 ); + cout << "writing 4bpp ... " << endl; + Output.WriteToFile( "EasyBMPoutput4bpp.bmp" ); +
+ Output.SetBitDepth( 1 ); + cout << "writing 1bpp ... " << endl; + Output.WriteToFile( "EasyBMPoutput1bpp.bmp" ); + + Output.SetBitDepth( 24 ); + Rescale( Output, 'p' , 50 ); + cout << "writing 24bpp scaled image ..." << endl; + Output.WriteToFile( "EasyBMPoutput24bpp_rescaled.bmp" ); + + return 0;
+}
diff --git a/utility/demo-fw/pc-tools/CreateDemoBin/lib/EasyBMP/sample/EasyBMPtext.bmp b/utility/demo-fw/pc-tools/CreateDemoBin/lib/EasyBMP/sample/EasyBMPtext.bmp Binary files differnew file mode 100644 index 0000000..6a9e00c --- /dev/null +++ b/utility/demo-fw/pc-tools/CreateDemoBin/lib/EasyBMP/sample/EasyBMPtext.bmp diff --git a/utility/demo-fw/pc-tools/CreateDemoBin/lib/EasyBMP/sample/makefile b/utility/demo-fw/pc-tools/CreateDemoBin/lib/EasyBMP/sample/makefile new file mode 100644 index 0000000..591c649 --- /dev/null +++ b/utility/demo-fw/pc-tools/CreateDemoBin/lib/EasyBMP/sample/makefile @@ -0,0 +1,53 @@ +#
+# EasyBMP Cross-Platform Windows Bitmap Library
+#
+# Author: Paul Macklin
+# email: macklin01@users.sourceforge.net
+# support: http://easybmp.sourceforge.net
+# file: makefile
+# date added: 04-22-2006
+# date modified: 12-01-2006
+# version: 1.06
+#
+# License: BSD (revised/modified)
+# Copyright: 2005-6 by the EasyBMP Project
+#
+# description: Sample makefile for compiling with
+# the EasyBMP library. This compiles
+# the EasyBMPsample.cpp program.
+#
+
+CC = g++
+
+# this line gives compiler optimizations that are geared towards g++ and Pentium4
+# computers. Comment it out if you don't have a Pentium 4 (or Athlon XP) or up
+
+# CFLAGS = -O3 -Wno-deprecated -mcpu=pentium4 -march=pentium4 \
+# -mfpmath=sse -msse -mmmx -msse2 -pipe -fomit-frame-pointer -s
+
+# Uncomment these two lines to use with any Pentium with MMX or up.
+
+# CFLAGS = -Wno-deprecated -mcpu=pentium -march=pentium -pipe \
+# -fomit-frame-pointer -mmmx -funroll-all-loops -s
+
+# Uncomment these lines for some "safe" optimization flags
+
+CFLAGS = -O3 -pipe -fomit-frame-pointer -funroll-all-loops -s
+
+EasyBMPTest: EasyBMP.o EasyBMPsample.o
+ g++ $(CFLAGS) EasyBMP.o EasyBMPsample.o -o EasyBMPtest
+
+EasyBMP.o: ../EasyBMP.cpp ../EasyBMP*.h
+ cp ../EasyBMP*.h .
+ cp ../EasyBMP.cpp .
+ g++ $(CFLAGS) -c EasyBMP.cpp
+
+EasyBMPsample.o: EasyBMPsample.cpp
+ g++ -c EasyBMPsample.cpp
+
+clean:
+ rm EasyBMP*.h
+ rm EasyBMP.cpp
+ rm EasyBMPtest*
+ rm EasyBMPoutput*.bmp
+ rm -f *.o
|