Java Media: Find Components : Media « 2D Graphics GUI « Java

Java
1. 2D Graphics GUI
2. 3D
3. Advanced Graphics
4. Ant
5. Apache Common
6. Chart
7. Class
8. Collections Data Structure
9. Data Type
10. Database SQL JDBC
11. Design Pattern
12. Development Class
13. EJB3
14. Email
15. Event
16. File Input Output
17. Game
18. Generics
19. GWT
20. Hibernate
21. I18N
22. J2EE
23. J2ME
24. JDK 6
25. JNDI LDAP
26. JPA
27. JSP
28. JSTL
29. Language Basics
30. Network Protocol
31. PDF RTF
32. Reflection
33. Regular Expressions
34. Scripting
35. Security
36. Servlets
37. Spring
38. Swing Components
39. Swing JFC
40. SWT JFace Eclipse
41. Threads
42. Tiny Application
43. Velocity
44. Web Services SOA
45. XML
Java Tutorial
Java Source Code / Java Documentation
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 » 2D Graphics GUI » MediaScreenshots 
Java Media: Find Components
Java Media: Find Components

/*

Java Media APIs: Cross-Platform Imaging, Media and Visualization
Alejandro Terrazas
Sams, Published November 2002, 
ISBN 0672320940
*/

import java.awt.image.DirectColorModel;

public class FindComponents {
  DirectColorModel dcm32;

  DirectColorModel dcm16;

  int[] components;

  float[] componentsf;

  int value32;

  short value16;

  int red8, green8, blue8, alpha8;

  short red5, green5, blue5;

  /**
   * FindComponents.java -- prints out normalized color components for two
   * different
   */
  public FindComponents() {
    red8 = red5 = 30;
    green8 = green5 = 20;
    blue8 = blue5 = 10;
    alpha8 = 255;

    dcm32 = new DirectColorModel(320x00ff00000x0000ff000x000000ff,
        0xff000000);
    value32 = (alpha8 << 24(red8 << 16(green8 << 8+ blue8;
    components = dcm32.getComponents(value32, null, 0);
    componentsf = dcm32.getNormalizedComponents(components, 0, null, 0);
    System.out.println("Normalized components are: ");
    for (int i = 0; i < componentsf.length; i++)
      System.out.println("\t" + componentsf[i]);

    dcm16 = new DirectColorModel(160x7c000x3e00x1f);
    value16 = (short) ((red5 << 10(green5 << 5+ blue5);
    components = dcm16.getComponents(value16, null, 0);
    componentsf = dcm16.getNormalizedComponents(components, 0, null, 0);
    System.out.println("Normalized components are: ");
    for (int i = 0; i < componentsf.length; i++)
      System.out.println("\t" + componentsf[i]);
  }

  public static void main(String[] args) {
    new FindComponents();
  }
}

           
       
Related examples in the same category
1. Query the manager class about the configuration and support of JMFQuery the manager class about the configuration and support of JMF
2. Show the Location2Location class in actionShow the Location2Location class in action
3. Capture audio or video through devices connected to the PC
4. Choose the media they wish to playChoose the media they wish to play
5. Do Audio Capture
6. Statistics about the tracks that compose a media object
7. Play the media object
8. A Bare Bones Player: play the media object
9. Play the media object 3
10. List all capture devices currently known to the JMFList all capture devices currently known to the JMF
11. Transfer media from one location to another carrying out the specified
ww_w___.j__a__v_a__2_s___.c_o___m___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.