Lines Matching defs:pixel

33  * class that works with pixel values that represent RGB
35 * samples for a single pixel into a single int, short, or byte quantity.
42 * There must be three color samples in the pixel values and there can
44 * pixel representation of type <code>transferType</code>, the array
51 * the single int pixel representation used by other methods. The
61 * The translation from pixel values to color/alpha components for
70 * of pixel data will be done according to the masks of the
73 * A single int pixel representation is valid for all objects of this
74 * class, since it is always possible to represent pixel values used with
77 * due to an invalid pixel value.
130 * that indicate which bits in an <code>int</code> pixel representation
131 * contain the red, green and blue color samples. As pixel values do not
135 * of least significant bits of an <code>int</code> pixel representation.
139 * or DataBuffer.TYPE_INT that can hold a single pixel.
140 * @param bits the number of bits in the pixel values; for example,
143 * integer pixel contain the red component
145 * integer pixel contain the green component
147 * integer pixel contain the blue component
157 * that indicate which bits in an <code>int</code> pixel representation
159 * if present. If <code>amask</code> is 0, pixel values do not contain
163 * of an <code>int</code> pixel representation. Alpha, if present, is not
168 * or DataBuffer.TYPE_INT that can hold a single pixel.
169 * @param bits the number of bits in the pixel values; for example,
172 * integer pixel contain the red component
174 * integer pixel contain the green component
176 * integer pixel contain the blue component
178 * integer pixel contain the alpha component
195 * The masks specify which bits in an <code>int</code> pixel
197 * the alpha sample, if present. If <code>amask</code> is 0, pixel
201 * of least significant bits of an <code>int</code> pixel
204 * color and alpha samples in pixel values. If the <code>boolean</code>
209 * is the type of primitive array used to represent pixel values and
213 * @param bits the number of bits in the pixel values; for example,
216 * integer pixel contain the red component
218 * integer pixel contain the green component
220 * integer pixel contain the blue component
222 * integer pixel contain the alpha component
225 * @param transferType the type of array used to represent pixel values
264 * Returns the mask indicating which bits in an <code>int</code> pixel
267 * pixel representation contain the red color sample.
274 * Returns the mask indicating which bits in an <code>int</code> pixel
277 * pixel representation contain the green color sample.
284 * Returns the mask indicating which bits in an <code>int</code> pixel
287 * pixel representation contain the blue color sample.
294 * Returns the mask indicating which bits in an <code>int</code> pixel
297 * pixel representation contain the alpha sample.
309 * Given an int pixel in this ColorModel's ColorSpace, converts
313 private float[] getDefaultRGBComponents(int pixel) {
314 int components[] = getComponents(pixel, null, 0);
321 private int getsRGBComponentFromsRGB(int pixel, int idx) {
322 int c = ((pixel & maskArray[idx]) >>> maskOffsets[idx]);
324 int a = ((pixel & maskArray[3]) >>> maskOffsets[3]);
335 private int getsRGBComponentFromLinearRGB(int pixel, int idx) {
336 int c = ((pixel & maskArray[idx]) >>> maskOffsets[idx]);
339 int a = ((pixel & maskArray[3]) >>> maskOffsets[3]);
356 * Returns the red color component for the specified pixel, scaled
358 * color conversion is done if necessary. The pixel value is specified
364 * @param pixel the specified pixel
365 * @return the red color component for the specified pixel, from
368 final public int getRed(int pixel) {
370 return getsRGBComponentFromsRGB(pixel, 0);
372 return getsRGBComponentFromLinearRGB(pixel, 0);
374 float rgb[] = getDefaultRGBComponents(pixel);
379 * Returns the green color component for the specified pixel, scaled
381 * color conversion is done if necessary. The pixel value is specified
387 * @param pixel the specified pixel
388 * @return the green color component for the specified pixel, from
391 final public int getGreen(int pixel) {
393 return getsRGBComponentFromsRGB(pixel, 1);
395 return getsRGBComponentFromLinearRGB(pixel, 1);
397 float rgb[] = getDefaultRGBComponents(pixel);
402 * Returns the blue color component for the specified pixel, scaled
404 * color conversion is done if necessary. The pixel value is specified
410 * @param pixel the specified pixel
411 * @return the blue color component for the specified pixel, from
414 final public int getBlue(int pixel) {
416 return getsRGBComponentFromsRGB(pixel, 2);
418 return getsRGBComponentFromLinearRGB(pixel, 2);
420 float rgb[] = getDefaultRGBComponents(pixel);
425 * Returns the alpha component for the specified pixel, scaled
426 * from 0 to 255. The pixel value is specified as an <code>int</code>.
427 * @param pixel the specified pixel
428 * @return the value of the alpha component of <code>pixel</code>
431 final public int getAlpha(int pixel) {
433 int a = ((pixel & maskArray[3]) >>> maskOffsets[3]);
441 * Returns the color/alpha components of the pixel in the default
443 * The pixel value is specified as an <code>int</code>.
448 * @param pixel the specified pixel
450 * pixel.
453 final public int getRGB(int pixel) {
455 return (getAlpha(pixel) << 24)
456 | (getRed(pixel) << 16)
457 | (getGreen(pixel) << 8)
458 | (getBlue(pixel) << 0);
460 float rgb[] = getDefaultRGBComponents(pixel);
461 return (getAlpha(pixel) << 24)
468 * Returns the red color component for the specified pixel, scaled
470 * color conversion is done if necessary. The pixel value is specified
481 * pixel value for this <code>ColorModel</code>. Since
489 * @param inData the array containing the pixel value
490 * @return the value of the red component of the specified pixel.
492 * large enough to hold a pixel value for this color model
499 int pixel=0;
503 pixel = bdata[0] & 0xff;
507 pixel = sdata[0] & 0xffff;
511 pixel = idata[0];
517 return getRed(pixel);
522 * Returns the green color component for the specified pixel, scaled
524 * color conversion is done if necessary. The pixel value is specified
533 * thrown if <code>inData</code> is not large enough to hold a pixel
542 * @param inData the array containing the pixel value
543 * @return the value of the green component of the specified pixel.
545 * large enough to hold a pixel value for this color model
552 int pixel=0;
556 pixel = bdata[0] & 0xff;
560 pixel = sdata[0] & 0xffff;
564 pixel = idata[0];
570 return getGreen(pixel);
575 * Returns the blue color component for the specified pixel, scaled
577 * color conversion is done if necessary. The pixel value is specified
586 * thrown if <code>inData</code> is not large enough to hold a pixel
595 * @param inData the array containing the pixel value
596 * @return the value of the blue component of the specified pixel.
598 * large enough to hold a pixel value for this color model
605 int pixel=0;
609 pixel = bdata[0] & 0xff;
613 pixel = sdata[0] & 0xffff;
617 pixel = idata[0];
623 return getBlue(pixel);
627 * Returns the alpha component for the specified pixel, scaled
628 * from 0 to 255. The pixel value is specified by an array of data
634 * thrown if <code>inData</code> is not large enough to hold a pixel
642 * @param inData the specified pixel
643 * @return the alpha component of the specified pixel, scaled from
648 * <code>inData</code> is not large enough to hold a pixel value
655 int pixel=0;
659 pixel = bdata[0] & 0xff;
663 pixel = sdata[0] & 0xffff;
667 pixel = idata[0];
673 return getAlpha(pixel);
677 * Returns the color/alpha components for the specified pixel in the
679 * necessary. The pixel value is specified by an array of data
684 * thrown if <code>inData</code> is not large enough to hold a pixel
695 * @param inData the specified pixel
696 * @return the color and alpha components of the specified pixel.
703 int pixel=0;
707 pixel = bdata[0] & 0xff;
711 pixel = sdata[0] & 0xffff;
715 pixel = idata[0];
721 return getRGB(pixel);
725 * Returns a data element array representation of a pixel in this
726 * <code>ColorModel</code>, given an integer pixel representation in the
729 * method of a <code>WritableRaster</code> object. If the pixel variable
730 * is <code>null</code>, a new array is allocated. If <code>pixel</code>
735 * thrown if <code>pixel</code> is not large enough to hold a pixel
736 * value for this <code>ColorModel</code>. The pixel array is returned.
742 * @param rgb the integer pixel representation in the default RGB
744 * @param pixel the specified pixel
745 * @return an array representation of the specified pixel in this
747 * @exception ClassCastException if <code>pixel</code>
750 * <code>pixel</code> is not large enough to hold a pixel value
758 public Object getDataElements(int rgb, Object pixel) {
763 pixel != null) {
764 intpixel = (int[])pixel;
880 if (pixel == null) {
883 bdata = (byte[])pixel;
890 if (pixel == null) {
893 sdata = (short[])pixel;
907 * Returns an array of unnormalized color/alpha components given a pixel
908 * in this <code>ColorModel</code>. The pixel value is specified as an
918 * @param pixel the specified pixel
920 * components of the specified pixel
924 * specified pixel starting at the specified offset.
926 final public int[] getComponents(int pixel, int[] components, int offset) {
932 components[offset+i] = (pixel & maskArray[i]) >>> maskOffsets[i];
939 * Returns an array of unnormalized color/alpha components given a pixel
940 * in this <code>ColorModel</code>. The pixel value is specified by an
942 * an object reference. If <code>pixel</code> is not a primitive array
945 * thrown if <code>pixel</code> is not large enough to hold a
946 * pixel value for this <code>ColorModel</code>. If the
959 * @param pixel the specified pixel
961 * components of the specified pixel
965 * specified pixel starting at the specified offset.
966 * @exception ClassCastException if <code>pixel</code>
969 * <code>pixel</code> is not large enough to hold a pixel value
977 final public int[] getComponents(Object pixel, int[] components,
982 byte bdata[] = (byte[])pixel;
986 short sdata[] = (short[])pixel;
990 int idata[] = (int[])pixel;
1046 * Returns a pixel value represented as an <code>int</code> in this
1056 * @return an <code>int</code> pixel value in this
1064 int pixel = 0;
1066 pixel |= ((components[offset+i]<<maskOffsets[i])&maskArray[i]);
1068 return pixel;
1072 * Returns a data element array representation of a pixel in this
1086 * <code>obj</code> is not large enough to hold a pixel value for this
1103 * <code>obj</code> is not large enough to hold a pixel value
1114 int pixel = 0;
1116 pixel |= ((components[offset+i]<<maskOffsets[i])&maskArray[i]);
1122 bdata[0] = (byte)(pixel&0xff);
1125 byte bdata[] = {(byte)(pixel&0xff)};
1131 sdata[0] = (short)(pixel&0xffff);
1134 short sdata[] = {(short)(pixel&0xffff)};
1140 idata[0] = pixel;
1143 int idata[] = {pixel};
1193 int pixel[] = null;
1204 pixel = raster.getPixel(rX, rY, pixel);
1205 normAlpha = pixel[aIdx] * alphaScale;
1208 pixel[c] = (int) (pixel[c] * normAlpha +
1211 raster.setPixel(rX, rY, pixel);
1227 pixel = raster.getPixel(rX, rY, pixel);
1228 normAlpha = pixel[aIdx] * alphaScale;
1231 pixel[c] = (int) (pixel[c] * normAlpha +
1234 raster.setPixel(rX, rY, pixel);
1250 pixel = raster.getPixel(rX, rY, pixel);
1251 normAlpha = pixel[aIdx] * alphaScale;
1254 pixel[c] = (int) (pixel[c] * normAlpha +
1257 raster.setPixel(rX, rY, pixel);
1281 pixel = raster.getPixel(rX, rY, pixel);
1282 normAlpha = pixel[aIdx] * alphaScale;
1286 pixel[c] = (int) (pixel[c] * invAlpha +
1289 raster.setPixel(rX, rY, pixel);
1299 pixel = raster.getPixel(rX, rY, pixel);
1300 normAlpha = pixel[aIdx] * alphaScale;
1304 pixel[c] = (int) (pixel[c] * invAlpha +
1307 raster.setPixel(rX, rY, pixel);
1317 pixel = raster.getPixel(rX, rY, pixel);
1318 normAlpha = pixel[aIdx] * alphaScale;
1322 pixel[c] = (int) (pixel[c] * invAlpha +
1325 raster.setPixel(rX, rY, pixel);