Home | History | Annotate | Download | only in exif
      1 /*
      2  * Copyright (C) 2016 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 
     17 package com.android.dialer.callcomposer.camera.exif;
     18 
     19 class JpegHeader {
     20   static final short SOI = (short) 0xFFD8;
     21   static final short APP1 = (short) 0xFFE1;
     22   static final short EOI = (short) 0xFFD9;
     23 
     24   /**
     25    * SOF (start of frame). All value between SOF0 and SOF15 is SOF marker except for DHT, JPG, and
     26    * DAC marker.
     27    */
     28   private static final short SOF0 = (short) 0xFFC0;
     29 
     30   private static final short SOF15 = (short) 0xFFCF;
     31   private static final short DHT = (short) 0xFFC4;
     32   private static final short JPG = (short) 0xFFC8;
     33   private static final short DAC = (short) 0xFFCC;
     34 
     35   static boolean isSofMarker(short marker) {
     36     return marker >= SOF0 && marker <= SOF15 && marker != DHT && marker != JPG && marker != DAC;
     37   }
     38 }
     39