~jstys-z/helioviewer.org/client5

« back to all changes in this revision

Viewing changes to api/lib/Movie/HelioviewerMovieFrame.php

  • Committer: V. Keith Hughitt
  • Date: 2009-03-26 19:20:57 UTC
  • Revision ID: hughitt1@kore-20090326192057-u0x8rf8sf5lmmnwh
nightly build 03-26-2009: Using alpha-channel JPEG 2000 dataset

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
3
 
/**
4
 
 * Movie_HelioviewerMovie Class Definition
5
 
 *
6
 
 * PHP version 5
7
 
 *
8
 
 * @category Movie
9
 
 * @package  Helioviewer
10
 
 * @author   Jaclyn Beck <jabeck@nmu.edu>
11
 
 * @license  http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License 1.1
12
 
 * @link     http://launchpad.net/helioviewer.org
13
 
 */
14
 
require 'lib/Image/CompositeImage.php';
15
 
/**
16
 
 * Class is used when generating composite images, or 'frames', for movies.
17
 
 *
18
 
 * @category Movie
19
 
 * @package  Helioviewer
20
 
 * @author   Jaclyn Beck <jabeck@nmu.edu>
21
 
 * @license  http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License 1.1
22
 
 * @link     http://launchpad.net/helioviewer.org
23
 
 */
24
 
class Movie_HelioviewerMovieFrame extends Image_CompositeImage
25
 
{
26
 
    protected $frameNum;
27
 
    protected $layerImages;
28
 
    protected $cacheFileDir;
29
 
    protected $imageSize;
30
 
    
31
 
    /**
32
 
     * Movie_HelioviewerMovieFrame Constructor
33
 
     * 
34
 
     * @param int   $zoomLevel   Zoom-level for which the movie frame should be created\
35
 
     * @param array $options     An array with true/false values for "EdgeEnhance" and "Sharpen"
36
 
     * @param array $layerImages An array of layer information strings in the format:
37
 
     *                           "uri,xStart,xSize,yStart,ySize,opacity,opacityGrp"
38
 
     * @param int   $frameNum    Which frame this movieFrame belongs to
39
 
     * @param int   $folderId    Unix timestamp of when the movie was requested, and is used to make a 
40
 
     *                           folder to store the movie in.
41
 
     * @param array $imageSize   Array of width and height of the image
42
 
     * @param array $timestamps  Array containing the actual timestamps of each layer, obtained from the database
43
 
     * @param int   $quality     Movie quality
44
 
     */
45
 
    public function __construct(
46
 
        $zoomLevel, $options, $layerImages, $frameNum, $folderId, $imageSize, $timestamps, $quality
47
 
    ) {
48
 
        $this->frameNum    = $frameNum;
49
 
        $this->layerImages = $layerImages;
50
 
        $this->imageSize   = $imageSize;
51
 
        $this->timestamps  = $timestamps;
52
 
        $this->quality     = $quality;
53
 
        
54
 
        $tmpDir = HV_CACHE_DIR . "movies/";
55
 
 
56
 
        parent::__construct($zoomLevel, $options, $tmpDir);
57
 
 
58
 
        // Directory to store all of the final frame images before they are compiled into a video    
59
 
        $this->cacheFileDir = $tmpDir . $folderId . "/";
60
 
        
61
 
        if (!file_exists($this->cacheFileDir)) {
62
 
            mkdir($this->cacheFileDir);
63
 
            chmod($this->cacheFileDir, 0777);
64
 
        }
65
 
        
66
 
        $this->compileImages();
67
 
    }
68
 
}
69
 
?>
 
 
b'\\ No newline at end of file'