ملف:Aliased.png
من testwiki
اذهب إلى التنقل
اذهب إلى البحث
Aliased.png (١٢٨ × ١٢٨ بكسل حجم الملف: ٧٨١ بايت، نوع MIME: image/png)
هذا الملف من ويكيميديا كومنز ويمكن استخدامه بواسطة المشاريع الأخرى. الوصف على صفحة وصف الملف هناك معروض بالأسفل.
ملخص
| الوصفAliased.png |
English: Aliased chessboard |
| التاريخ | |
| المصدر | عمل شخصي |
| المؤلف | Loisel في ويكيبيديا الإنجليزية |
ترخيص
Loisel at the English Wikipedia، صاحب حقوق التأليف والنشر لهذا العمل، أنشر هذا العمل تحت الرخصة التالية:
| يسمح نسخ وتوزيع و/أو تعديل هذه الوثيقة تحت شروط رخصة جنو للوثائق الحرة، الإصدار 1.2 أو أي إصدار لاحق تنشره مؤسسة البرمجيات الحرة؛ دون أقسام ثابتة ودون نصوص أغلفة أمامية ودون نصوص أغلفة خلفية. نسخة من الرخصة تم تضمينها في القسم المسمى GNU Free Documentation License.http://www.gnu.org/copyleft/fdl.htmlGFDLGNU Free Documentation Licensetruetrue |
| هذا الملفُّ مُرخَّص بموجب رخصة المشاع الإبداعي نسبة المُصنَّف إِلى مُؤَلِّفه - المشاركة بالمثل 3.0 العامة | ||
نسب العمل لمُؤَلِّفه:
Loisel at the English Wikipedia | ||
| ||
| تمت إضافة علامة الترخيص لهذا الملف كجزء من رخصة جنو للوثائق الحرة تحديث الترخيص.http://creativecommons.org/licenses/by-sa/3.0/CC BY-SA 3.0Creative Commons Attribution-Share Alike 3.0truetrue |
C source code
Original code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <assert.h>
int color(double x, double y)
{
double t,z;
int i,j,k;
x=x/128.0-0.5;
y=y/2048.0;
t=1.0/(y+0.001);
z=t*x;
i=floor(t);
j=floor(z);
k=i+j;
/* printf("%f %f -> %i %i %i\n",t,z,i,j,k%2); */
return ((k%2)!=0);
}
double myrand()
{
return rand()/((double)RAND_MAX);
}
int main()
{
int i,j,k,l;
double x,y;
printf("P5\n128 128\n255\n");
srand(time(0));
for(i=0;i<128;i++)
for(j=0;j<128;j++)
{
k=0;
for(l=0;l<255;l++)
{
x=j+myrand();
y=i+myrand();
k+=color(x,y);
}
assert(k>=0 && k<=255);
putchar(k);
}
}
New code with only small changes :
To compile :
gcc a.c -Wall -lm
to run :
./a.out >a.pgm
To convert using Image Magic :
convert 5000.pgm -resize 1000x1000 a.png
// https://commons.wikimedia.org/wiki/File:Aliased.png
// gcc a.c -Wall -lm
// gcc a.c -Wall -lm
// ./a.out >a.pgm
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <assert.h>
int iMax =5000;
int jMax ;
int color(double x, double y)
{
double t,z;
int i,j,k;
x=x/(1.0*iMax)-0.5;
y=y/(jMax*6);
t=1.0/(y+0.001);
z=t*x;
i=floor(t);
j=floor(z);
k=i+j;
/* printf("%f %f -> %i %i %i\n",t,z,i,j,k%2); */
return ((k%2)!=0);
}
double myrand()
{
return rand()/((double)RAND_MAX);
}
int main()
{
int i,j,k,l;
double x,y;
jMax = iMax;
printf("P5\n %d %d\n255\n", iMax, jMax);
srand(time(0));
for(i=0;i<iMax;i++)
for(j=0;j<jMax;j++)
{
k=0;
for(l=0;l<255;l++)
{
x=j+myrand();
y=i+myrand();
k+=color(x,y);
}
assert(k>=0 && k<=255);
putchar(k);
}
return 0;
}
Source code was formatted with Emacs using GNU style.
سجلُّ الرَّفع الأصيل
صفحة الوصف الأصلية كانت هنا، تشير جميع أسماء المستخدمين التالية إلى en.wikipedia.
- 2007-09-15 05:17 Dicklyon 128×128×8 (892 bytes) Reverted to version as of 13:34, 30 September 2005
- 2007-09-14 22:56 AzaToth 1600×1200×8 (42986 bytes) remade it in povray
- 2005-09-30 13:34 Riumplus 128×128×8 (892 bytes) Losslessly recompressed the image, shrinking file size by 39%
- 2003-01-24 20:28 Loisel 128×128×8 (1450 bytes) slightly bugfixed image
الشروحات
أضف شرحاً من سطر واحد لما يُمثِّله هذا الملف
العناصر المصورة في هذا الملف
يُصوِّر
٢٤ يناير 2003
image/png
bfbecdb8c35d141320686b9adfd6f560e87eaa30
٧٨١ بايت
١٢٨ بكسل
١٢٨ بكسل
تاريخ الملف
اضغط على زمن/تاريخ لرؤية الملف كما بدا في هذا الزمن.
| زمن/تاريخ | صورة مصغرة | الأبعاد | مستخدم | تعليق | |
|---|---|---|---|---|---|
| حالي | ١٠:٤٩، ١٧ مايو ٢٠٢٣ | ١٢٨ × ١٢٨ (٧٨١ بايت) | wikimediacommons>Phreneticc | Reduced file weight with FileOptimizer in lossless compression mode. |
استخدام الملف
الصفحة التالية تستخدم هذا الملف:
