org.sejda.model.image
Enum ImageColorType

java.lang.Object
  extended by java.lang.Enum<ImageColorType>
      extended by org.sejda.model.image.ImageColorType
All Implemented Interfaces:
Serializable, Comparable<ImageColorType>, FriendlyNamed

public enum ImageColorType
extends Enum<ImageColorType>
implements FriendlyNamed

The color type for an image.

Author:
Andrea Vacondio

Enum Constant Summary
BLACK_AND_WHITE
           
COLOR_RGB
           
GRAY_SCALE
           
 
Method Summary
 BufferedImage createBufferedImage(int width, int height)
           
 int getBufferedImageType()
           
 String getFriendlyName()
           
static ImageColorType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ImageColorType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

BLACK_AND_WHITE

public static final ImageColorType BLACK_AND_WHITE

GRAY_SCALE

public static final ImageColorType GRAY_SCALE

COLOR_RGB

public static final ImageColorType COLOR_RGB
Method Detail

values

public static ImageColorType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ImageColorType c : ImageColorType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ImageColorType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getFriendlyName

public String getFriendlyName()
Specified by:
getFriendlyName in interface FriendlyNamed
Returns:
the friendly name of the entity, to be usually used as a representation for an user.

getBufferedImageType

public int getBufferedImageType()
Returns:
the corresponding BufferedImage color type.

createBufferedImage

public BufferedImage createBufferedImage(int width,
                                         int height)
Parameters:
width -
height -
Returns:
a BufferedImage for this color type with the given width and height.


Copyright © 2013 sejda. All Rights Reserved.