home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / sun / java2d / loops / TextRendering.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  3.5 KB  |  72 lines

  1. package sun.java2d.loops;
  2.  
  3. import java.awt.Color;
  4. import java.awt.image.ColorModel;
  5.  
  6. public class TextRendering implements GraphicsPrimitives {
  7.    static int[] ST_INT_ARGB = new int[]{2};
  8.    static int[] ST_INT_RGB = new int[]{1};
  9.    static int[] ST_INT_BGR = new int[]{4};
  10.    static int[] ST_SHORT_555_RGB = new int[]{9};
  11.    static int[] ST_SHORT_565_RGB = new int[]{8};
  12.    static int[] ST_BYTE_INDEXED = new int[]{13};
  13.    static int[] ST_BYTE_GRAY = new int[]{10};
  14.    static int[] ST_INDEX8_GRAY = new int[]{-17};
  15.    static int[] ST_3BYTE_BGR = new int[]{5};
  16.    static int[] ST_24BIT_RGB = new int[]{-12};
  17.  
  18.    public final GraphicsPrimitive[] getPrimitives() {
  19.       GraphicsPrimitive[] var1 = new GraphicsPrimitive[]{new GraphicsPrimitiveProxy(this, "drawStringARGB", ST_INT_ARGB, DrawString.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawCharsARGB", ST_INT_ARGB, DrawChars.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawBytesARGB", ST_INT_ARGB, DrawBytes.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawGlyphVectorARGB", ST_INT_ARGB, DrawGlyphVector.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawStringRGB", ST_INT_RGB, DrawString.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawCharsRGB", ST_INT_RGB, DrawChars.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawBytesRGB", ST_INT_RGB, DrawBytes.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawGlyphVectorRGB", ST_INT_RGB, DrawGlyphVector.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawStringBGR", ST_INT_BGR, DrawString.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawCharsBGR", ST_INT_BGR, DrawChars.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawBytesBGR", ST_INT_BGR, DrawBytes.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawGlyphVectorBGR", ST_INT_BGR, DrawGlyphVector.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawString555", ST_SHORT_555_RGB, DrawString.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawChars555", ST_SHORT_555_RGB, DrawChars.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawBytes555", ST_SHORT_555_RGB, DrawBytes.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawGlyphVector555", ST_SHORT_555_RGB, DrawGlyphVector.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawString565", ST_SHORT_565_RGB, DrawString.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawChars565", ST_SHORT_565_RGB, DrawChars.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawBytes565", ST_SHORT_565_RGB, DrawBytes.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawGlyphVector565", ST_SHORT_565_RGB, DrawGlyphVector.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawStringIndexed", ST_BYTE_INDEXED, DrawString.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawCharsIndexed", ST_BYTE_INDEXED, DrawChars.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawBytesIndexed", ST_BYTE_INDEXED, DrawBytes.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawGlyphVectorIndexed", ST_BYTE_INDEXED, DrawGlyphVector.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawStringByteGray", ST_BYTE_GRAY, DrawString.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawCharsByteGray", ST_BYTE_GRAY, DrawChars.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawBytesByteGray", ST_BYTE_GRAY, DrawBytes.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawGlyphVectorByteGray", ST_BYTE_GRAY, DrawGlyphVector.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawStringIndex8Gray", ST_INDEX8_GRAY, DrawString.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawCharsIndex8Gray", ST_INDEX8_GRAY, DrawChars.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawBytesIndex8Gray", ST_INDEX8_GRAY, DrawBytes.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawGlyphVectorIndex8Gray", ST_INDEX8_GRAY, DrawGlyphVector.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawString24BITBGR", ST_3BYTE_BGR, DrawString.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawChars24BITBGR", ST_3BYTE_BGR, DrawChars.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawBytes24BITBGR", ST_3BYTE_BGR, DrawBytes.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawGlyphVector24BITBGR", ST_3BYTE_BGR, DrawGlyphVector.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawString24BITRGB", ST_24BIT_RGB, DrawString.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawChars24BITRGB", ST_24BIT_RGB, DrawChars.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawBytes24BITRGB", ST_24BIT_RGB, DrawBytes.getMethodSignature()), new GraphicsPrimitiveProxy(this, "drawGlyphVector24BITRGB", ST_24BIT_RGB, DrawGlyphVector.getMethodSignature())};
  20.       return var1;
  21.    }
  22.  
  23.    static int toS555(Color var0) {
  24.       int var1 = var0.getRGB();
  25.       int var2 = var1 >> 19 & 31;
  26.       int var3 = var1 >> 11 & 31;
  27.       int var4 = var1 >> 3 & 31;
  28.       return var2 << 10 | var3 << 5 | var4;
  29.    }
  30.  
  31.    static int toS565(Color var0) {
  32.       int var1 = var0.getRGB();
  33.       int var2 = var1 >> 19 & 31;
  34.       int var3 = var1 >> 10 & 63;
  35.       int var4 = var1 >> 3 & 31;
  36.       return var2 << 11 | var3 << 5 | var4;
  37.    }
  38.  
  39.    static int toGray16(Color var0) {
  40.       int var1 = var0.getRGB();
  41.       int var2 = var1 >> 16 & 255;
  42.       var2 += var2 << 8;
  43.       int var3 = var1 >> 8 & 255;
  44.       var3 += var3 << 8;
  45.       int var4 = var1 & 255;
  46.       var4 += var4 << 8;
  47.       return (int)((double)var2 * 0.299 + (double)var3 * 0.587 + (double)var4 * 0.114);
  48.    }
  49.  
  50.    static int toGray8(Color var0) {
  51.       int var1 = var0.getRGB();
  52.       int var2 = var1 >> 16 & 255;
  53.       int var3 = var1 >> 8 & 255;
  54.       int var4 = var1 & 255;
  55.       return (int)((double)var2 * 0.299 + (double)var3 * 0.587 + (double)var4 * 0.114);
  56.    }
  57.  
  58.    static int toXBGR(Color var0) {
  59.       int var1 = var0.getRGB();
  60.       int var2 = var1 >> 16 & 255;
  61.       int var3 = var1 >> 8 & 255;
  62.       int var4 = var1 & 255;
  63.       return var4 << 16 | var3 << 8 | var2;
  64.    }
  65.  
  66.    static int toIndexed(Color var0, ColorModel var1) {
  67.       byte[] var2 = new byte[]{0};
  68.       var1.getDataElements(var0.getRGB(), var2);
  69.       return var2[0];
  70.    }
  71. }
  72.