示例#1
0
int		cast_a_ray_alias(t_rt *img, int x, int y)
{
  t_ray		ray;
  t_color	color;
  t_obj		*tmp;
  int		colour[3];

  colour[0] = 0;
  colour[1] = 0;
  colour[2] = 0;
  ray.color = &color;
  init_ray(img, &ray, x, y);
  while (img && ray.x < x + 1)
    {
      ray.y = (double)y;
      while (ray.y < y + 1)
  	{
	  tmp = img->objs;
	  calc_color_alias(img, &ray, tmp);
	  calc_final_alias(ray.color, &colour[2], &colour[0], &colour[1]);
    	  ray.y += 0.125;
    	}
      ray.x += 0.125;
    }
  return (transform_pixel(colour[0], colour[1], colour[2]));
}
示例#2
0
 void SBAutoCorrelate::SBAutoCorrelateImpl::fillKImage(ImageView<std::complex<double> > im,
                                                       double kx0, double dkx, double dkxy,
                                                       double ky0, double dky, double dkyx) const
 {
     dbg<<"SBAutoCorrelate fillKImage\n";
     dbg<<"kx = "<<kx0<<" + i * "<<dkx<<" + j * "<<dkxy<<std::endl;
     dbg<<"ky = "<<ky0<<" + i * "<<dkyx<<" + j * "<<dky<<std::endl;
     GetImpl(_adaptee)->fillKImage(im,kx0,dkx,dkxy,ky0,dky,dkyx);
     transform_pixel(im, AbsSquare<std::complex<double> >());
 }
示例#3
0
 void SBAutoConvolve::SBAutoConvolveImpl::fillKImage(ImageView<std::complex<double> > im,
                                                     double kx0, double dkx, int izero,
                                                     double ky0, double dky, int jzero) const
 {
     dbg<<"SBAutoConvolve fillKImage\n";
     dbg<<"kx = "<<kx0<<" + i * "<<dkx<<", izero = "<<izero<<std::endl;
     dbg<<"ky = "<<ky0<<" + j * "<<dky<<", jzero = "<<jzero<<std::endl;
     GetImpl(_adaptee)->fillKImage(im,kx0,dkx,izero,ky0,dky,jzero);
     transform_pixel(im, Square<std::complex<double> >());
 }
示例#4
0
void ImageView<T>::copyFrom(const BaseImage<T>& rhs) const
{
    if (!this->_bounds.isSameShapeAs(rhs.getBounds()))
        throw ImageError("Attempt im1 = im2, but bounds not the same shape");
    transform_pixel(*this, rhs, ReturnSecond<T>());
}
示例#5
0
void ImageView<T>::invertSelf() const 
{
    transform_pixel(*this, ReturnInverse<T>());
}
示例#6
0
void ImageView<T>::fill(T x) const 
{
    transform_pixel(*this, ConstReturn<T>(x));
}