PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Stefan Saftescu   Stereo Anaglyph Images   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: The example file.
Class: Stereo Anaglyph Images
Generate a stereo image from two source images
Author: By
Last change: -
Date: 17 years ago
Size: 715 bytes
 

Contents

Class file image Download
<?
require_once("stereo.class.php");
$instance = new StereoImage();
$instance->setImages("left.jpg", "right.jpg");
//the left image is the image that is seen by the eye with the red lens (usualy the left eye)
//the right image is the image that is seen by the eye with the blue lens (usualy the right eye)
$instance->loadImages();
//it takes about 13 seconds for a 1 MP JPEG image to be processed and about 33 seconds for a 2.5 MP PNG image to be processed
$stereoIMG = & $instance->createStereoImage();
if(
$stereoIMG)
{
   
//header("Content-type: image/png");
   
imagepng($stereoIMG, "stereo.png");
    @
imagedestroy($stereoIMG);
} else {
    foreach(
$instance->errors as $error) echo $error . "<br>";
}
?>