net.sourceforge.jiu.codecs.jpeg

Class JPEGCodec


public class JPEGCodec
extends ImageCodec

A codec for the JPEG file format.

Supported JPEG types

The codec is still under development. Nothing can be read with it right now. Writing JPEG files is not even in development stage.

Credits

"JPEG Still Image Data Compression Standard" by William B. Pennebaker and Joan L. Mitchell. Published 1993 by Van Nostrand Reinhold. ISBN 0-442-01272-1. This book is referenced as P&M throughout the source code. It's an invaluable resource for anything related to JPEG.
Author:
Marco Schmidt
Since:
0.13.0

Field Summary

private DataInput
in

Fields inherited from class net.sourceforge.jiu.codecs.ImageCodec

boundsAvail, boundsHeight, boundsWidth, boundsX1, boundsX2, boundsY1, boundsY2, comments, din, dout, dpiX, dpiY, image, imageIndex, in, mode, out, raf

Fields inherited from class net.sourceforge.jiu.ops.Operation

abort, progressListeners

Method Summary

private void
decodeScan(JPEGData jpegData)
String[]
getFileExtensions()
String
getFormatName()
String[]
getMimeTypes()
boolean
isLoadingSupported()
boolean
isSavingSupported()
private void
load()
static void
main(String[] args)
void
process()
private void
readMarker(JPEGData jpegData, int marker, int length)
String
suggestFileExtension(PixelImage image)

Methods inherited from class net.sourceforge.jiu.codecs.ImageCodec

appendComment, checkBounds, checkImageResolution, close, getBoundsHeight, getBoundsWidth, getBoundsX1, getBoundsX2, getBoundsY1, getBoundsY2, getComment, getDataInput, getDataOutput, getDpiX, getDpiY, getFileExtensions, getFormatName, getImage, getImageIndex, getInputAsDataInput, getInputStream, getMimeTypes, getMode, getNumComments, getOutputAsDataOutput, getOutputStream, getRandomAccessFile, hasBounds, initModeFromIOObjects, isLoadingSupported, isRowRequired, isSavingSupported, isTileRequired, removeAllComments, removeBounds, setBounds, setBoundsIfNecessary, setDataInput, setDataOutput, setDpi, setFile, setFile, setImage, setImageIndex, setInputStream, setOutputStream, setRandomAccessFile, suggestFileExtension

Methods inherited from class net.sourceforge.jiu.ops.Operation

addProgressListener, addProgressListeners, getAbort, process, removeProgressListener, setAbort, setProgress, setProgress

Field Details

in

private DataInput in

Method Details

decodeScan

private void decodeScan(JPEGData jpegData)

getFileExtensions

public String[] getFileExtensions()
Overrides:
getFileExtensions in interface ImageCodec

getFormatName

public String getFormatName()
Overrides:
getFormatName in interface ImageCodec

getMimeTypes

public String[] getMimeTypes()
Overrides:
getMimeTypes in interface ImageCodec

isLoadingSupported

public boolean isLoadingSupported()
Overrides:
isLoadingSupported in interface ImageCodec

isSavingSupported

public boolean isSavingSupported()
Overrides:
isSavingSupported in interface ImageCodec

load

private void load()
            throws OperationFailedException,
                   WrongFileFormatException

main

public static void main(String[] args)
            throws Exception

process

public void process()
            throws MissingParameterException,
                   OperationFailedException,
                   WrongFileFormatException
Overrides:
process in interface Operation

readMarker

private void readMarker(JPEGData jpegData,
                        int marker,
                        int length)
            throws InvalidFileStructureException,
                   IOException,
                   UnsupportedTypeException

suggestFileExtension

public String suggestFileExtension(PixelImage image)
Overrides:
suggestFileExtension in interface ImageCodec