Changeset 4163


Ignore:
Timestamp:
07/03/08 11:04:00 (12 years ago)
Author:
melissa
Message:

Added support for writing APNG files and reworked saveImage delegation - all writers must now implement saveImage(Image, int, boolean, boolean), instead of saveImage(Image, boolean).

Location:
trunk/loci/formats
Files:
1 added
1 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/FormatWriter.java

    r4048 r4163  
    102102  } 
    103103 
    104   /* @see IFormatWriter#saveImage(Image, int, boolean, boolean) */ 
    105   public void saveImage(Image image, int series, boolean lastInSeries, 
    106     boolean last) throws FormatException, IOException 
     104  /* @see IFormatWriter#saveImage(Image, boolean) */ 
     105  public void saveImage(Image image, boolean last) 
     106    throws FormatException, IOException 
    107107  { 
    108     throw new FormatException("Not implemented yet."); 
     108    saveImage(image, 0, last, last); 
    109109  } 
    110110 
  • trunk/loci/formats/out/AVIWriter.java

    r4048 r4163  
    9393  // -- IFormatWriter API methods -- 
    9494 
    95   /* @see loci.formats.IFormatWriter#saveImage(Image, boolean) */ 
    96   public void saveImage(Image image, boolean last) 
    97     throws FormatException, IOException 
     95  /* @see loci.formats.IFormatWriter#saveImage(Image, int, boolean, boolean) */ 
     96  public void saveImage(Image image, int series, boolean lastInSeries, 
     97    boolean last) throws FormatException, IOException 
    9898  { 
    9999    if (image == null) { 
  • trunk/loci/formats/out/EPSWriter.java

    r4048 r4163  
    5151  // -- IFormatWriter API methods -- 
    5252 
    53   /* @see loci.formats.IFormatWriter#saveImage(Image, boolean) */ 
    54   public void saveImage(Image image, boolean last) 
    55     throws FormatException, IOException 
     53  /* @see loci.formats.IFormatWriter#saveImage(Image, int, boolean, boolean) */ 
     54  public void saveImage(Image image, int series, boolean lastInSeries, 
     55    boolean last) throws FormatException, IOException 
    5656  { 
    5757    if (image == null) { 
  • trunk/loci/formats/out/ICSWriter.java

    r4073 r4163  
    5252 
    5353  // -- IFormatWriter API methods -- 
    54  
    55   /* @see loci.formats.IFormatWriter#saveImage(Image, boolean) */ 
    56   public void saveImage(Image image, boolean last) 
    57     throws FormatException, IOException 
    58   { 
    59     saveImage(image, 0, last, last); 
    60   } 
    6154 
    6255  /* @see loci.formats.IFormatWriter#saveImage(Image, int, boolean, boolean) */ 
  • trunk/loci/formats/out/ImageIOWriter.java

    r4048 r4163  
    7171  // -- IFormatWriter API methods -- 
    7272 
    73   /* @see loci.formats.IFormatWriter#saveImage(Image, boolean) */ 
    74   public void saveImage(Image image, boolean last) 
    75     throws FormatException, IOException 
     73  /* @see loci.formats.IFormatWriter#saveImage(Image, int, boolean, boolean) */ 
     74  public void saveImage(Image image, int series, boolean lastInSeries, 
     75    boolean last) throws FormatException, IOException 
    7676  { 
    7777    BufferedImage img = (cm == null) ? 
  • trunk/loci/formats/out/JPEGWriter.java

    r4048 r4163  
    4747  // -- IFormatWriter API methods -- 
    4848 
    49   /* @see loci.formats.IFormatWriter#save(Image, boolean) */ 
    50   public void saveImage(Image image, boolean last) 
    51     throws FormatException, IOException 
     49  /* @see loci.formats.IFormatWriter#save(Image, int, boolean, boolean) */ 
     50  public void saveImage(Image image, int series, boolean lastInSeries, 
     51    boolean last) throws FormatException, IOException 
    5252  { 
    5353    BufferedImage img = (cm == null) ? 
    5454      ImageTools.makeBuffered(image) : ImageTools.makeBuffered(image, cm); 
    5555    int type = ImageTools.getPixelType(img); 
    56     if (type == FormatTools.UINT16 || type == FormatTools.INT16) { 
    57       throw new FormatException("16-bit data not supported."); 
     56    int[] types = getPixelTypes(); 
     57    for (int i=0; i<types.length; i++) { 
     58      if (types[i] == type) { 
     59        super.saveImage(image, series, lastInSeries, last); 
     60        return; 
     61      } 
    5862    } 
    59     super.saveImage(image, last); 
     63    throw new FormatException("Unsupported data type"); 
    6064  } 
    6165 
  • trunk/loci/formats/out/LegacyQTWriter.java

    r4048 r4163  
    108108  // -- IFormatWriter API methods -- 
    109109 
    110   /* @see loci.formats.IFormatWriter#saveImage(Image, boolean) */ 
    111   public void saveImage(Image image, boolean last) 
    112     throws FormatException, IOException 
     110  /* @see loci.formats.IFormatWriter#saveImage(Image, int, boolean, boolean) */ 
     111  public void saveImage(Image image, int series, boolean lastInSeries, 
     112    boolean last) throws FormatException, IOException 
    113113  { 
    114114    if (tools == null) { 
  • trunk/loci/formats/out/QTWriter.java

    r4048 r4163  
    155155  // -- IFormatWriter API methods -- 
    156156 
    157   /* @see loci.formats.IFormatWriter#saveImage(Image, boolean) */ 
    158   public void saveImage(Image image, boolean last) 
    159     throws FormatException, IOException 
     157  /* @see loci.formats.IFormatWriter#saveImage(Image, int, boolean, boolean) */ 
     158  public void saveImage(Image image, int series, boolean lastInSeries, 
     159    boolean last) throws FormatException, IOException 
    160160  { 
    161161    if (image == null) throw new FormatException("Image is null"); 
  • trunk/loci/formats/out/TiffWriter.java

    r4048 r4163  
    151151  // -- IFormatWriter API methods -- 
    152152 
    153   /* @see loci.formats.IFormatWriter#saveImage(Image, boolean) */ 
    154   public void saveImage(Image image, boolean last) 
    155     throws FormatException, IOException 
    156   { 
    157     saveImage(image, 0, last, last); 
    158   } 
    159  
    160153  /* @see loci.formats.IFormatWriter#saveImage(Image, int, boolean, boolean) */ 
    161154  public void saveImage(Image image, int series, boolean lastInSeries, 
  • trunk/loci/formats/writers.txt

    r4070 r4163  
    2727loci.formats.out.TiffWriter # tif, tiff 
    2828loci.formats.out.JPEGWriter # jpg, jpeg 
    29 loci.formats.out.PNGWriter  # png 
     29loci.formats.out.APNGWriter  # png 
    3030loci.formats.out.AVIWriter  # avi 
    3131loci.formats.out.QTWriter   # mov 
Note: See TracChangeset for help on using the changeset viewer.