magick.util
Class DisplayImageMetaData

java.lang.Object
  extended by magick.util.DisplayImageMetaData

public class DisplayImageMetaData
extends java.lang.Object

A generic solution that can display information about a MagickImage or ImageInfo object by using reflection. It look at the xxxType-classes (ColorspaceType, GeometryFlags) and replaces the numbers with the variable names given there. License: You decide, I give it to the public domain. Use if for whatever you want.

Author:
Jacob Nordfalk

Constructor Summary
DisplayImageMetaData()
           
 
Method Summary
static java.lang.String classTypeAsString(int value)
           
static java.lang.String colorspaceTypeAsString(int value)
          Returns the name of a public static final int field in class colorspaceType.
static java.lang.String compositeOperatorAsString(int value)
           
static java.lang.String compressionTypeAsString(int value)
           
static java.lang.String decorationTypeAsString(int value)
           
static void displayImageInfo(ImageInfo info)
           
static void displayMagickImage(MagickImage image)
           
static java.lang.String drawInfoAsString(int value)
           
static java.lang.String exceptionTypeAsString(int value)
           
static java.lang.String filterTypeAsString(int value)
           
static java.lang.String geometryFlagsAsString(int value)
           
static java.lang.String gravityTypeAsString(int value)
           
static java.lang.String imageTypeAsString(int value)
           
static java.lang.String interlaceTypeAsString(int value)
           
static java.lang.String nameOfpublicstaticintField(java.lang.Class clazz, int value)
          Searches through class's public static final int fields until it finds a field with a specific value.
static java.lang.String noiseTypeAsString(int value)
           
static java.lang.String previewTypeAsString(int value)
           
static java.lang.String primitiveTypeAsString(int value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DisplayImageMetaData

public DisplayImageMetaData()
Method Detail

nameOfpublicstaticintField

public static java.lang.String nameOfpublicstaticintField(java.lang.Class clazz,
                                                          int value)
Searches through class's public static final int fields until it finds a field with a specific value. Examples:
 nameOfpublicstaticintField(ColorspaceType.class, 0) returns "UndefinedColorspace"
 nameOfpublicstaticintField(ColorspaceType.class, 1) returns "RGBColorspace"
 nameOfpublicstaticintField(ColorspaceType.class, 2) returns "GRAYColorspace"

 nameOfpublicstaticintField(GeometryFlags.class, 0) returns "NoValue"
 nameOfpublicstaticintField(GeometryFlags.class, 1) returns "PsiValue"

 Given that these classes are declared as:

     public abstract interface ColorspaceType {
      public static final int UndefinedColorspace = 0;
      public static final int RGBColorspace = 1;
      public static final int GRAYColorspace = 2;
      ...

     and

     public abstract interface GeometryFlags {
      public static final int NoValue = 0;
      public static final int PsiValue = 1;
      public static final int XValue = 1;
      public static final int XiValue = 2;
     

Parameters:
clazz - Class to search in
value - int value to search for
Returns:
name of fiels

colorspaceTypeAsString

public static java.lang.String colorspaceTypeAsString(int value)
Returns the name of a public static final int field in class colorspaceType. Example: colorspaceTypeAsString(3) returns "TransparentColorspace"

Parameters:
value - field value
Returns:
field name

classTypeAsString

public static java.lang.String classTypeAsString(int value)

compositeOperatorAsString

public static java.lang.String compositeOperatorAsString(int value)

compressionTypeAsString

public static java.lang.String compressionTypeAsString(int value)

decorationTypeAsString

public static java.lang.String decorationTypeAsString(int value)

drawInfoAsString

public static java.lang.String drawInfoAsString(int value)

exceptionTypeAsString

public static java.lang.String exceptionTypeAsString(int value)

filterTypeAsString

public static java.lang.String filterTypeAsString(int value)

geometryFlagsAsString

public static java.lang.String geometryFlagsAsString(int value)

gravityTypeAsString

public static java.lang.String gravityTypeAsString(int value)

imageTypeAsString

public static java.lang.String imageTypeAsString(int value)

interlaceTypeAsString

public static java.lang.String interlaceTypeAsString(int value)

noiseTypeAsString

public static java.lang.String noiseTypeAsString(int value)

previewTypeAsString

public static java.lang.String previewTypeAsString(int value)

primitiveTypeAsString

public static java.lang.String primitiveTypeAsString(int value)

displayImageInfo

public static void displayImageInfo(ImageInfo info)

displayMagickImage

public static void displayMagickImage(MagickImage image)