Advertisement
Guest User

integrateTexture

a guest
Nov 22nd, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.59 KB | None | 0 0
  1. Color integrateTexture(unsigned char *pixels, int width, int height, int depth, float s, float t, int deltas, int deltat){
  2.     //return getTexel(pixels, width, height, depth, (int)std::floor(s), (int)std::floor(t));
  3.     int i, j, s_, t_;
  4.     s_ = (int)std::floor(s);
  5.     t_ = (int)std::floor(t);
  6.     Color buffer = init_color(0.f, 0.f, 0.f);
  7.     for (i = s_; i <= deltas; i++)  
  8.     {
  9.         for (j = t_; j <= deltat; j++)
  10.         {
  11.             buffer = add_color_color(getTexel(pixels, width, height, depth, i, j), buffer);
  12.         }
  13.     }
  14.     return(buffer * (1/(deltas * deltat)));
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement