Ignore:
Timestamp:
Mar 11, 2008, 3:56:27 PM (15 years ago)
Author:
Sam Hocevar
Message:
  • getpixel/setpixel functions use doubles instead of ints for now.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpipi/trunk/pipi/resize.c

    r2246 r2260  
    2323#include <string.h>
    2424
     25#include "pipi.h"
    2526#include "pipi_internals.h"
    26 #include "pipi.h"
    2727
    2828pipi_image_t *pipi_resize(pipi_image_t const *src, int w, int h)
    2929{
    30     int *aline, *line;
     30    double *aline, *line;
    3131    pipi_image_t *dst;
    3232    int x, y, x0, y0, sw, dw, sh, dh, remy;
     
    3737    dw = dst->width; dh = dst->height;
    3838
    39     aline = malloc(3 * dw * sizeof(int));
    40     line = malloc(3 * dw * sizeof(int));
     39    aline = malloc(3 * dw * sizeof(double));
     40    line = malloc(3 * dw * sizeof(double));
    4141
    42     memset(line, 0, 3 * dw * sizeof(int));
     42    memset(line, 0, 3 * dw * sizeof(double));
    4343    remy = 0;
    4444
     
    4747        int toty = 0, ny;
    4848
    49         memset(aline, 0, 3 * dw * sizeof(int));
     49        memset(aline, 0, 3 * dw * sizeof(double));
    5050
    5151        while(toty < sh)
     
    5353            if(remy == 0)
    5454            {
    55                 int r = 0, g = 0, b = 0;
     55                double r = 0, g = 0, b = 0;
    5656                int remx = 0;
    5757
    5858                for(x = 0, x0 = 0; x < dst->width; x++)
    5959                {
    60                     int ar = 0, ag = 0, ab = 0;
     60                    double ar = 0, ag = 0, ab = 0;
    6161                    int totx = 0, nx;
    6262
Note: See TracChangeset for help on using the changeset viewer.