File:Antialiased.png

From formulasearchengine
Jump to navigation Jump to search

Antialiased.png(128 × 128 pixels, file size: 10 KB, MIME type: image/png)

This file is from Wikimedia Commons and may be used by other projects. The description on its file description page there is shown below.

Summary

Description
English: antialiased chessboard
Date 03:57 Jan 24, 2003 (UTC))
Source Own work
Author Loisel


GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
This licensing tag was added to this file as part of the GFDL licensing update.

C src code

generated by this code, which I (Loisel wrote myself

 #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);
       }
 }
date/time username edit summary
19:22, 22 December 2004 en:User:Quadell (tagged)
20:47, 6 December 2004 en:User:Bernard Helmstetter (code fix up)
03:57, 24 January 2003 en:User:Loisel
03:57, 24 January 2003 en:User:Loisel (antialiased chessboard)

Original upload log

Legend: (cur) = this is the current file, (del) = delete this old version, (rev) = revert to this old version.

Click on date to download the file or see the image uploaded on that date.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

image/png

fa9a8dcfe363a5a7c91af4f842de029a915d78c0

10,443 byte

128 pixel

128 pixel

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current11:50, 17 May 2023Thumbnail for version as of 11:50, 17 May 2023128 × 128 (10 KB)wikimediacommons>PhreneticcReduced file weight with FileOptimizer in lossless compression mode.

There are no pages that use this file.