| 1 |
package com.drew.metadata.eps; |
| 2 |
|
| 3 |
import com.drew.lang.annotations.NotNull; |
| 4 |
import com.drew.lang.annotations.Nullable; |
| 5 |
import com.drew.metadata.TagDescriptor; |
| 6 |
|
| 7 |
import static com.drew.metadata.eps.EpsDirectory.*; |
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
public class EpsDescriptor extends TagDescriptor<EpsDirectory> |
| 13 |
{ |
| 14 |
|
| 15 |
public EpsDescriptor(@NotNull EpsDirectory directory) |
| 16 |
{ |
| 17 |
super(directory); |
| 18 |
} |
| 19 |
|
| 20 |
@Override |
| 21 |
public String getDescription(int tagType) |
| 22 |
{ |
| 23 |
switch (tagType) { |
| 24 |
case TAG_IMAGE_WIDTH: |
| 25 |
case TAG_IMAGE_HEIGHT: |
| 26 |
return getPixelDescription(tagType); |
| 27 |
case TAG_TIFF_PREVIEW_SIZE: |
| 28 |
case TAG_TIFF_PREVIEW_OFFSET: |
| 29 |
return getByteSizeDescription(tagType); |
| 30 |
case TAG_COLOR_TYPE: |
| 31 |
return getColorTypeDescription(); |
| 32 |
default: |
| 33 |
return _directory.getString(tagType); |
| 34 |
} |
| 35 |
} |
| 36 |
|
| 37 |
public String getPixelDescription(int tagType) |
| 38 |
{ |
| 39 |
return _directory.getString(tagType) + " pixels"; |
| 40 |
} |
| 41 |
|
| 42 |
public String getByteSizeDescription(int tagType) |
| 43 |
{ |
| 44 |
return _directory.getString(tagType) + " bytes"; |
| 45 |
} |
| 46 |
|
| 47 |
@Nullable |
| 48 |
public String getColorTypeDescription() |
| 49 |
{ |
| 50 |
return getIndexedDescription(TAG_COLOR_TYPE, 1, |
| 51 |
"Grayscale", "Lab", "RGB", "CMYK"); |
| 52 |
} |
| 53 |
} |