org.hd.d.pg2k.webSvr.bgImg
Class BgImageUtils

java.lang.Object
  extended by org.hd.d.pg2k.webSvr.bgImg.BgImageUtils

public final class BgImageUtils
extends java.lang.Object

Supporting constants and classes for dynamic background images.


Nested Class Summary
static interface BgImageUtils.DynImageGen
          Functor/interface for dynamic background image generator.
static class BgImageUtils.SimpleUniformMonoImageGen
          Simple monochrome uniform colour image.
static class BgImageUtils.SimpleUniformNoiseMonoImageGen
          Simple monochrome random-pixel image.
static class BgImageUtils.Sine2DColourImageGen
          Makes 2D sine-plus-noise colour image.
 
Field Summary
static java.util.List<BgImageUtils.DynImageGen> allDynGens
          Immutable List of instances all available basic DynImageGen; never null or empty.
(package private) static int DYN_MAP_IMG_TYPE
          Type of background image that we dynamically generate.
static int dynBgImgEdgePixels
          We chose the background image dimensions to match that of a standard thumbnail.
static int dynBgImgMaxBytes
          The maximum size of image produced (in bytes) is that of a standard thumbnail.
static java.lang.String dynBgImgRRUL
          URI of dynamic background-image JPEG; suffix should match MIME type.
(package private) static ExhibitMIME.ExhibitTypeParameters ETP
          ExhibitMIME entry for the chosen output type.
(package private) static int MAX_Y
          Maximum brightness (assuming 0 is black, 255 is white).
(package private) static int MIN_Y
          Minimum brightness (assuming 0 is black, 255 is white).
 
Constructor Summary
BgImageUtils()
           
 
Method Summary
(package private) static byte[] generateEncodedImage(java.awt.image.BufferedImage bi)
          Convert BufferedImage to byte[]-encoded JPEG no larger than dynBgImgMaxBytes bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_Y

static final int MAX_Y
Maximum brightness (assuming 0 is black, 255 is white).

See Also:
Constant Field Values

MIN_Y

static final int MIN_Y
Minimum brightness (assuming 0 is black, 255 is white). Should be less than MAX_Y by at least 0x33 (51) to (almost) force browsers with a 6x6x6 colour cube to show the image in at least two colours.

See Also:
Constant Field Values

DYN_MAP_IMG_TYPE

static final int DYN_MAP_IMG_TYPE
Type of background image that we dynamically generate. Since we want to be able to read text against this, and not consume too much bandwidth, both implying smoothly varying images, JPEG is probably the best format, especially as it is widely supported.

See Also:
Constant Field Values

ETP

static final ExhibitMIME.ExhibitTypeParameters ETP
ExhibitMIME entry for the chosen output type.


dynBgImgRRUL

public static final java.lang.String dynBgImgRRUL
URI of dynamic background-image JPEG; suffix should match MIME type.

See Also:
Constant Field Values

dynBgImgEdgePixels

public static final int dynBgImgEdgePixels
We chose the background image dimensions to match that of a standard thumbnail.

See Also:
Constant Field Values

dynBgImgMaxBytes

public static final int dynBgImgMaxBytes
The maximum size of image produced (in bytes) is that of a standard thumbnail.

See Also:
Constant Field Values

allDynGens

public static final java.util.List<BgImageUtils.DynImageGen> allDynGens
Immutable List of instances all available basic DynImageGen; never null or empty.

Constructor Detail

BgImageUtils

public BgImageUtils()
Method Detail

generateEncodedImage

static byte[] generateEncodedImage(java.awt.image.BufferedImage bi)
                            throws java.io.IOException
Convert BufferedImage to byte[]-encoded JPEG no larger than dynBgImgMaxBytes bytes.

Throws:
java.io.IOException

DHD Multimedia Gallery V1.53.0

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