Java Doc for ColorModel.java in  » 6.0-JDK-Modules » j2me » java » awt » image » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » java.awt.image 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.awt.image.ColorModel

All known Subclasses:   java.awt.image.IndexColorModel,  java.awt.image.DirectColorModel,
ColorModel
abstract public class ColorModel implements Transparency(Code)
A class that encapsulates the methods for translating from pixel values to alpha, red, green, and blue color components for an image. This class is abstract.
See Also:   IndexColorModel
See Also:   DirectColorModel
version:
   1.22 02/20/02
author:
   Jim Graham


Field Summary
 ColorSpacecolorSpace
    
 booleanisAlphaPremultiplied
    
 intnBits
    
 intnumColorComponents
    
 intnumComponents
    
protected  intpixel_bits
    
 booleansupportsAlpha
    
 inttransparency
    

Constructor Summary
public  ColorModel(int bits)
     Constructs a ColorModel which describes a pixel of the specified number of bits.
protected  ColorModel(int pixel_bits, int[] bits, ColorSpace cspace, boolean hasAlpha, boolean isAlphaPremultiplied, int transparency, int transferType)
     Constructs a ColorModel that translates pixel values to color/alpha components.

Method Summary
public  booleanequals(Object obj)
     Tests if the specified Object is an instance of ColorModel and if it equals this ColorModel.
public  voidfinalize()
     Disposes of system resources associated with this ColorModel once this ColorModel is no longer referenced.
abstract public  intgetAlpha(int pixel)
     The subclass must provide a function which provides the alpha color compoment for the specified pixel.
abstract public  intgetBlue(int pixel)
     The subclass must provide a function which provides the blue color compoment for the specified pixel.
final public  ColorSpacegetColorSpace()
     Returns the ColorSpace associated with this ColorModel.
public  intgetComponentSize(int componentIdx)
     Returns the number of bits for the specified color/alpha component. Color components are indexed in the order specified by the ColorSpace.
public  int[]getComponentSize()
     Returns an array of the number of bits per color/alpha component.
final static  intgetDefaultTransferType(int pixel_bits)
    
abstract public  intgetGreen(int pixel)
     The subclass must provide a function which provides the green color compoment for the specified pixel.
public  intgetNumColorComponents()
     Returns the number of color components in this ColorModel.
public  intgetNumComponents()
     Returns the number of components, including alpha, in this ColorModel.
public  intgetPixelSize()
     Returns the number of bits per pixel described by this ColorModel.
public  intgetRGB(int pixel)
     Returns the color of the pixel in the default RGB color model.
public static  ColorModelgetRGBdefault()
     Return a ColorModel which describes the default format for integer RGB values used throughout the AWT image interfaces.
abstract public  intgetRed(int pixel)
     The subclass must provide a function which provides the red color compoment for the specified pixel.
final public  intgetTransferType()
     Returns the transfer type of this ColorModel.
public  intgetTransparency()
     Returns the transparency.
final public  booleanhasAlpha()
     Returns whether or not alpha is supported in this ColorModel.
public  inthashCode()
     Returns the hash code for this ColorModel.
final public  booleanisAlphaPremultiplied()
     Returns whether or not the alpha has been premultiplied in the pixel values to be translated by this ColorModel.
public  StringtoString()
     Returns the String representation of the contents of this ColorModelobject.

Field Detail
colorSpace
ColorSpace colorSpace(Code)



isAlphaPremultiplied
boolean isAlphaPremultiplied(Code)



nBits
int nBits(Code)



numColorComponents
int numColorComponents(Code)



numComponents
int numComponents(Code)



pixel_bits
protected int pixel_bits(Code)



supportsAlpha
boolean supportsAlpha(Code)



transparency
int transparency(Code)




Constructor Detail
ColorModel
public ColorModel(int bits)(Code)
Constructs a ColorModel which describes a pixel of the specified number of bits.



ColorModel
protected ColorModel(int pixel_bits, int[] bits, ColorSpace cspace, boolean hasAlpha, boolean isAlphaPremultiplied, int transparency, int transferType)(Code)
Constructs a ColorModel that translates pixel values to color/alpha components. Color components will be in the specified ColorSpace. pixel_bits is the number of bits in the pixel values. The bits array specifies the number of significant bits per color and alpha component. Its length should be the number of components in the ColorSpace if there is no alpha information in the pixel values, or one more than this number if there is alpha information. hasAlpha indicates whether or not alpha information is present. The boolean isAlphaPremultiplied specifies how to interpret pixel values in which color and alpha information are represented as separate spatial bands. If the boolean is true, color samples are assumed to have been multiplied by the alpha sample. The transparency specifies what alpha values can be represented by this color model. The transfer type is the type of primitive array used to represent pixel values. Note that the bits array contains the number of significant bits per color/alpha component after the translation from pixel values. For example, for an IndexColorModel with pixel_bits equal to 16, the bits array might have four elements with each element set to 8.
Parameters:
  pixel_bits - the number of bits in the pixel values
Parameters:
  bits - array that specifies the number of significant bitsper color and alpha component
Parameters:
  cspace - the specified ColorSpace
Parameters:
  hasAlpha - true if alpha information is present;false otherwise
Parameters:
  isAlphaPremultiplied - true if color samples areassumed to be premultiplied by the alpha samples;false otherwise
Parameters:
  transparency - what alpha values can be represented by thiscolor model
Parameters:
  transferType - the type of the array used to represent pixelvalues
throws:
  IllegalArgumentException - if the length ofthe bit array is less than the number of color or alphacomponents in this ColorModel, or if thetransparency is not a valid value.
throws:
  IllegalArgumentException - if the sum of the numberof bits in bits is less than 1 or ifany of the elements in bits is less than 0.
See Also:   java.awt.Transparency




Method Detail
equals
public boolean equals(Object obj)(Code)
Tests if the specified Object is an instance of ColorModel and if it equals this ColorModel.
Parameters:
  obj - the Object to test for equality true if the specified Objectis an instance of ColorModel and equals thisColorModel; false otherwise.



finalize
public void finalize()(Code)
Disposes of system resources associated with this ColorModel once this ColorModel is no longer referenced.



getAlpha
abstract public int getAlpha(int pixel)(Code)
The subclass must provide a function which provides the alpha color compoment for the specified pixel. The alpha transparency value ranging from 0 to 255



getBlue
abstract public int getBlue(int pixel)(Code)
The subclass must provide a function which provides the blue color compoment for the specified pixel. The blue color component ranging from 0 to 255



getColorSpace
final public ColorSpace getColorSpace()(Code)
Returns the ColorSpace associated with this ColorModel. the ColorSpace of thisColorModel.



getComponentSize
public int getComponentSize(int componentIdx)(Code)
Returns the number of bits for the specified color/alpha component. Color components are indexed in the order specified by the ColorSpace. Typically, this order reflects the name of the color space type. For example, for TYPE_RGB, index 0 corresponds to red, index 1 to green, and index 2 to blue. If this ColorModel supports alpha, the alpha component corresponds to the index following the last color component.
Parameters:
  componentIdx - the index of the color/alpha component the number of bits for the color/alpha component at thespecified index.
throws:
  ArrayIndexOutOfBoundsException - if componentIdx is greater than the number of components orless than zero
throws:
  NullPointerException - if the number of bits array is null



getComponentSize
public int[] getComponentSize()(Code)
Returns an array of the number of bits per color/alpha component. The array contains the color components in the order specified by the ColorSpace, followed by the alpha component, if present. an array of the number of bits per color/alpha component



getDefaultTransferType
final static int getDefaultTransferType(int pixel_bits)(Code)



getGreen
abstract public int getGreen(int pixel)(Code)
The subclass must provide a function which provides the green color compoment for the specified pixel. The green color component ranging from 0 to 255



getNumColorComponents
public int getNumColorComponents()(Code)
Returns the number of color components in this ColorModel. This is the number of components returned by ColorSpace.getNumComponents . the number of color components in thisColorModel.
See Also:   ColorSpace.getNumComponents



getNumComponents
public int getNumComponents()(Code)
Returns the number of components, including alpha, in this ColorModel. This is equal to the number of color components, optionally plus one, if there is an alpha component. the number of components in this ColorModel



getPixelSize
public int getPixelSize()(Code)
Returns the number of bits per pixel described by this ColorModel.



getRGB
public int getRGB(int pixel)(Code)
Returns the color of the pixel in the default RGB color model.
See Also:   ColorModel.getRGBdefault



getRGBdefault
public static ColorModel getRGBdefault()(Code)
Return a ColorModel which describes the default format for integer RGB values used throughout the AWT image interfaces. The format for the RGB values is an integer with 8 bits each of alpha, red, green, and blue color components ordered correspondingly from the most significant byte to the least significant byte, as in: 0xAARRGGBB



getRed
abstract public int getRed(int pixel)(Code)
The subclass must provide a function which provides the red color compoment for the specified pixel. The red color component ranging from 0 to 255



getTransferType
final public int getTransferType()(Code)
Returns the transfer type of this ColorModel. The transfer type is the type of primitive array used to represent pixel values as arrays. the transfer type.



getTransparency
public int getTransparency()(Code)
Returns the transparency. Returns either OPAQUE, BITMASK, or TRANSLUCENT. the transparency of this ColorModel.
See Also:   Transparency.OPAQUE
See Also:   Transparency.BITMASK
See Also:   Transparency.TRANSLUCENT



hasAlpha
final public boolean hasAlpha()(Code)
Returns whether or not alpha is supported in this ColorModel. true if alpha is supported in thisColorModel; false otherwise.



hashCode
public int hashCode()(Code)
Returns the hash code for this ColorModel. a hash code for this ColorModel.



isAlphaPremultiplied
final public boolean isAlphaPremultiplied()(Code)
Returns whether or not the alpha has been premultiplied in the pixel values to be translated by this ColorModel. If the boolean is true, this ColorModel is to be used to interpret pixel values in which color and alpha information are represented as separate spatial bands, and color samples are assumed to have been multiplied by the alpha sample. true if the alpha values are premultipliedin the pixel values to be translated by thisColorModel; false otherwise.



toString
public String toString()(Code)
Returns the String representation of the contents of this ColorModelobject. a String representing the contents of thisColorModel object.



Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.