@Camellias
Fractals are images that when you zoom in enough contains itself (at least according to my memory alone). They are pretty cool in my opinion.
Here’s the raw source, if anyone wants it:
||
// Sweetie Bot Art C____ source file
// program writes file “out.bmp” with the picture
// the program sacrfices readability to fit better in QR code
// http://deviantart.com/xbi
#include <stdio.h>
#define D double
#define I int
#define UC unsigned char
#define FOR(i,e) for(I i=0; i < (e); ++i)
I pad(I w) { return (w3+3) & ~3; }
void write_bmp_header(FILE f, I w, I h) {
#define SET(i, x) H[i]=(x) & 0xff ; H[i+1]=((x) >> 8) & 0xff ; H[i+2]=((x) >> 16) & 0xff ; H[i+3]=((x) >> 24) & 0xff ;
UC H[54]= { 0 };
H[0]=66; H[1]=77; H[10]=54; H[14]=40; H[26]=1; H[28]=24;
SET(2, pad(w)h+54);
SET(18, w);
SET(22, h);
SET(34, pad(w)h);
fwrite(H, 1, 54, f);
}
D fractal(D x, D y) {
D steps=256;
D p=0;
for (I k = 0; k<256; ++k) {
D tx=x;
x=xx-yy-0.755;
y=2txy+0.15;
D r=xx+yy;
if (r > 30) {
steps=k+(30-p) / (r-p);
break;
}
p=r;
}
return steps;
}
void get_pixel(I i, I j, I w, I h, UC col[3]) {
D fr=0, fg=0, fb=0;
I aa=3;
FOR(dj, aa) {
FOR(di, aa) {
D jj=(j+308+1.0dj/aa -w/2);
D ii=(i-420+1.0di/aa -h/2);
D cos=0.855 * 1.92 / w;
D sin=0.516 * 1.92 / w;
D x=jj * cos-ii * sin;
D y=jj * sin+ii * cos;
Spoiler about what the QR code does and what you get out of it for those that can’t scan it themselves: It gives you uncompiled (and really ugly) C____ code that, if you compile it, creates this fractal BMP image (tho I’ve included a PNG as well in case Derpibooru can’t display BMPs):
Spoiler about what the QR code does and what you get out of it for those that can’t scan it themselves: It gives you uncompiled (and really ugly) C____ code that, if you compile it, creates this fractal BMP image (tho I’ve included a PNG as well in case Derpibooru can’t display BMPs):
Spoiler about what the QR code does and what you get out of it for those that can’t scan it themselves: It gives you uncompiled (and really ugly) C____ code that, if you compile it, creates this fractal BMP image (tho I’ve included a PNG as well in case Derpibooru can’t display BMPs):
Fractals are images that when you zoom in enough contains itself (at least according to my memory alone). They are pretty cool in my opinion.
Idk a lot about fractals, so I have no idea.
||
// Sweetie Bot Art C____ source file
// program writes file “out.bmp” with the picture
// the program sacrfices readability to fit better in QR code
// http://deviantart.com/xbi
#include <stdio.h>
#define D double
#define I int
#define UC unsigned char
#define FOR(i,e) for(I i=0; i < (e); ++i)
I pad(I w) { return (w3+3) & ~3; }
void write_bmp_header(FILE f, I w, I h) {
#define SET(i, x) H[i]=(x) & 0xff ; H[i+1]=((x) >> 8) & 0xff ; H[i+2]=((x) >> 16) & 0xff ; H[i+3]=((x) >> 24) & 0xff ;
UC H[54]= { 0 };
H[0]=66; H[1]=77; H[10]=54; H[14]=40; H[26]=1; H[28]=24;
SET(2, pad(w)h+54);
SET(18, w);
SET(22, h);
SET(34, pad(w)h);
fwrite(H, 1, 54, f);
}
D fractal(D x, D y) {
D steps=256;
D p=0;
for (I k = 0; k<256; ++k) {
D tx=x;
x=xx-yy-0.755;
y=2txy+0.15;
D r=xx+yy;
if (r > 30) {
steps=k+(30-p) / (r-p);
break;
}
p=r;
}
return steps;
}
void get_pixel(I i, I j, I w, I h, UC col[3]) {
D fr=0, fg=0, fb=0;
I aa=3;
FOR(dj, aa) {
FOR(di, aa) {
D jj=(j+308+1.0dj/aa -w/2);
D ii=(i-420+1.0di/aa -h/2);
D cos=0.855 * 1.92 / w;
D sin=0.516 * 1.92 / w;
D x=jj * cos-ii * sin;
D y=jj * sin+ii * cos;
D c=fractal(x, y);
c=256-c;
c=cc/256/256;
fr+=255-205c;
fg+=173-151c;
fb+=408-348c;
}
}
I d=aa*aa;
fr/=d;
fg/=d;
fb/=d;
col[0]=fb>255?255:fb;
col[1]=fg>255?255:fg;
col[2]=fr>255?255:fr;
}
I main() {
FILE f=fopen(“out.bmp”, “wb”);
I w=1600, h=900;
write_bmp_header(f, w, h);
FOR(i, h) {
FOR(j, w) {
UC col[3];
get_pixel(i, j, w, h, col);
fwrite(col, 1, 3, f);
}
I p=pad(w)-3w;
if (p) {
UC pp[4]={ 0 };
fwrite(pp, 1, p, f);
}
}
fclose(f);
return 0;
}
||
Edited
Portion of a Julia Set fractal, right?
Edited
This is absolutely awesome, man.
@Camellias
Impressive
I put link to my DeviantArt in the program code in comments. Some scanners ignore 1500 letters code and extract only the URL from the whole big text.
It gives you uncompiled (and really ugly) C____ code that, if you compile it, creates this fractal BMP image (tho I’ve included a PNG as well in case Derpibooru can’t display BMPs):
got em
It doesn’t go, it compiles and runs.
Edited