Oracle interMedia Audio, Image, and Video User's Guide and Reference
Release 8.1.7

Part Number A85336-01

Library

Product

Contents

Index

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/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.

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

Once you have installed Oracle interMedia image, you may choose to run the Oracle interMedia image 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 demo.

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

F.2.1 Demonstration (Demo) Installation Steps

For interMedia image, see the README.txt file at <ORACLE_HOME>/ord/aud/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.2.2 Running the Demo

The file imgdemo is a sample program that shows how Oracle interMedia image 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.

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, 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 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.

Example F-1 Execute the Demo from the Command Line

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 following command:

   $ 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 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.

F.3 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.

F.4 Java Demo

A Java demo has been provided to help you learn to use both the audio and video client-side Java classes so you can build your own applications. In these two demos, the audio and video 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 directory and the video Java demo files are located in the $ORACLE_HOME/ord/vid/demo 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-2000, Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index