[Index for tmp_for_tar/imgio] [Return to Master Index]

readgif

(tmp_for_tar/imgio/readgif.m)


Function Synopsis

[im, isPpm,maxval] = readgif(fname)

Help text

       [im, isPpm,maxval] = readgif(fname)

 readjpg	Read a JPEG image file into Octave.

           im = readjpg(fname)
           fname - JPEG filename.
           im    - image values as Octave variable.
           isPpm - (opt.) - 1 - `im' is in PPM format.
                            0 - `im' is a graylevel matrix.

 Assumes that a program 'giftopnm' is present.

 Modified from readjpg.m, by Ariel Tankus <arielt@math.tau.ac.il>



Listing of function file tmp_for_tar/imgio/readgif.m

##       [im, isPpm,maxval] = readgif(fname)
##
## This program is free software.
## This file is part of the Image Processing Toolbox for Octave
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License
## as published by the Free Software Foundation; either version 2
## of the License, or (at your option) any later version.
## 
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
## 
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
##

## readjpg	Read a JPEG image file into Octave.
##
##           im = readjpg(fname)
##           fname - JPEG filename.
##           im    - image values as Octave variable.
##           isPpm - (opt.) - 1 - `im' is in PPM format.
##                            0 - `im' is a graylevel matrix.
##
## Assumes that a program 'giftopnm' is present.
##
## Author: Etienne Grossmann <etienne@isr.ist.utl.pt>
##
## Modified from readjpg.m, by Ariel Tankus <arielt@math.tau.ac.il>
##

function [im, isPpm,maxval] = readgif(fname)

  command = ['giftopnm 2>/dev/null ' fname ];

  fid = popen(command, 'r');
  
  if fid > 0,
    ## if (nargout > 1)
    [im, isPpm,maxval] = readpnm(fid);
    ## else
    ## im = readpnm(fid);
    ## end
    ## pclose (fid);
  else
    warning ("readgif : Could not execute '%s'\n",pname);
    im = [];
    isppm = maxval = 0 ;
  end
endfunction

Produced by oct2html on Sat Sep 14 9:47:03 2002
Cross-Directory links are: ON