PageRenderTime 19ms CodeModel.GetById 13ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/packages/WallpaperCropper/src/com/android/gallery3d/exif/JpegHeader.java

https://github.com/aizuzi/platform_frameworks_base
Java | 39 lines | 16 code | 4 blank | 19 comment | 7 complexity | c32f146efc48bf856c0b98029e45a51f MD5 | raw file
 1/*
 2 * Copyright (C) 2012 The Android Open Source Project
 3 *
 4 * Licensed under the Apache License, Version 2.0 (the "License");
 5 * you may not use this file except in compliance with the License.
 6 * You may obtain a copy of the License at
 7 *
 8 *      http://www.apache.org/licenses/LICENSE-2.0
 9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.gallery3d.exif;
18
19class JpegHeader {
20    public static final short SOI =  (short) 0xFFD8;
21    public static final short APP1 = (short) 0xFFE1;
22    public static final short APP0 = (short) 0xFFE0;
23    public static final short EOI = (short) 0xFFD9;
24
25    /**
26     *  SOF (start of frame). All value between SOF0 and SOF15 is SOF marker except for DHT, JPG,
27     *  and DAC marker.
28     */
29    public static final short SOF0 = (short) 0xFFC0;
30    public static final short SOF15 = (short) 0xFFCF;
31    public static final short DHT = (short) 0xFFC4;
32    public static final short JPG = (short) 0xFFC8;
33    public static final short DAC = (short) 0xFFCC;
34
35    public static final boolean isSofMarker(short marker) {
36        return marker >= SOF0 && marker <= SOF15 && marker != DHT && marker != JPG
37                && marker != DAC;
38    }
39}