Remove graphics add email
This commit is contained in:
@ -1,47 +0,0 @@
|
||||
#include "TessesFramework/TessesFramework.hpp"
|
||||
#include <cstdlib>
|
||||
|
||||
using namespace Tesses::Framework;
|
||||
using namespace Tesses::Framework::Graphics;
|
||||
using namespace Tesses::Framework::Graphics::ImageFormats;
|
||||
using namespace Tesses::Framework::Streams;
|
||||
|
||||
void doIt(const char* n)
|
||||
{
|
||||
std::string p = n;
|
||||
srand(std::stoi(p));
|
||||
p.append(".bmp");
|
||||
FileStream* strm = new FileStream(p,"wb");
|
||||
Image image(320,240);
|
||||
|
||||
std::vector<Color> colors = {
|
||||
Colors::Crimson,
|
||||
Colors::Chartreuse,
|
||||
Colors::FireBrick,
|
||||
Colors::Turquoise,
|
||||
Colors::DarkOrange,
|
||||
Colors::Orange
|
||||
};
|
||||
|
||||
|
||||
|
||||
for(uint32_t y = 0; y < image.Height(); y++)
|
||||
{
|
||||
for(uint32_t x = 0; x < image.Width(); x++)
|
||||
{
|
||||
image.SetPixel(x,y,colors[rand() % (int)colors.size()]);
|
||||
}
|
||||
}
|
||||
|
||||
ImageFormats::Bitmap bmp;
|
||||
bmp.Save(strm,&image);
|
||||
delete strm;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
for(int i = 1; i < argc; i++)
|
||||
{
|
||||
doIt(argv[i]);
|
||||
}
|
||||
}
|
||||
@ -1,72 +0,0 @@
|
||||
#include "TessesFramework/TessesFramework.hpp"
|
||||
#include <cstdlib>
|
||||
|
||||
using namespace Tesses::Framework;
|
||||
using namespace Tesses::Framework::Graphics;
|
||||
using namespace Tesses::Framework::Graphics::ImageFormats;
|
||||
using namespace Tesses::Framework::Streams;
|
||||
|
||||
#define WIDTH 19
|
||||
#define HEIGHT 12
|
||||
#define A 0x0A
|
||||
#define B 0x0B
|
||||
#define C 0x0C
|
||||
char house[] = {
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //1
|
||||
0,0,0,0,0,0,0,0,9,9,0,0,0,7,0,0,B,B,0, //2
|
||||
0,0,0,8,8,0,0,0,9,9,0,0,7,6,7,0,A,0,B, //3
|
||||
0,0,0,8,8,0,0,0,0,0,0,7,C,C,C,7,A,0,0, //4
|
||||
0,8,8,8,8,8,8,0,0,0,7,C,C,C,C,C,7,0,0, //5
|
||||
0,8,8,8,8,8,8,0,0,7,7,7,7,7,7,7,7,7,0, //6
|
||||
0,0,0,8,8,0,0,0,0,1,5,5,5,5,5,5,5,1,0, //7
|
||||
0,0,0,8,8,0,0,0,0,1,6,5,3,3,3,5,6,1,0, //8
|
||||
4,4,4,8,8,4,4,4,4,1,6,5,3,2,3,5,6,1,4, //9
|
||||
4,4,4,8,8,4,4,4,4,1,5,5,3,2,3,5,5,1,4, //10
|
||||
4,4,4,4,4,4,4,4,4,1,1,1,1,1,1,1,1,1,4, //11
|
||||
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4 //12
|
||||
|
||||
};
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
Color pallete[] = {
|
||||
Colors::SkyBlue,
|
||||
Colors::Grey,
|
||||
Colors::Crimson,
|
||||
Colors::Lime,
|
||||
Colors::LawnGreen,
|
||||
Colors::DarkOliveGreen,
|
||||
Colors::DimGrey,
|
||||
Colors::BurlyWood,
|
||||
Colors::White,
|
||||
Colors::Yellow,
|
||||
Colors::FireBrick,
|
||||
Colors::WhiteSmoke,
|
||||
Colors::DarkGoldenRod
|
||||
};
|
||||
|
||||
Image img(WIDTH*32,HEIGHT*32);
|
||||
|
||||
for(uint32_t y = 0; y < HEIGHT; y++)
|
||||
{
|
||||
for(uint32_t x = 0; x < WIDTH; x++)
|
||||
{
|
||||
char c = house[y * WIDTH + x];
|
||||
for(uint32_t y0 = 0; y0 < 32; y0++)
|
||||
{
|
||||
uint32_t y1 = y * 32 + y0;
|
||||
for(uint32_t x0 = 0; x0 < 32;x0++)
|
||||
{
|
||||
uint32_t x1 = x * 32 + x0;
|
||||
|
||||
img.SetPixel(x1,y1, pallete[c]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FileStream* strm = new FileStream("house.bmp","wb");
|
||||
ImageFormats::Bitmap bmp;
|
||||
bmp.Save(strm,&img);
|
||||
delete strm;
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
#include "TessesFramework/TessesFramework.hpp"
|
||||
#include <iostream>
|
||||
using namespace Tesses::Framework;
|
||||
using namespace Tesses::Framework::Graphics;
|
||||
using namespace Tesses::Framework::Graphics::ImageFormats;
|
||||
using namespace Tesses::Framework::Streams;
|
||||
|
||||
int main(int argc,char** argv)
|
||||
{
|
||||
if(argc < 3) {
|
||||
std::cout << "INBMP OUTBMP" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
FileStream* src = new FileStream(argv[1],"rb");
|
||||
|
||||
Image img;
|
||||
Bitmap bmp;
|
||||
bmp.Load(src,&img);
|
||||
delete src;
|
||||
FileStream* dest = new FileStream(argv[2],"wb");
|
||||
bmp.Save(dest,&img);
|
||||
delete dest;
|
||||
}
|
||||
@ -1,31 +0,0 @@
|
||||
#include "TessesFramework/TessesFramework.hpp"
|
||||
#include <iostream>
|
||||
using namespace Tesses::Framework;
|
||||
using namespace Tesses::Framework::Graphics;
|
||||
using namespace Tesses::Framework::Graphics::ImageFormats;
|
||||
using namespace Tesses::Framework::Streams;
|
||||
|
||||
int main(int argc,char** argv)
|
||||
{
|
||||
if(argc < 3) {
|
||||
std::cout << "INBMP OUTBMP" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
FileStream* src = new FileStream(argv[1],"rb");
|
||||
|
||||
Image img;
|
||||
Bitmap bmp;
|
||||
bmp.Load(src,&img);
|
||||
|
||||
delete src;
|
||||
|
||||
Image img2(img.Width()+64,img.Height()+64);
|
||||
Renderers::ImageRenderer irdr(&img2);
|
||||
irdr.DrawRectangle(Rectangle(0,0,(int32_t)img2.Width(),(int32_t)img2.Height()),Colors::Crimson,false);
|
||||
irdr.DrawRectangle(Rectangle(1,1,(int32_t)img2.Width()-2,(int32_t)img2.Height()-2),Colors::Chartreuse,true);
|
||||
irdr.DrawImage(Point(32,32),&img);
|
||||
|
||||
FileStream* dest = new FileStream(argv[2],"wb");
|
||||
bmp.Save(dest,&img2);
|
||||
delete dest;
|
||||
}
|
||||
Reference in New Issue
Block a user