org.hd.d.pg2k.svrCore.MIME
Class Handler.ThumbnailParams

java.lang.Object
  extended by org.hd.d.pg2k.svrCore.MIME.Handler.ThumbnailParams
Enclosing interface:
Handler

public static final class Handler.ThumbnailParams
extends java.lang.Object

Some constant parameters and hints for thumbnail building. Each handler that can build thumbnails should define one of these statically and return it from getThumbnailParameters().

If canMakeThumbnails() returns true, getThumbnailParameters() must return a non-null value.

This exists to help cluttering the base class API with things relevant only to the internal mechanics of this system.


Field Summary
 int approxMinOverheadBytes
          Approximate minimum overhead of format in bytes; non-negative.
 int estimatedBytesPerImagePixelInMemory
          Estimated bytes-per-pixel of image in memory; positive.
 int initialQualityHint
          Suggested initial quality value.
 int maxQuality
          Maximum usable value of "quality" parameter to makeScaledImage().
 int minQuality
          Minimum usable value of "quality" parameter to makeScaledImage(); non-negative.
 int thumbnailBppHint
          Suggested target bits-per-pixel for a thumbnail; positive.
 
Constructor Summary
Handler.ThumbnailParams(int estimatedBytesPerImagePixelInMemory, int minQuality, int maxQuality, int initialQualityHint, int thumbnailBppHint, int approxMinOverheadBytes)
          Construct an instance.
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

estimatedBytesPerImagePixelInMemory

public final int estimatedBytesPerImagePixelInMemory
Estimated bytes-per-pixel of image in memory; positive. Defaults to 4 assuming RBG/ARGB int format of image.


minQuality

public final int minQuality
Minimum usable value of "quality" parameter to makeScaledImage(); non-negative.


maxQuality

public final int maxQuality
Maximum usable value of "quality" parameter to makeScaledImage(). Anything higher than this value is treated as equal to this value and implies maximum possible: thus Integer.MAX_VALUE means maximum possible too.

If the same as minQuality this indicates that this is not parametrically variable.


initialQualityHint

public final int initialQualityHint
Suggested initial quality value. This will lie between minQuality and maxQuality inclusive.

Careful choice of this will help reduce the number of redundant image builds done.


thumbnailBppHint

public final int thumbnailBppHint
Suggested target bits-per-pixel for a thumbnail; positive. This should ignore any typical fixed overheads.

This is a hint to generation routines.


approxMinOverheadBytes

public final int approxMinOverheadBytes
Approximate minimum overhead of format in bytes; non-negative. Rough minimum size in this format including magic numbers, cost of file structure, etc.

This is used to help make better estimates of target thumbnail sizes, etc, and need not be (indeed, probably cannot be) exact given that each format may have different representations.

Can be zero, though all reasonable implementations should at least default to the size of any leading "magic" number.

Constructor Detail

Handler.ThumbnailParams

public Handler.ThumbnailParams(int estimatedBytesPerImagePixelInMemory,
                               int minQuality,
                               int maxQuality,
                               int initialQualityHint,
                               int thumbnailBppHint,
                               int approxMinOverheadBytes)
                        throws java.lang.IllegalArgumentException
Construct an instance. Argument values are range-checked as far as practical.

Throws:
java.lang.IllegalArgumentException

DHD Multimedia Gallery V1.53.0

Copyright (c) 1996-2009, Damon Hart-Davis. All rights reserved.