public class WriteFile extends Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_PROGRESSIVE |
static int |
DEFAULT_QUALITY |
| Constructor and Description |
|---|
WriteFile() |
| Modifier and Type | Method and Description |
|---|---|
static android.graphics.Bitmap |
writeBitmap(Pix pixs)
Writes a Pix to an Android Bitmap object.
|
static byte[] |
writeBytes8(Pix pixs)
Write an 8bpp Pix to a flat byte array.
|
static int |
writeBytes8(Pix pixs,
byte[] data)
Write an 8bpp Pix to a flat byte array.
|
static boolean |
writeFiles(Pixa pixas,
File path,
String prefix,
int format)
Writes all the images in a Pixa array to individual files using the
specified format.
|
static boolean |
writeImpliedFormat(Pix pixs,
File file)
Writes a Pix to file using the file extension as the output format;
supported formats are .jpg or .jpeg for JPEG and .bmp for bitmap.
|
static boolean |
writeImpliedFormat(Pix pixs,
File file,
int quality,
boolean progressive)
Writes a Pix to file using the file extension as the output format;
supported formats are .jpg or .jpeg for JPEG and .bmp for bitmap.
|
static byte[] |
writeMem(Pix pixs,
int format)
Write a Pix to a byte array using the specified encoding from
Constants.IFF_*.
|
public static final int DEFAULT_QUALITY
public static final boolean DEFAULT_PROGRESSIVE
public static byte[] writeBytes8(Pix pixs)
pixs - The 8bpp source image.public static int writeBytes8(Pix pixs, byte[] data)
pixs - The 8bpp source image.data - A byte array large enough to hold the pixels of pixs.public static boolean writeFiles(Pixa pixas, File path, String prefix, int format)
Output file names will take the format
pixas - The source Pixa image array.path - The output directory.prefix - The prefix to give output files.format - The format to use for output files.true on successpublic static byte[] writeMem(Pix pixs, int format)
pixs - The source image.format - A format from Constants.IFF_*.public static boolean writeImpliedFormat(Pix pixs, File file)
Uses default quality and progressive encoding settings.
pixs - Source image.file - The file to write.true on successpublic static boolean writeImpliedFormat(Pix pixs, File file, int quality, boolean progressive)
Notes:
pixs - Source image.file - The file to write.quality - (Only for lossy formats) Quality between 1 - 100, 0 for
default.progressive - (Only for JPEG) Whether to encode as progressive.true on successpublic static android.graphics.Bitmap writeBitmap(Pix pixs)
pixs - The source image.null
on failureCopyright © 2014. All rights reserved.