922 } 923 924 /** 925 * Returns the type of this <code>Transparency</code>. 926 * @return the field type of this <code>Transparency</code>, which is 927 * either OPAQUE, BITMASK or TRANSLUCENT. 928 */ 929 public int getTransparency() { 930 return getColorModel().getTransparency(); 931 } 932 933 /** 934 * Return a readable Raster which contains the pixels for the 935 * specified rectangular region of the destination surface. 936 * The coordinate origin of the returned Raster is the same as 937 * the device space origin of the destination surface. 938 * In some cases the returned Raster might also be writeable. 939 * In most cases, the returned Raster might contain more pixels 940 * than requested. 941 * 942 * @see useTightBBoxes 943 */ 944 public abstract Raster getRaster(int x, int y, int w, int h); 945 946 /** 947 * Does the pixel accessibility of the destination surface 948 * suggest that rendering algorithms might want to take 949 * extra time to calculate a more accurate bounding box for 950 * the operation being performed? 951 * The typical case when this will be true is when a copy of 952 * the pixels has to be made when doing a getRaster. The 953 * fewer pixels copied, the faster the operation will go. 954 * 955 * @see getRaster 956 */ 957 public boolean useTightBBoxes() { 958 // Note: The native equivalent would trigger on VISIBLE_TO_NATIVE 959 // REMIND: This is not used - should be obsoleted maybe 960 return true; 961 } 962 963 /** 964 * Returns the pixel data for the specified Argb value packed 965 * into an integer for easy storage and conveyance. 966 */ 967 public int pixelFor(int rgb) { 968 return surfaceType.pixelFor(rgb, colorModel); 969 } 970 971 /** 972 * Returns the pixel data for the specified color packed into an 973 * integer for easy storage and conveyance. 974 * 975 * This method will use the getRGB() method of the Color object | 922 } 923 924 /** 925 * Returns the type of this <code>Transparency</code>. 926 * @return the field type of this <code>Transparency</code>, which is 927 * either OPAQUE, BITMASK or TRANSLUCENT. 928 */ 929 public int getTransparency() { 930 return getColorModel().getTransparency(); 931 } 932 933 /** 934 * Return a readable Raster which contains the pixels for the 935 * specified rectangular region of the destination surface. 936 * The coordinate origin of the returned Raster is the same as 937 * the device space origin of the destination surface. 938 * In some cases the returned Raster might also be writeable. 939 * In most cases, the returned Raster might contain more pixels 940 * than requested. 941 * 942 * @see #useTightBBoxes 943 */ 944 public abstract Raster getRaster(int x, int y, int w, int h); 945 946 /** 947 * Does the pixel accessibility of the destination surface 948 * suggest that rendering algorithms might want to take 949 * extra time to calculate a more accurate bounding box for 950 * the operation being performed? 951 * The typical case when this will be true is when a copy of 952 * the pixels has to be made when doing a getRaster. The 953 * fewer pixels copied, the faster the operation will go. 954 * 955 * @see #getRaster 956 */ 957 public boolean useTightBBoxes() { 958 // Note: The native equivalent would trigger on VISIBLE_TO_NATIVE 959 // REMIND: This is not used - should be obsoleted maybe 960 return true; 961 } 962 963 /** 964 * Returns the pixel data for the specified Argb value packed 965 * into an integer for easy storage and conveyance. 966 */ 967 public int pixelFor(int rgb) { 968 return surfaceType.pixelFor(rgb, colorModel); 969 } 970 971 /** 972 * Returns the pixel data for the specified color packed into an 973 * integer for easy storage and conveyance. 974 * 975 * This method will use the getRGB() method of the Color object |