Oracle interMedia User's Guide and Reference
Release 9.0.1

Part Number A88786-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to next page

F
Sample Programs

Oracle interMedia includes a number of scripts and sample programs that you can use.

Sample Oracle interMedia scripts and programs are available in the following directories after you install this product:

$ORACLE_HOME/ord/aud/demo/
$ORACLE_HOME/ord/doc/demo/
$ORACLE_HOME/ord/img/demo/
$ORACLE_HOME/ord/vid/demo/

F.1 Sample Audio Scripts

The audio scripts consist of the following files:

See the README.txt file in the$ORACLE_HOME/ord/aud/demo directory for requirements and instructions on running this SQL demo.

See Section F.5 for a description of the Java demo that is provided to help you learn to use the audio client-side Java classes so you can build your own applications.

F.2 Sample Document Scripts

The document scripts consist of the following files:

See the README.txt files in the$ORACLE_HOME/ordim/demo/doccheck and ORACLE_HOME/ordim/demo/doccjpub directories for requirements and instructions on running this SQL demo.

See Section F.5 for a description of the Java demo that is provided to help you learn to use the document client-side Java classes so you can build your own applications.

F.3 Sample Program for Modifying Images or Testing the Image Installation

Once you have installed Oracle interMedia, you may choose to run the Oracle interMedia image services demonstration program. This program can also be used as a test to confirm successful installation.

This section contains the steps required to build and run the interMedia image services demo.

The interMedia image services demo files are located in <ORACLE_HOME>/ord/img/demo, where <ORACLE_HOME> is the ORACLE_HOME directory.

F.3.1 Demonstration (Demo) Installation Steps

For interMedia image services, see the README.txt file at <ORACLE_HOME>/ord/img/demo/README.txt (on UNIX), and <ORACLE_HOME>\ord\img\demo\README.txt (on Windows NT), where <ORACLE_HOME> is the ORACLE_HOME directory.

F.3.2 Running the Demo

The file imgdemo is a sample program that shows how Oracle interMedia image services can be used from within a program. The demo is written in C and uses OCI, Oracle Call Interface, to access the database and exercise Oracle interMedia image services.

The program operates on imgdemo.dat, which is a bitmap (BMP) image in the demo directory. Optionally, you can supply an image file name on the command line, provided the file resides in the same directory as the demo. In either case, once the image has been manipulated by Oracle interMedia image services, the resulting image is written to the file imgdemo.out and can then be viewed with common rendering tools that you supply.

When the demo is run, it deletes and re-creates a table named IMGDEMOTAB in the SCOTT/TIGER schema of the default database. This table is used to hold the demo data. Once the table is created, a reference to the image file is inserted into the table. The data is then loaded into the table and converted to JFIF using the
processCopy( ) method of ORDImage.

The image properties are extracted within the database using the setProperties( ) method. An UPDATE command is issued after the setProperties( ) invocation. This is required because the setProperties( ) invocation has only updated a local copy of the type attributes.

Next, the Oracle interMedia image services process( ) method is used to cut and scale the image within the database. This is followed by an update that commits the change. The program cuts a portion of the image 100 pixels wide by 100 pixels high starting from pixel location (100,100). This subimage is scaled to twice its original size and the resulting image is written out to the file system in a file named imgdemo.out.

Upon completion, the demo program leaves the imgdemo.out file in the current directory. It also leaves the table IMGDEMOTAB in the SCOTT/TIGER schema of the database.

Execute the demo by typing imgdemo on the command line. Optionally, a different image can be used in the demo by first copying the file to the directory in which the demo resides and then specifying its file name on the command line as an argument to imgdemo.

Use the command shown in Example F-1.

Example F-1 Execute the Demo from the Command Line

   $ imgdemo <optional-image-filename>

The demo displays a number of messages describing its progress, along with any errors encountered in the event that something was not set up correctly. Expect to see the following messages:

Dropping table IMGDEMOTAB... 
Creating and populating table IMGDEMOTAB... 
Loading data into cartridge... 
Modifying image characteristics... 
Writing image to file imgdemo.out... 
Disconnecting from database... 
Logged off and detached from server. 
Demo completed successfully. 

If the program encounters any errors, it is likely that either Oracle interMedia image services software has not been installed correctly or the database has not been started. If the program completes successfully, the original image and the resultant image, which has undergone the cutting and scaling described earlier, can be viewed with common image rendering tools.

See Section F.5 for a description of the Java demo that is provided to help you learn to use the image client-side Java classes so you can build your own applications.

F.4 Sample Video Scripts

The video scripts consist of the following files:

See the README.txt file in the $ORACLE_HOME/ord/vid/demo directory for requirements and instructions on how to run this SQL demo.

See Section F.5 for a description of the Java demo that is provided to help you learn to use the video client-side Java classes so you can build your own applications.

F.5 Java Demo

A Java demo has been provided to help you learn to use both the audio, video, image, and document client-side Java classes so you can build your own applications. In these four demos, the audio, video, image, and document object is instantiated at the client side and a number of accessor methods are invoked. The audio Java demo files are located in the ORACLE_HOME/ord/aud/demo/java directory, the video Java demo files are located in the $ORACLE_HOME/ord/vid/demo/java directory, the image Java demo files are located in the ORACLE_HOME/ord/img/demo/java directory, and the document Java demo files are located in the $ORACLE_HOME/ord/doc/demo/java directory. See the README.txt file in each directory for requirements and instructions on how to run each respective Java demo.


Go to previous page Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback