01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.apache.harmony.x.imageio.plugins.png;
19:
20: import java.io.IOException;
21: import java.util.Locale;
22:
23: import javax.imageio.ImageReader;
24: import javax.imageio.spi.ImageReaderSpi;
25:
26: import org.apache.harmony.x.imageio.plugins.ImageSignature;
27: import org.apache.harmony.x.imageio.plugins.ImageType;
28: import org.apache.harmony.x.imageio.plugins.PluginUtils;
29:
30: public class PNGImageReaderSpi extends ImageReaderSpi {
31:
32: public PNGImageReaderSpi() {
33: super (PluginUtils.VENDOR_NAME, PluginUtils.DEFAULT_VERSION,
34: ImageType.PNG.getNames(), ImageType.PNG.getSuffixes(),
35: ImageType.PNG.getMimeTypes(), PNGImageReader.class
36: .getName(), STANDARD_INPUT_TYPE,
37: new String[] { PNGImageWriterSpi.class.getName() },
38: false, null, null, null, null, false, null, null, null,
39: null);
40: }
41:
42: @Override
43: public boolean canDecodeInput(final Object source)
44: throws IOException {
45: return ImageSignature.PNG.verify(source);
46: }
47:
48: @Override
49: public ImageReader createReaderInstance(Object extension)
50: throws IOException {
51: return new PNGImageReader(this );
52: }
53:
54: @Override
55: public String getDescription(Locale locale) {
56: return "PNG image decoder"; //$NON-NLS-1$
57: }
58: }
|