Advertisement
Ikki_uni

Pixelcolor.c

May 29th, 2015
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.98 KB | None | 0 0
  1. //External header includes
  2. #include "pixelColor.h"
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <math.h>
  6.  
  7. #define PI 3.141592653589793
  8. #define EXP 2.718281828
  9.  
  10. //The following functions determine the intensity of colours for each pixel
  11. //based on the value of steps. RED, GREEN and BLUE (RGB) are used to determine
  12. //the colour for any given pixel in the set.
  13.  
  14. //http://localhost:1917/X-0.5705_Y0.562_Z17.bmp
  15.  
  16. unsigned char stepsToRed (int steps){
  17.     unsigned char red = '0';
  18.    
  19.     //red = fmod(rand(),steps);
  20.     red = fmod(PI,steps);
  21.     //red = steps;
  22.    
  23.     return red;
  24. }
  25.  
  26. unsigned char stepsToBlue (int steps){
  27.     unsigned char blue = 0;
  28.    
  29.     //blue = pow(rand(),steps);
  30.     blue = pow(EXP,steps);
  31.     //blue =  steps; // Snowflakes galaxy
  32.    
  33.     return blue;
  34. }
  35.  
  36. unsigned char stepsToGreen (int steps){
  37.     unsigned char green = 0;
  38.    
  39.     //green = rand()*tan(steps)
  40.     green = tan(steps);
  41.     //green = steps;
  42.    
  43.     return green;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement