]> git.imager.perl.org - imager.git/commitdiff
Clean up after changing some formats to use iolayer.
authorArnar Mar Hrafnkelsson <addi@cpan.org>
Thu, 7 Jun 2001 11:58:14 +0000 (11:58 +0000)
committerArnar Mar Hrafnkelsson <addi@cpan.org>
Thu, 7 Jun 2001 11:58:14 +0000 (11:58 +0000)
Imager.pm
Imager.xs
image.h
raw.c

index dd24e30274e2a3dd0954fa6282f31ebc4c411cea..615ab211c0d4195de50f3e0ddca79bc7f5ca6c5d 100644 (file)
--- a/Imager.pm
+++ b/Imager.pm
@@ -653,13 +653,25 @@ sub write {
          $self->{ERRSTR}='Could not write to buffer';
          return undef;
        }
          $self->{ERRSTR}='Could not write to buffer';
          return undef;
        }
-      }
-      else {
+      } else {
        if (!i_writetiff_wiol($self->{IMG}, $IO)) {
          $self->{ERRSTR}='Could not write to buffer';
          return undef;
        }
       }
        if (!i_writetiff_wiol($self->{IMG}, $IO)) {
          $self->{ERRSTR}='Could not write to buffer';
          return undef;
        }
       }
+    } elsif ( $input{type} eq 'pnm' ) {
+
+      if ( ! i_writeppm_wiol($self->{IMG},$IO) ) {
+       $self->{ERRSTR}='unable to write pnm image';
+       return undef;
+      }
+      $self->{DEBUG} && print "writing a pnm file\n";
+    } elsif ( $input{type} eq 'raw' ) {
+      if ( !i_writeraw($self->{IMG},$IO) ) {
+       $self->{ERRSTR}='unable to write raw image';
+       return undef;
+      }
+      $self->{DEBUG} && print "writing a raw file\n";
     }
 
     if (exists $input{'data'}) {
     }
 
     if (exists $input{'data'}) {
@@ -727,31 +739,18 @@ sub write {
       $self->{DEBUG} && print "writing a gif file\n";
 
     } elsif ( $input{type} eq 'jpeg' ) {
       $self->{DEBUG} && print "writing a gif file\n";
 
     } elsif ( $input{type} eq 'jpeg' ) {
-      $rc=i_writejpeg($self->{IMG},$fd,$input{jpegquality});
+      $rc = i_writejpeg($self->{IMG},$fd,$input{jpegquality});
       if ( !defined($rc) ) {
        $self->{ERRSTR}='unable to write jpeg image'; return undef;
       }
       $self->{DEBUG} && print "writing a jpeg file\n";
       if ( !defined($rc) ) {
        $self->{ERRSTR}='unable to write jpeg image'; return undef;
       }
       $self->{DEBUG} && print "writing a jpeg file\n";
-    } elsif ( $input{type} eq 'png' ) { 
+    } elsif ( $input{type} eq 'png' ) {
       $rc=i_writepng($self->{IMG},$fd);
       if ( !defined($rc) ) {
        $self->{ERRSTR}='unable to write png image'; return undef;
       }
       $self->{DEBUG} && print "writing a png file\n";
       $rc=i_writepng($self->{IMG},$fd);
       if ( !defined($rc) ) {
        $self->{ERRSTR}='unable to write png image'; return undef;
       }
       $self->{DEBUG} && print "writing a png file\n";
-    } elsif ( $input{type} eq 'pnm' ) {
-      $rc=i_writeppm($self->{IMG},$fd);
-      if ( !defined($rc) ) {
-       $self->{ERRSTR}='unable to write pnm image'; return undef;
-      }
-      $self->{DEBUG} && print "writing a pnm file\n";
-    } elsif ( $input{type} eq 'raw' ) {
-      $rc=i_writeraw($self->{IMG},$fd);
-      if ( !defined($rc) ) {
-       $self->{ERRSTR}='unable to write raw image'; return undef;
-      }
-      $self->{DEBUG} && print "writing a raw file\n";
     }
     }
-
   }
   return $self;
 }
   }
   return $self;
 }
index f0cf8a7f1057f09d4c3860f81a3be8783a6deaae..8fa7b4a95df377252d78ace7a295caeb0e5b4e49 100644 (file)
--- a/Imager.xs
+++ b/Imager.xs
@@ -1482,11 +1482,6 @@ i_readpnm_wiol(ig, length)
               int     length
 
 
               int     length
 
 
-undef_int
-i_writeppm(im,fd)
-    Imager::ImgRaw     im
-              int     fd
-
 undef_int
 i_writeppm_wiol(im, ig)
     Imager::ImgRaw     im
 undef_int
 i_writeppm_wiol(im, ig)
     Imager::ImgRaw     im
diff --git a/image.h b/image.h
index e5fd555ca0971a0e344b017104ef0cd72bca8ff3..e48ed3527c19b43821f46058b9a6b834dd80f357 100644 (file)
--- a/image.h
+++ b/image.h
@@ -360,21 +360,21 @@ undef_int i_writejpeg(i_img *im,int fd,int qfactor);
 #endif /* HAVE_LIBJPEG */
 
 #ifdef HAVE_LIBTIFF
 #endif /* HAVE_LIBJPEG */
 
 #ifdef HAVE_LIBTIFF
-i_img* i_readtiff_wiol(io_glue *ig, int length);
+i_img   * i_readtiff_wiol(io_glue *ig, int length);
 undef_int i_writetiff_wiol(i_img *im, io_glue *ig);
 undef_int i_writetiff_wiol_faxable(i_img *im, io_glue *ig, int fine);
 
 #endif /* HAVE_LIBTIFF */
 
 #ifdef HAVE_LIBPNG
 undef_int i_writetiff_wiol(i_img *im, io_glue *ig);
 undef_int i_writetiff_wiol_faxable(i_img *im, io_glue *ig, int fine);
 
 #endif /* HAVE_LIBTIFF */
 
 #ifdef HAVE_LIBPNG
-i_img *i_readpng_wiol(io_glue *ig, int length);
-undef_int i_writepng(i_img *im,int fd);
+i_img    *i_readpng_wiol(io_glue *ig, int length);
+undef_int i_writepng_wiol(i_img *im, io_glue *ig);
 #endif /* HAVE_LIBPNG */
 
 #ifdef HAVE_LIBGIF
 #endif /* HAVE_LIBPNG */
 
 #ifdef HAVE_LIBGIF
-i_img *i_readgif(int fd, int **colour_table, int *colours);
-i_img *i_readgif_scalar(char *data, int length, int **colour_table, int *colours);
-i_img *i_readgif_callback(i_read_callback_t callback, char *userdata, int **colour_table, int *colours);
+i_img   * i_readgif(int fd, int **colour_table, int *colours);
+i_img   * i_readgif_scalar(char *data, int length, int **colour_table, int *colours);
+i_img   * i_readgif_callback(i_read_callback_t callback, char *userdata, int **colour_table, int *colours);
 undef_int i_writegif(i_img *im,int fd,int colors,int pixdev,int fixedlen,i_color fixed[]);
 undef_int i_writegifmc(i_img *im,int fd,int colors);
 undef_int i_writegifex(i_img *im,int fd);
 undef_int i_writegif(i_img *im,int fd,int colors,int pixdev,int fixedlen,i_color fixed[]);
 undef_int i_writegifmc(i_img *im,int fd,int colors);
 undef_int i_writegifex(i_img *im,int fd);
@@ -385,27 +385,26 @@ void i_qdist(i_img *im);
 
 #endif /* HAVE_LIBGIF */
 
 
 #endif /* HAVE_LIBGIF */
 
-i_img    *i_readraw_wiol(io_glue *ig, int x, int y, int datachannels, int storechannels, int intrl);
+i_img   i_readraw_wiol(io_glue *ig, int x, int y, int datachannels, int storechannels, int intrl);
 undef_int i_writeraw_wiol(i_img* im, io_glue *ig);
 
 undef_int i_writeraw_wiol(i_img* im, io_glue *ig);
 
-i_img *i_readpnm_wiol(io_glue *ig, int length);
-undef_int i_writeppm(i_img *im,int fd);
+i_img   * i_readpnm_wiol(io_glue *ig, int length);
 undef_int i_writeppm_wiol(i_img *im, io_glue *ig);
 
 
 undef_int i_writeppm_wiol(i_img *im, io_glue *ig);
 
 
-i_img* i_scaleaxis(i_img *im, float Value, int Axis);
-i_img* i_scale_nn(i_img *im, float scx, float scy);
-i_img* i_haar(i_img *im);
-int i_count_colors(i_img *im,int maxc);
+i_img * i_scaleaxis(i_img *im, float Value, int Axis);
+i_img * i_scale_nn(i_img *im, float scx, float scy);
+i_img * i_haar(i_img *im);
+int     i_count_colors(i_img *im,int maxc);
 
 
-i_img* i_transform(i_img *im, int *opx,int opxl,int *opy,int opyl,double parm[],int parmlen);
+i_img * i_transform(i_img *im, int *opx,int opxl,int *opy,int opyl,double parm[],int parmlen);
 
 struct rm_op;
 
 struct rm_op;
-i_img* i_transform2(int width, int height, int channels,
-                   struct rm_op *ops, int ops_count, 
-                   double *n_regs, int n_regs_count, 
-                   i_color *c_regs, int c_regs_count, 
-                   i_img **in_imgs, int in_imgs_count);
+i_img * i_transform2(int width, int height, int channels,
+                    struct rm_op *ops, int ops_count, 
+                    double *n_regs, int n_regs_count, 
+                    i_color *c_regs, int c_regs_count, 
+                    i_img **in_imgs, int in_imgs_count);
 /* filters */
 
 void i_contrast(i_img *im, float intensity);
 /* filters */
 
 void i_contrast(i_img *im, float intensity);
diff --git a/raw.c b/raw.c
index b7d8e3d8930ee620fab293d5b3d80506d3b636f6..e9dba979734ee88aced735a81a282c65685438dc 100644 (file)
--- a/raw.c
+++ b/raw.c
@@ -95,12 +95,3 @@ i_writeraw_wiol(i_img* im, io_glue *ig) {
   }
   return(1);
 }
   }
   return(1);
 }
-
-
-
-
-
-
-
-
-