/* Zooms sur les images -------------------- new 31 janvier 2009 - avenue Saint Exupery */ #include #include #include #include #include "tthimage.h" /*::------------------------------------------------------------------::*/ /* private variables */ /*::------------------------------------------------------------------::*/ /* private functions */ /*::------------------------------------------------------------------::*/ int Image_essai_zoom(Image_Desc *src, Image_Desc *dst, double kx, double ky, int flags) { int xd, yd, xs, ys; int rd, gd, bd; double dxs, dys; /* destination float position */ #if DEBUG_LEVEL long hit, mess; #endif #if DEBUG_LEVEL fprintf(stderr, "%s : %p -> %p %f %f 0x%x\n", __func__, src, dst, kx, ky, flags); #endif /* initilaisation de variables de debug/comptage */ #if DEBUG_LEVEL hit = mess = 0L; #endif for (xd=0; xdwidth; xd++) { dxs = (double)xd * kx; for (yd=0; ydheight; yd++) { rd = gd = bd = 42; dys = (double)yd * ky; /* kikoo lol */ xs = (int)dxs; ys = (int)dys; if ( Image_xy_inside(src, xs, ys) ) { Image_getRGB(src, xs, ys, &rd, &gd, &bd); #if DEBUG_LEVEL hit++; #endif } #if DEBUG_LEVEL else mess++; #endif Image_plotRGB(dst, xd, yd, rd, gd, bd); } } #if DEBUG_LEVEL fprintf(stderr, "%s -> hit=%ld mess=%ld\n", __func__, hit, mess); #endif return BAD_ZOOM; } /*::------------------------------------------------------------------::*/ int Image_zoom_000(Image_Desc *src, Image_Desc *dst, Image_Rect *rect) { int xd, yd, r, g, b; double fxd, fyd; #if DEBUG_LEVEL fprintf(stderr, "%s ( %p %p %p )\n", __func__, src, dst, rect); #endif for (yd=0; ydheight; yd++) { fyd = (double)yd; for (xd=0; xdheight; xd++) { fxd = (double)xd; } } return FULL_NUCKED; } /*::------------------------------------------------------------------::*/