Java Doc for ImageToRawConverter.java in  » 6.0-JDK-Modules » j2me » com » sun » midp » imageutil » 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 » com.sun.midp.imageutil 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.midp.imageutil.ImageToRawConverter

ImageToRawConverter
public class ImageToRawConverter (Code)
This class generates raw data from image according to specified raw format and pixel format. Supported formats are listed in static formatList array. To add new supported format one should define new raw or/and color format constants if needed, update static formatList array, implement new conversion function byte[] _function_name_(BufferedImage image) and update imageToByteArray function to support new format.


Field Summary
final public static  intCOLOR_FORMAT_565
    
final public static  intCOLOR_FORMAT_888
    
final public static  intFORMAT_INVALID
    
final public static  intINT_FORMAT_BIG_ENDIAN
    
final public static  intINT_FORMAT_LITTLE_ENDIAN
    
final public static  intRAW_FORMAT_ARGB
    
final public static  intRAW_FORMAT_PP
    
final static  intformatList
    
protected  intrawFormatcolorFormatintFormat
    
final static  short[]rawMagic
    

Constructor Summary
public  ImageToRawConverter(int rawFormat, int colorFormat, int endian)
     Constructs instance of ImageToRawConverter which will convert images to raw data in specified here format.

Method Summary
public  byte[]convertToRaw(int[] imageData, int width, int height, boolean hasAlpha)
     Converts image to raw data in byte array.
 voidfillRawHeader(byte[] rawData, int width, int height, boolean hasAlpha)
    
public static  booleanisFormatSupported(int rawFormat, int colorFormat)
     Defines if format is currently supported.

Field Detail
COLOR_FORMAT_565
final public static int COLOR_FORMAT_565(Code)
pixel format - 16bit color



COLOR_FORMAT_888
final public static int COLOR_FORMAT_888(Code)
pixel format - 24bit color



FORMAT_INVALID
final public static int FORMAT_INVALID(Code)
value for invalid format indication



INT_FORMAT_BIG_ENDIAN
final public static int INT_FORMAT_BIG_ENDIAN(Code)
int byte order - big-endian



INT_FORMAT_LITTLE_ENDIAN
final public static int INT_FORMAT_LITTLE_ENDIAN(Code)
int byte order - little-endian



RAW_FORMAT_ARGB
final public static int RAW_FORMAT_ARGB(Code)
RGBA raw format



RAW_FORMAT_PP
final public static int RAW_FORMAT_PP(Code)
Put Pixel raw format



formatList
final static int formatList(Code)
list of supported pairs raw format - color format



rawFormatcolorFormatintFormat
protected int rawFormatcolorFormatintFormat(Code)
current raw, color and int formats



rawMagic
final static short[] rawMagic(Code)
byte sequence that indentifies raw format




Constructor Detail
ImageToRawConverter
public ImageToRawConverter(int rawFormat, int colorFormat, int endian) throws IllegalArgumentException(Code)
Constructs instance of ImageToRawConverter which will convert images to raw data in specified here format. Raw format and color format should be in list of supported formarts, otherwise IllegalArgumentException will be thrown.
Parameters:
  rawFormat - required raw format
Parameters:
  colorFormat - required color format
Parameters:
  endian - required int format
exception:
  IllegalArgumentException - if unsupported format




Method Detail
convertToRaw
public byte[] convertToRaw(int[] imageData, int width, int height, boolean hasAlpha)(Code)
Converts image to raw data in byte array.
Parameters:
  imageData - image pixels in 32bit ARGB format
Parameters:
  width - image width
Parameters:
  height - image height
Parameters:
  hasAlpha - true if image has alpha channel byte[] raw data



fillRawHeader
void fillRawHeader(byte[] rawData, int width, int height, boolean hasAlpha)(Code)
Fills byte array with raw header byte RAW_HEADER[4] = {0x89, 'S', 'U', 'N'}; int32 width; int32 height; int32 hasAlpha;
Parameters:
  rawData - byte array to fill header for, length of thatarray must be greater than 16, otherwise function fails (returns false)
Parameters:
  width - width of the image
Parameters:
  height - height of the image
Parameters:
  hasAlpha - if image has alpha channel



isFormatSupported
public static boolean isFormatSupported(int rawFormat, int colorFormat)(Code)
Defines if format is currently supported.
Parameters:
  rawFormat - raw format
Parameters:
  colorFormat - color format true if format is supported false otherwise



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.