< prev index next >

test/javax/imageio/plugins/shared/BitDepth.java

Print this page




  99 
 100     private static final String[] biTypeNames = {
 101         "CUSTOM",
 102         "INT_RGB",
 103         "INT_ARGB",
 104         "INT_ARGB_PRE",
 105         "INT_BGR",
 106         "3BYTE_BGR",
 107         "4BYTE_ABGR",
 108         "4BYTE_ABGR_PRE",
 109         "USHORT_565_RGB",
 110         "USHORT_555_RGB",
 111         "BYTE_GRAY",
 112         "USHORT_GRAY",
 113         "BYTE_BINARY",
 114         "BYTE_INDEXED"
 115     };
 116 
 117     private int width = 80;
 118     private int height = 80;
 119     private String[] format = { "png", "jpeg" };
 120 
 121     public BitDepth(String[] args) throws IOException {
 122         if (args.length > 0) {
 123             format = args;
 124         }
 125 
 126         for (int i = 0; i < format.length; i++) {
 127             testFormat(format[i]);
 128         }
 129     }
 130 
 131     private void testFormat(String format) throws IOException {
 132         boolean allOK = true;
 133 
 134         for (int i = 0; i < biRGBTypes.length; i++) {
 135             int type = biRGBTypes[i];
 136             System.out.println("Testing " + format +
 137                                " writer for type " + biTypeNames[type]);
 138             File f = testWriteRGB(format, type);
 139             boolean ok = testReadRGB(f);




  99 
 100     private static final String[] biTypeNames = {
 101         "CUSTOM",
 102         "INT_RGB",
 103         "INT_ARGB",
 104         "INT_ARGB_PRE",
 105         "INT_BGR",
 106         "3BYTE_BGR",
 107         "4BYTE_ABGR",
 108         "4BYTE_ABGR_PRE",
 109         "USHORT_565_RGB",
 110         "USHORT_555_RGB",
 111         "BYTE_GRAY",
 112         "USHORT_GRAY",
 113         "BYTE_BINARY",
 114         "BYTE_INDEXED"
 115     };
 116 
 117     private int width = 80;
 118     private int height = 80;
 119     private String[] format = { "png", "jpeg", "tif" };
 120 
 121     public BitDepth(String[] args) throws IOException {
 122         if (args.length > 0) {
 123             format = args;
 124         }
 125 
 126         for (int i = 0; i < format.length; i++) {
 127             testFormat(format[i]);
 128         }
 129     }
 130 
 131     private void testFormat(String format) throws IOException {
 132         boolean allOK = true;
 133 
 134         for (int i = 0; i < biRGBTypes.length; i++) {
 135             int type = biRGBTypes[i];
 136             System.out.println("Testing " + format +
 137                                " writer for type " + biTypeNames[type]);
 138             File f = testWriteRGB(format, type);
 139             boolean ok = testReadRGB(f);


< prev index next >