/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. package com.android.gallery3d.exif;
  17. class JpegHeader {
  18. public static final short SOI = (short) 0xFFD8;
  19. public static final short APP1 = (short) 0xFFE1;
  20. public static final short APP0 = (short) 0xFFE0;
  21. public static final short EOI = (short) 0xFFD9;
  22. /**
  23. * SOF (start of frame). All value between SOF0 and SOF15 is SOF marker except for DHT, JPG,
  24. * and DAC marker.
  25. */
  26. public static final short SOF0 = (short) 0xFFC0;
  27. public static final short SOF15 = (short) 0xFFCF;
  28. public static final short DHT = (short) 0xFFC4;
  29. public static final short JPG = (short) 0xFFC8;
  30. public static final short DAC = (short) 0xFFCC;
  31. public static final boolean isSofMarker(short marker) {
  32. return marker >= SOF0 && marker <= SOF15 && marker != DHT && marker != JPG
  33. && marker != DAC;
  34. }
  35. }