|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.svrCore.MIME.AbstractHandler
org.hd.d.pg2k.svrCore.MIME.AbstractImageHandler
org.hd.d.pg2k.svrCore.mediahandler.png
public final class png
Default handler for png file (MIME type image/png). Relies on Java Advanced Imaging extension JAI 1.1.2 or newer (javax.media.jai.*) for some functionality (eg making thumbnails); may not be able to run (or possibly even load) without it, though we try to ensure that basic functionality is available anyway.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.hd.d.pg2k.svrCore.MIME.Handler |
|---|
Handler.ThumbnailParams |
| Field Summary | |
|---|---|
private static int |
EST_BYTES_PER_IMAGE_PIXEL_IN_MEMORY
Estimated (maximum) bytes per pixel of a decoded image in memory. |
private static int |
FILE_OVERHEAD
Estimated file overhead constant, ie what would a 0x0 file size be; non-negative. |
private static int |
maxThumbnailQuality
Maximum quality allowed in a thumbnail; taken to be total colour depth. |
private static int |
minThumbnailQuality
Maximum quality allowed in a thumbnail; taken to be total colour depth. |
private static int |
normalThumbnailQuality
Normal/initial quality for a thumbnail. |
private static int |
TARGET_BPP
Target bits-per-pixel for thumbnail images; strictly positive. |
private static Handler.ThumbnailParams |
thumbnailParams
Gather together thumbnail parameters. |
| Fields inherited from interface org.hd.d.pg2k.svrCore.MIME.Handler |
|---|
TAG_NAME_METADATA_TOP |
| Constructor Summary | |
|---|---|
png()
|
|
| Method Summary | |
|---|---|
protected int |
_reduceColoursQualityThreshold()
Guide colour-reduction to reduce quality and size of lossless image formats. |
boolean |
canMakeThumbnails()
Returns true because handler can make thumbnails for this type. |
java.awt.Dimension |
get2DImageDimensions(java.io.InputStream is)
Get dimensions X and Y of a PNG exhibit, else null if dimensions cannot be computed. |
ExhibitMIME.ExhibitTypeParameters |
getExhibitType()
Get internal type of ExhibitMIME type; never null. |
Handler.ThumbnailParams |
getThumbnailParams()
Get ThumbnailParameters for a particular handler. |
| Methods inherited from class org.hd.d.pg2k.svrCore.MIME.AbstractImageHandler |
|---|
_getEncoder, _trimMetadata, decodeImage, estimateWorkingMemoryToCreateThumbnails, extractSpecificImageMetaData, getMetadata, makeImageBinary, makeSizeConstrainedEncodedImage, makeThumbnailImage, makeThumbnails, makeThumbnails |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final int TARGET_BPP
A value in the range 4--8 is probably good.
private static final int FILE_OVERHEAD
One byte less than a 1x1 white image produced by PSP7.
private static final int EST_BYTES_PER_IMAGE_PIXEL_IN_MEMORY
private static final int maxThumbnailQuality
private static final int normalThumbnailQuality
private static final int minThumbnailQuality
private static final Handler.ThumbnailParams thumbnailParams
| Constructor Detail |
|---|
public png()
| Method Detail |
|---|
public ExhibitMIME.ExhibitTypeParameters getExhibitType()
public java.awt.Dimension get2DImageDimensions(java.io.InputStream is)
throws java.io.IOException
This input stream must be of the correct type, eg the magic number already checked.
This does not close its input stream when done.
get2DImageDimensions in interface Handlerget2DImageDimensions in class AbstractImageHandleris - the exhibit as a binary data stream
java.io.IOException - in case of problems with corrupt data
(or a broken exhibit)public Handler.ThumbnailParams getThumbnailParams()
AbstractHandlerThis is assumed to be fast, ie to return a fixed static instance for each handler.
This is protected, since only the support routines in this base class need access this data.
getThumbnailParams in interface HandlergetThumbnailParams in class AbstractHandlerpublic boolean canMakeThumbnails()
canMakeThumbnails in interface HandlercanMakeThumbnails in class AbstractImageHandlerprotected int _reduceColoursQualityThreshold()
AbstractImageHandlerElse this is a positive value n, typically 8 or 24, which sets a quality level at/below which the number of colours in the image is reduced to (capped at) 2^n, and the image representation may be tweaked too (eg converted to a palette/indexed format) as a strong hint to the encoder.
_reduceColoursQualityThreshold in class AbstractImageHandler
|
DHD Multimedia Gallery V1.60.69 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||