-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Load bitmaps with ASCII chars, hex oder decimal encoding
- Loading branch information
Showing
20 changed files
with
213 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#include <iostream> | ||
#include <fstream> | ||
|
||
using namespace std; | ||
|
||
int main( int argc, char* argv[] ) | ||
{ | ||
if( argc!=3 ) | ||
{ | ||
std::cout << "USAGE:" << std::endl; | ||
std::cout << "bin2dec <source> <dest>" << std::endl; | ||
return 0; | ||
} | ||
|
||
std::cout << "Loading " << argv[1] << std::endl; | ||
ifstream inputfile; | ||
inputfile.open(argv[1], ios::binary | ios::ate); | ||
unsigned int filesize = inputfile.tellg(); | ||
std::cout << "Input is " << filesize << " bytes" << std::endl; | ||
inputfile.close(); | ||
inputfile.open(argv[1], ios::binary | ios::in); | ||
|
||
std::ofstream ofs( argv[2], std::ios::binary ); | ||
|
||
|
||
unsigned char binchar; | ||
char high, mid, low; | ||
for (unsigned int i=0; i<filesize; i++) | ||
{ | ||
inputfile.read((char*)&binchar, 1); | ||
high = binchar / 100; | ||
binchar = binchar % 100; | ||
|
||
mid = binchar / 10; | ||
|
||
low = binchar % 10; | ||
|
||
if (high > 0) | ||
{ | ||
high += '0'; | ||
ofs << high; | ||
} | ||
if ((high > 0) || (mid > 0)) | ||
{ | ||
mid += '0'; | ||
ofs << mid; | ||
} | ||
low += '0'; | ||
ofs << low; | ||
|
||
ofs << ';'; | ||
} | ||
|
||
ofs.flush(); | ||
std::cout << ofs.tellp() << " bytes written." << std::endl; | ||
ofs.close(); | ||
inputfile.close(); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#include <iostream> | ||
#include <fstream> | ||
|
||
using namespace std; | ||
|
||
int main( int argc, char* argv[] ) | ||
{ | ||
if( argc!=3 ) | ||
{ | ||
std::cout << "USAGE:" << std::endl; | ||
std::cout << "bin2hex <source> <dest>" << std::endl; | ||
return 0; | ||
} | ||
|
||
std::cout << "Loading " << argv[1] << std::endl; | ||
ifstream inputfile; | ||
inputfile.open(argv[1], ios::binary | ios::ate); | ||
unsigned int filesize = inputfile.tellg(); | ||
std::cout << "Input is " << filesize << " bytes" << std::endl; | ||
inputfile.close(); | ||
inputfile.open(argv[1], ios::binary | ios::in); | ||
|
||
std::ofstream ofs( argv[2], std::ios::binary ); | ||
|
||
|
||
unsigned char binchar; | ||
char high, low; | ||
for (unsigned int i=0; i<filesize; i++) | ||
{ | ||
inputfile.read((char*)&binchar, 1); | ||
high = binchar / 16; | ||
low = binchar % 16; | ||
if (high > 0) | ||
{ | ||
if (high < 10) high += '0'; | ||
else high = high + 'A' - 10; | ||
ofs << high; | ||
} | ||
if (low < 10) low += '0'; | ||
else low = low + 'A' - 10; | ||
ofs << low; | ||
ofs << ';'; | ||
} | ||
|
||
ofs.flush(); | ||
std::cout << ofs.tellp() << " bytes written." << std::endl; | ||
ofs.close(); | ||
inputfile.close(); | ||
|
||
return 0; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[#3;100;100;10A9;255;9;255;9;255;9;255;9;20;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;50;15;80;9;20;15;80;9;20;15;80;9;20;15;80;9;20;15;80;9;20;15;80;9;20;15;80;9;20;15;80;9;20;15;80;9;20;15;80;9;20;15;80;9;20;15;80;9;20;15;80;9;20;15;80;9;20;15;80;9;20;15;80;9;20;15;80;9;20;15;80;9;20;15;80;9;20;15;80;9;50;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;80;15;20;9;255;9;255;9;255;9;255;9;20; |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[#3;100;100;16A9;FF;9;FF;9;FF;9;FF;9;14;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;32;F;50;9;14;F;50;9;14;F;50;9;14;F;50;9;14;F;50;9;14;F;50;9;14;F;50;9;14;F;50;9;14;F;50;9;14;F;50;9;14;F;50;9;14;F;50;9;14;F;50;9;14;F;50;9;14;F;50;9;14;F;50;9;14;F;50;9;14;F;50;9;14;F;50;9;14;F;50;9;32;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;50;F;14;9;FF;9;FF;9;FF;9;FF;9;14; |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters