The Android Open Source Project | 7c1b96a | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | * contributor license agreements. See the NOTICE file distributed with |
| 4 | * this work for additional information regarding copyright ownership. |
| 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | * (the "License"); you may not use this file except in compliance with |
| 7 | * the License. You may obtain a copy of the License at |
| 8 | * |
| 9 | * 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 | * @author Rustem V. Rafikov |
| 19 | * @version $Revision: 1.3 $ |
| 20 | */ |
The Android Open Source Project | e09fd9e | 2008-12-17 18:05:43 -0800 | [diff] [blame^] | 21 | |
The Android Open Source Project | 7c1b96a | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 22 | package javax.imageio; |
| 23 | |
| 24 | import javax.imageio.metadata.IIOMetadata; |
| 25 | import javax.imageio.ImageTypeSpecifier; |
| 26 | |
| 27 | /** |
The Android Open Source Project | e09fd9e | 2008-12-17 18:05:43 -0800 | [diff] [blame^] | 28 | * The ImageTranscoder interface is to be implemented by classes that perform |
| 29 | * image transcoding operations, that is, take images written in one format and |
| 30 | * write them in another format using read/write operations. Some image data can |
| 31 | * be lost in such processes. The ImageTranscoder interface converts metadata |
| 32 | * objects (IIOMetadata) of ImageReader to appropriate metadata object for |
| 33 | * ImageWriter. |
| 34 | * |
| 35 | * @since Android 1.0 |
The Android Open Source Project | 7c1b96a | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 36 | */ |
| 37 | public interface ImageTranscoder { |
The Android Open Source Project | e09fd9e | 2008-12-17 18:05:43 -0800 | [diff] [blame^] | 38 | |
The Android Open Source Project | 7c1b96a | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 39 | /** |
| 40 | * Converts the specified IIOMetadata object using the specified |
| 41 | * ImageWriteParam for obtaining writer's metadata structure. |
| 42 | * |
The Android Open Source Project | e09fd9e | 2008-12-17 18:05:43 -0800 | [diff] [blame^] | 43 | * @param inData |
| 44 | * the IIOMetadata. |
| 45 | * @param param |
| 46 | * the ImageWriteParam. |
The Android Open Source Project | 7c1b96a | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 47 | * @return the IIOMetadata, or null. |
| 48 | */ |
| 49 | IIOMetadata convertStreamMetadata(IIOMetadata inData, ImageWriteParam param); |
| 50 | |
| 51 | /** |
| 52 | * Converts the specified IIOMetadata object using the specified |
The Android Open Source Project | e09fd9e | 2008-12-17 18:05:43 -0800 | [diff] [blame^] | 53 | * ImageWriteParam for obtaining writer's metadata structure and |
| 54 | * ImageTypeSpecifier object for obtaining the layout and color information |
| 55 | * of the image for this metadata. |
The Android Open Source Project | 7c1b96a | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 56 | * |
The Android Open Source Project | e09fd9e | 2008-12-17 18:05:43 -0800 | [diff] [blame^] | 57 | * @param inData |
| 58 | * the IIOMetadata. |
| 59 | * @param imageType |
| 60 | * the ImageTypeSpecifier. |
| 61 | * @param param |
| 62 | * the ImageWriteParam. |
The Android Open Source Project | 7c1b96a | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 63 | * @return the IIOMetadata, or null. |
| 64 | */ |
The Android Open Source Project | e09fd9e | 2008-12-17 18:05:43 -0800 | [diff] [blame^] | 65 | IIOMetadata convertImageMetadata(IIOMetadata inData, ImageTypeSpecifier imageType, |
| 66 | ImageWriteParam param); |
The Android Open Source Project | 7c1b96a | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 67 | } |