Items related to Quick Time for Java: A Developer's Notebook

Quick Time for Java: A Developer's Notebook - Softcover

 
9780596008222: Quick Time for Java: A Developer's Notebook

Synopsis

QuickTime Java (QJT) is a terrific multimedia toolkit, but it's also terrifying to the uninitiated. Java developers who need to add audio, video, or interactive media creation and playback to their applications find that QTJ is powerful, but not easy to get into. In fact, when it comes to class-count, QuickTime Java is nearly as large as all of Java 1.1.Once you learn the entire scope of Apple's QuickTime software, you really appreciate the problem. At its simplest, QuickTime allows Mac and Windows users to play audio and video on their computers. But QuickTime is many things: a file format, an environment for media authoring, and a suite of applications that includes browser plug-ins for viewing media within a web page, a PictureViewer for working with still pictures, QuickTime Streaming Server for delivering streaming media files on the Internet in real time, and QuickTime Broadcaster for delivering live events on the Internet. Among others.As if that weren't daunting enough, the javadocs on QJT are wildly incomplete, and other books on the topic are long out of date and not well regarded, making progress with QTJ extremely difficult. So what can you do? Our new hands-on guide, QuickTime Java: A Developer's Notebook, not only catches up with this technology, but de-mystifies it.This practical "all lab, no lecture" book is an informal, code-intensive workbook that offers the first real look at this important software. Like other titles in our Developer's Notebook series, QuickTime Java: A Developer's Notebook is for impatient early adopters who want get up to speed on what they can use right now. It's deliberately light on theory, emphasizing example over explanation and practice over concept, so you can focus on learning by doing.QuickTime Java: A Developer's Notebook gives you just the functionality you need from QTJ. Even if you come to realize that 95% of the API is irrelevant to you, this book will help you master the 5% that really counts.

"synopsis" may belong to another edition of this title.

About the Author

Chris Adamson is an Associate Online Editor for O'Reilly's Java websites, ONJava and java.net. He is also a software consultant, in the form of Subsequently and Furthermore, Inc., specializing in Java, Mac OS X, and media development. He wrote his first Java applet in 1996 on a 16 MHz black-and-white PowerBook 160 with the little-seen Sun MacJDK 1.0. In a previous career, he was a Writer / Associate Producer at CNN Headline News. He has an MA in Telecommunication from Michigan State University, and a BA in English and BS in Symbolic Systems from Stanford University.

Excerpt. © Reprinted by permission. All rights reserved.

CHAPTER 5 Working with QuickDraw

And now, on to the oldest, cruftiest, yet can’t-live-without-it-iest part of QTJ: QuickDraw. QuickDraw is a graphics API that can be traced all the way back to that first Mac Steve Jobs pulled out of a bag and showed the press more than 20 years ago. You know—back when Mac supported all of two colors: black and white.

Don’t worry; it’s gotten a lot better since then.

To be fair, a native Mac OS X application being written today from scratch probably would use the shiny new "Quartz 2D" API. And as a Java developer, the included Java 2D API is at least as capable as QuickDraw, with extension packages like Java Advanced Imaging (JAI) only making things better.

The real advantage to understanding QuickDraw is that it’s what’s used to work with captured images (see Chapter 6) and individual video samples (see Chapter 8). It is also a reasonably capable graphics API in its own right, supporting import from and export to many formats (most of which J2SE lacked until 1.4), affine transformations, compositing, and more.

Getting and Saving Picts
If you had a Mac before Mac OS X, you probably are very familiar with picts, because they were the native graphics file format on the old Mac OS. Taking screenshots would create pict files, as would saving your work in graphics applications. Developers used pict resources in their applications to provide graphics, splash screens, etc.

Actually, a number of tightly coupled concepts relate to picts. The native structure for working with a series of drawing commands is called a Picture actually. This struct, along with the functions that use it, are wrapped bythe QTJ class quicktime.qd.Pict. There’s also a file format for storing picts, which can contain either drawing commands or bit-mapped images—files in this format usually have a .pct or .pict extension. QTJ’s Pict class has methods to read and write these files, and because it’s easy to create Picts from Movies, Tracks, GraphicsImporters, SequenceGrabbers (capture devices), etc., it’s a very useful class.

How do I do that?
The PictTour.java application, shown in Example 5-1, exercises the basics of getting, saving, and loading Picts.

Example 5-1. Opening and saving Picts

package com.oreilly.qtjnotebook.ch05;

import quicktime.*;
import quicktime.app.view.*;
import quicktime.std.*;
import quicktime.std.image.*;
import quicktime.io.*;
import quicktime.qd.*;
import java.awt.*;
import java.io.*;
import com.oreilly.qtjnotebook.ch01.QTSessionCheck;

public class PictTour extends Object {

static final int[ ] imagetypes =$N202-1677793-2715858;

static int frameX = -1;
static int frameY = -1;

public static void main (String[ ] args) {
try {
QTSessionCheck.check( );

// import a graphic
QTSessionCheck.check( );
QTFile inFile = QTFile.standardGetFilePreview (imagetypes);
GraphicsImporter importer =
new GraphicsImporter (inFile);
showFrameForImporter (importer,
"Original Import");
// get a pict object and then save it
// then load again and show
Pict pict = importer.getAsPicture( );
String absPictPath = (new File ("pict.pict")).getAbsolutePath( );
File pictFile = new File (absPictPath);if (pictFile.exists( ))
pictFile.delete( );
try { Thread.sleep (1000); } catch (InterruptedException ie) { }
pict.writeToFile (pictFile);
QTFile pictQTFile = new QTFile (pictFile);
GraphicsImporter pictImporter =
new GraphicsImporter (pictQTFile);
showFrameForImporter (pictImporter,
"pict.pict");
// write to a pict file from importer
// then load and show it
String absGIPictPath = (new File ("gipict.pict")).getAbsolutePath( );
QTFile giPictQTFile = new QTFile (absGIPictPath);
if (giPictQTFile.exists( ))
giPictQTFile.delete( );
try { Thread.sleep (1000); } catch (InterruptedException ie) { }
importer.saveAsPicture (giPictQTFile,
IOConstants.smSystemScript);
GraphicsImporter giPictImporter =
new GraphicsImporter (giPictQTFile);
showFrameForImporter (giPictImporter,
"gipict.pict");
} catch (Exception e) {
e.printStackTrace( );
}
}

public static void showFrameForImporter (GraphicsImporter gi,
String frameTitle)
throws QTException {
QTComponent qtc = QTFactory.makeQTComponent (gi);
Component c = qtc.asComponent( );
Frame f = new Frame (frameTitle);
f.add (c);
f.pack( );
if (frameX = = -1) {
frameX = f.getLocation( ).x;
frameY = f.getLocation( ).y;
} else {
Point location = new Point (frameX += 20,
frameY += 20);
f.setLocation (location);
}

f.setVisible (true);
}
}

W A R N I N G
The two Thread.sleep( ) calls are here only as a workaround to aproblem I saw while developing this example—reading a file I’d just written proved crashy (maybe the file wasn’t fully closed?). Because it’s unlikely you’ll write a file and immediately reread it, this isn’t something you’ll want or need to do in your code.

"About this title" may belong to another edition of this title.

  • PublisherO'Reilly Vlg. GmbH & Co.
  • Publication date2005
  • ISBN 10 0596008228
  • ISBN 13 9780596008222
  • BindingPaperback
  • LanguageEnglish
  • Number of pages233

Buy Used

Condition: Good
Connecting readers with great books...
View this item

£ 2.82 shipping within U.S.A.

Destination, rates & speeds

Search results for Quick Time for Java: A Developer's Notebook

Stock Image

Adamson, Chris
Published by O'Reilly Media, 2005
ISBN 10: 0596008228 ISBN 13: 9780596008222
Used paperback

Seller: HPB-Red, Dallas, TX, U.S.A.

Seller rating 5 out of 5 stars 5-star rating, Learn more about seller ratings

paperback. Condition: Good. Connecting readers with great books since 1972! Used textbooks may not include companion materials such as access codes, etc. May have some wear or writing/highlighting. We ship orders daily and Customer Service is our top priority! Seller Inventory # S_411238555

Contact seller

Buy Used

£ 9.12
Convert currency
Shipping: £ 2.82
Within U.S.A.
Destination, rates & speeds

Quantity: 1 available

Add to basket

Stock Image

Chris Adamson
Published by O'Reilly Media, Incorporated, 2005
ISBN 10: 0596008228 ISBN 13: 9780596008222
New Softcover

Seller: Books Puddle, New York, NY, U.S.A.

Seller rating 4 out of 5 stars 4-star rating, Learn more about seller ratings

Condition: New. pp. xix + 233. Seller Inventory # 264172978

Contact seller

Buy New

£ 10.91
Convert currency
Shipping: £ 3
Within U.S.A.
Destination, rates & speeds

Quantity: 1 available

Add to basket

Stock Image

Adamson Chris
Published by O'Reilly Media, Incorporated, 2005
ISBN 10: 0596008228 ISBN 13: 9780596008222
New Softcover

Seller: Majestic Books, Hounslow, United Kingdom

Seller rating 5 out of 5 stars 5-star rating, Learn more about seller ratings

Condition: New. pp. xix + 233 Illus. Seller Inventory # 4723565

Contact seller

Buy New

£ 8.68
Convert currency
Shipping: £ 6.50
From United Kingdom to U.S.A.
Destination, rates & speeds

Quantity: 1 available

Add to basket

Stock Image

Adamson Chris
Published by O'Reilly Media, Incorporated, 2005
ISBN 10: 0596008228 ISBN 13: 9780596008222
New Softcover

Seller: Biblios, Frankfurt am main, HESSE, Germany

Seller rating 5 out of 5 stars 5-star rating, Learn more about seller ratings

Condition: New. pp. xix + 233. Seller Inventory # 184172984

Contact seller

Buy New

£ 9.95
Convert currency
Shipping: £ 8.46
From Germany to U.S.A.
Destination, rates & speeds

Quantity: 1 available

Add to basket

Stock Image

Adamson, Chris
Published by O'Reilly Media, 2005
ISBN 10: 0596008228 ISBN 13: 9780596008222
New Softcover

Seller: Romtrade Corp., STERLING HEIGHTS, MI, U.S.A.

Seller rating 5 out of 5 stars 5-star rating, Learn more about seller ratings

Condition: New. This is a Brand-new US Edition. This Item may be shipped from US or any other country as we have multiple locations worldwide. Seller Inventory # ABNR-183963

Contact seller

Buy New

£ 21.69
Convert currency
Shipping: FREE
Within U.S.A.
Destination, rates & speeds

Quantity: 1 available

Add to basket

Seller Image

Adamson, Chris:
ISBN 10: 0596008228 ISBN 13: 9780596008222
Used Softcover

Seller: NEPO UG, Rüsselsheim am Main, Germany

Seller rating 5 out of 5 stars 5-star rating, Learn more about seller ratings

Condition: Gut. Auflage: 1. 255 Seiten Exemplar aus einer wissenchaftlichen Bibliothek Sprache: Englisch Gewicht in Gramm: 356 23,2 x 17,4 x 2,0 cm, Taschenbuch. Seller Inventory # 379258

Contact seller

Buy Used

£ 12.21
Convert currency
Shipping: £ 20.41
From Germany to U.S.A.
Destination, rates & speeds

Quantity: 1 available

Add to basket