156 LWord numInputPixels,
157 LWord numOutputPixels)
160 LWord count,inputIndex,reSampleStartPixel,reSampleEndPixel;
162 Fixed_ increment,coefIndex;
164 Input[-1] = Input[0];
165 Input[numInputPixels] = Input[numInputPixels+1] = Input[numInputPixels-1];
167 increment = (numInputPixels<<16)/numOutputPixels;
168 reSampleStartPixel = (startPixel*numOutputPixels)/numInputPixels;
169 reSampleEndPixel = (endPixel*numOutputPixels)/numInputPixels;
170 for ( count = reSampleStartPixel; count < reSampleEndPixel; count++ )
172 accum = (increment*count);
174 coefIndex = (accum>>11) & 0x1F;
188 LWord numInputPixels,
189 LWord numOutputPixels)
192 LWord count,inputIndex,reSampleStartPixel,reSampleEndPixel;
194 Fixed_ increment,coefIndex;
196 Input[-1] = Input[0];
197 Input[numInputPixels] = Input[numInputPixels+1] = Input[numInputPixels-1];
199 increment = (numInputPixels<<16)/numOutputPixels;
200 reSampleStartPixel = (startPixel*numOutputPixels)/numInputPixels;
201 reSampleEndPixel = (endPixel*numOutputPixels)/numInputPixels;
202 for ( count = reSampleStartPixel; count < reSampleEndPixel; count++ )
204 accum = (increment*count);
206 coefIndex = (accum>>11) & 0x1F;
211 #define MIN_YCBCR_10BIT 4
212 #define MAX_YCBCR_10BIT 1019
213 #define ClipYCbCr_10BIT(X) ((X) > MAX_YCBCR_10BIT ? (MAX_YCBCR_10BIT) : ((X) < MIN_YCBCR_10BIT ? (MIN_YCBCR_10BIT) : (X)))
219 LWord numInputPixels,
220 LWord numOutputPixels)
223 LWord count,inputIndex,reSampleStartPixel,reSampleEndPixel;
225 Fixed_ increment,coefIndex;
227 Word* yBuffer =
new Word[numInputPixels+4];
228 Word* cbBuffer =
new Word[numInputPixels/2+4];
229 Word* crBuffer =
new Word[numInputPixels/2+4];
232 for ( count = 0; count < numInputPixels; count++ )
236 crBuffer[count/2+1] = Input[count*2];
240 cbBuffer[count/2+1] = Input[count*2];
243 yBuffer[count+1] = Input[count*2+1];
246 yBuffer[0] = yBuffer[1];
247 yBuffer[numInputPixels+1] = yBuffer[numInputPixels+2] = yBuffer[numInputPixels];
249 increment = (numInputPixels<<16)/numOutputPixels;
250 reSampleStartPixel = 0;
251 reSampleEndPixel = numOutputPixels;
252 for ( count = reSampleStartPixel; count < reSampleEndPixel; count++ )
254 accum = (increment*count);
256 coefIndex = (accum>>11) & 0x1F;
260 reSampleStartPixel = 0;
261 reSampleEndPixel = numOutputPixels/2;
262 cbBuffer[0] = cbBuffer[1];
263 cbBuffer[numInputPixels/2+1] = cbBuffer[numInputPixels/2+2] = cbBuffer[numInputPixels/2];
264 crBuffer[0] = crBuffer[1];
265 crBuffer[numInputPixels/2+1] = crBuffer[numInputPixels/2+2] = crBuffer[numInputPixels/2];
267 for ( count = reSampleStartPixel; count < reSampleEndPixel; count++ )
269 accum = (increment*count);
271 coefIndex = (accum>>11) & 0x1F;
286 LWord numInputPixels,
287 LWord numOutputPixels,
288 Word channelInterleaveMulitplier)
290 LWord count,inputIndex,reSampleStartPixel,reSampleEndPixel;
292 Fixed_ increment,coefIndex;
294 increment = (numInputPixels<<16)/numOutputPixels;
295 reSampleStartPixel = (startPixel*numOutputPixels)/numInputPixels;
296 reSampleEndPixel = (endPixel*numOutputPixels)/numInputPixels;
297 for ( count = reSampleStartPixel; count < reSampleEndPixel; count++ )
299 accum = (increment*count);
301 coefIndex = (accum>>11) & 0x1F;
309 LWord InterPolatedValue;
322 LWord InterPolatedValue;
329 if ( InterPolatedValue > 32767 )
330 InterPolatedValue = 32767;
331 if ( InterPolatedValue < -32767 )
332 InterPolatedValue = -32767;
334 return (
Word)(InterPolatedValue&0xFFFF);
349 InterPolatedValue.
Red = (
UByte)((temp < 0 ) ? 0 : (temp > 255 ) ? 255 : temp);
355 InterPolatedValue.
Green = (
UByte)((temp < 0 ) ? 0 : (temp > 255 ) ? 255 : temp);
363 InterPolatedValue.
Blue = (
UByte)((temp < 0 ) ? 0 : (temp > 255 ) ? 255 : temp);
370 InterPolatedValue.
Alpha = (
UByte)((temp < 0 ) ? 0 : (temp > 255 ) ? 255 : temp);
372 return InterPolatedValue;