Rev 8897 | Rev 12473 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8897 | Rev 11120 | ||
---|---|---|---|
Line 82... | Line 82... | ||
82 | } |
82 | } |
83 | /* same in Texgif/image.c */ |
83 | /* same in Texgif/image.c */ |
84 | int getcolor(int r, int g, int b) |
84 | int getcolor(int r, int g, int b) |
85 | { |
85 | { |
86 | int col; |
86 | int col; |
87 | if(r>255) r=255 |
87 | if(r>255) r=255; |
- | 88 | if(r<0) r=0; |
|
88 | if(g>255) g=255 |
89 | if(g>255) g=255; |
- | 90 | if(g<0) g=0; |
|
89 | if(b>255) b=255 |
91 | if(b>255) b=255; |
- | 92 | if(b<0) b=0; |
|
90 | col=gdImageColorExact(image, r, g, b); |
93 | col=gdImageColorExact(image, r, g, b); |
91 | if(col==-1) col=gdImageColorAllocate(image,r,g,b); |
94 | if(col==-1) col=gdImageColorAllocate(image,r,g,b); |
92 | return col; |
95 | return col; |
93 | } |
96 | } |
94 | 97 | ||
Line 152... | Line 155... | ||
152 | } |
155 | } |
153 | else {x=dbuf[i]; y=dbuf[i+1];} |
156 | else {x=dbuf[i]; y=dbuf[i+1];} |
154 | scale_buf[i]=x+transx; scale_buf[i+1]=y+transy; |
157 | scale_buf[i]=x+transx; scale_buf[i+1]=y+transy; |
155 | ibuf[i]=rint((x-xstart+transx)*xscale); |
158 | ibuf[i]=rint((x-xstart+transx)*xscale); |
156 | ibuf[i+1]=rint((y-ystart+transy)*yscale); |
159 | ibuf[i+1]=rint((y-ystart+transy)*yscale); |
157 | if(ibuf[i]<-BOUND) ibuf[i]=- |
160 | if(ibuf[i]<-BOUND) ibuf[i]=-BOUND; |
- | 161 | if(ibuf[i]>BOUND) ibuf[i]=BOUND; |
|
158 | if(ibuf[i+1]<-BOUND) ibuf[i+1]=- |
162 | if(ibuf[i+1]<-BOUND) ibuf[i+1]=-BOUND; |
- | 163 | if(ibuf[i+1]>BOUND) ibuf[i+1]=BOUND; |
|
159 | } |
164 | } |
160 | } |
165 | } |
161 | 166 | ||
162 | /* scale without displacement */ |
167 | /* scale without displacement */ |
163 | void scale2(double xin, double yin, double *xout, double *yout) |
168 | void scale2(double xin, double yin, double *xout, double *yout) |