public class BMPImageWriter extends ImageWriter implements BMPConstants
ImageWriteParam
.BMPImageWriteParam
Modifier and Type | Class and Description |
---|---|
private class |
BMPImageWriter.IIOWriteProgressAdapter |
Modifier and Type | Field and Description |
---|---|
private int[] |
bitMasks |
private int[] |
bitPos |
private byte[] |
bpixels |
private int |
compImageSize |
private int |
compressionType |
private ByteArrayOutputStream |
embedded_stream |
private int |
h |
private int[] |
ipixels |
private boolean |
isTopDown |
private short[] |
spixels |
private ImageOutputStream |
stream
The output stream to write into
|
private int |
w |
availableLocales, locale, originatingProvider, output, progressListeners, warningListeners, warningLocales
BI_BITFIELDS, BI_JPEG, BI_PNG, BI_RGB, BI_RLE4, BI_RLE8, compressionTypeNames, LCS_CALIBRATED_RGB, LCS_sRGB, LCS_WINDOWS_COLOR_SPACE, PROFILE_EMBEDDED, PROFILE_LINKED, VERSION_2, VERSION_3, VERSION_3_NT, VERSION_4, VERSION_5
Constructor and Description |
---|
BMPImageWriter(ImageWriterSpi originator)
Constructs
BMPImageWriter based on the provided
ImageWriterSpi . |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canEncodeImage(int compression,
ColorModel cm,
SampleModel sm) |
protected boolean |
canEncodeImage(int compression,
ImageTypeSpecifier imgType) |
boolean |
canWriteRasters() |
IIOMetadata |
convertImageMetadata(IIOMetadata inData,
ImageTypeSpecifier imageType,
ImageWriteParam param) |
IIOMetadata |
convertStreamMetadata(IIOMetadata inData,
ImageWriteParam param) |
private void |
encodeRLE4(byte[] bipixels,
int scanlineBytes) |
private void |
encodeRLE8(byte[] bpixels,
int scanlineBytes) |
private int |
firstLowBit(int num) |
(package private) static int |
getCompressionType(String typeString) |
IIOMetadata |
getDefaultImageMetadata(ImageTypeSpecifier imageType,
ImageWriteParam param) |
IIOMetadata |
getDefaultStreamMetadata(ImageWriteParam param) |
ImageWriteParam |
getDefaultWriteParam() |
(package private) static int |
getPreferredCompressionType(ColorModel cm,
SampleModel sm) |
(package private) static int |
getPreferredCompressionType(ImageTypeSpecifier imageType) |
private void |
incCompImageSize(int value) |
private boolean |
isEven(int number) |
void |
reset() |
private int |
roundBpp(int x) |
void |
setOutput(Object output) |
void |
write(IIOMetadata streamMetadata,
IIOImage image,
ImageWriteParam param) |
private void |
writeEmbedded(IIOImage image,
ImageWriteParam bmpParam) |
private void |
writeFileHeader(int fileSize,
int offset) |
private void |
writeInfoHeader(int headerSize,
int bitsPerPixel) |
protected void |
writeMaskToPalette(int mask,
int i,
byte[] r,
byte[] g,
byte[] b,
byte[] a) |
private void |
writePixels(int l,
int scanlineBytes,
int bitsPerPixel,
int[] pixels,
int padding,
int numBands,
IndexColorModel icm) |
private void |
writeSize(int dword,
int offset) |
abort, abortRequested, addIIOWriteProgressListener, addIIOWriteWarningListener, canInsertEmpty, canInsertImage, canRemoveImage, canReplaceImageMetadata, canReplacePixels, canReplaceStreamMetadata, canWriteEmpty, canWriteSequence, clearAbortRequest, dispose, endInsertEmpty, endReplacePixels, endWriteEmpty, endWriteSequence, getAvailableLocales, getLocale, getNumThumbnailsSupported, getOriginatingProvider, getOutput, getPreferredThumbnailSizes, prepareInsertEmpty, prepareReplacePixels, prepareWriteEmpty, prepareWriteSequence, processImageComplete, processImageProgress, processImageStarted, processThumbnailComplete, processThumbnailProgress, processThumbnailStarted, processWarningOccurred, processWarningOccurred, processWriteAborted, removeAllIIOWriteProgressListeners, removeAllIIOWriteWarningListeners, removeIIOWriteProgressListener, removeIIOWriteWarningListener, removeImage, replaceImageMetadata, replacePixels, replacePixels, replaceStreamMetadata, setLocale, write, write, writeInsert, writeToSequence
private ImageOutputStream stream
private ByteArrayOutputStream embedded_stream
private int compressionType
private boolean isTopDown
private int w
private int h
private int compImageSize
private int[] bitMasks
private int[] bitPos
private byte[] bpixels
private short[] spixels
private int[] ipixels
public BMPImageWriter(ImageWriterSpi originator)
BMPImageWriter
based on the provided
ImageWriterSpi
.public void setOutput(Object output)
setOutput
in class ImageWriter
public ImageWriteParam getDefaultWriteParam()
getDefaultWriteParam
in class ImageWriter
public IIOMetadata getDefaultStreamMetadata(ImageWriteParam param)
getDefaultStreamMetadata
in class ImageWriter
public IIOMetadata getDefaultImageMetadata(ImageTypeSpecifier imageType, ImageWriteParam param)
getDefaultImageMetadata
in class ImageWriter
public IIOMetadata convertStreamMetadata(IIOMetadata inData, ImageWriteParam param)
convertStreamMetadata
in interface ImageTranscoder
convertStreamMetadata
in class ImageWriter
public IIOMetadata convertImageMetadata(IIOMetadata inData, ImageTypeSpecifier imageType, ImageWriteParam param)
convertImageMetadata
in interface ImageTranscoder
convertImageMetadata
in class ImageWriter
public boolean canWriteRasters()
canWriteRasters
in class ImageWriter
public void write(IIOMetadata streamMetadata, IIOImage image, ImageWriteParam param) throws IOException
write
in class ImageWriter
IOException
private void writePixels(int l, int scanlineBytes, int bitsPerPixel, int[] pixels, int padding, int numBands, IndexColorModel icm) throws IOException
IOException
private void encodeRLE8(byte[] bpixels, int scanlineBytes) throws IOException
IOException
private void encodeRLE4(byte[] bipixels, int scanlineBytes) throws IOException
IOException
private void incCompImageSize(int value)
private boolean isEven(int number)
private void writeFileHeader(int fileSize, int offset) throws IOException
IOException
private void writeInfoHeader(int headerSize, int bitsPerPixel) throws IOException
IOException
private void writeSize(int dword, int offset) throws IOException
IOException
public void reset()
reset
in class ImageWriter
static int getCompressionType(String typeString)
private void writeEmbedded(IIOImage image, ImageWriteParam bmpParam) throws IOException
IOException
private int firstLowBit(int num)
static int getPreferredCompressionType(ColorModel cm, SampleModel sm)
static int getPreferredCompressionType(ImageTypeSpecifier imageType)
protected boolean canEncodeImage(int compression, ColorModel cm, SampleModel sm)
protected boolean canEncodeImage(int compression, ImageTypeSpecifier imgType)
protected void writeMaskToPalette(int mask, int i, byte[] r, byte[] g, byte[] b, byte[] a)
private int roundBpp(int x)
Copyright © 2016 Open Microscopy Environment