|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectar.com.hjg.pngj.chunks.ChunkHelper
public class ChunkHelper
Field Summary | |
---|---|
static byte[] |
b_IDAT
|
static byte[] |
b_IEND
|
static byte[] |
b_IHDR
|
static byte[] |
b_PLTE
|
static String |
bKGD
|
static String |
cHRM
|
static String |
gAMA
|
static String |
hIST
|
static String |
iCCP
|
static String |
IDAT
|
static String |
IEND
|
static String |
IHDR
|
static String |
iTXt
|
static String |
pHYs
|
static String |
PLTE
|
static String |
sBIT
|
static String |
sPLT
|
static String |
sRGB
|
static String |
tEXt
|
static String |
tIME
|
static String |
tRNS
|
static String |
zTXt
|
Constructor Summary | |
---|---|
ChunkHelper()
|
Method Summary | |
---|---|
static byte[] |
compressBytes(byte[] ori,
boolean compress)
|
static byte[] |
compressBytes(byte[] ori,
int offset,
int len,
boolean compress)
|
static boolean |
equivalent(PngChunk c1,
PngChunk c2)
MY adhoc criteria: two chunks are "equivalent" ("practically equal") if they have same id and (perhaps, if multiple are allowed) if the match also in some "internal key" (eg: key for string values, palette for sPLT, etc) Notice that the use of this is optional, and that the PNG standard allows Text chunks that have same key |
static List<PngChunk> |
filterList(List<PngChunk> target,
ChunkPredicate predicateKeep)
Returns only the chunks that "match" the predicate See also trimList() |
static boolean |
isCritical(String id)
critical chunk : first letter is uppercase |
static boolean |
isPublic(String id)
public chunk: second letter is uppercase |
static boolean |
isSafeToCopy(String id)
Safe to copy chunk: fourth letter is lower case |
static boolean |
isUnknown(PngChunk c)
"Unknown" just means that our chunk factory (even when it has been augmented by client code) did not recognize its id |
static boolean |
maskMatch(int v,
int mask)
|
static int |
posNullByte(byte[] b)
Finds position of null byte in array |
static boolean |
shouldLoad(String id,
ChunkLoadBehaviour behav)
Decides if a chunk should be loaded, according to a ChunkLoadBehaviour |
static byte[] |
toBytes(String x)
Converts to bytes using Latin1 (ISO-8859-1) |
static byte[] |
toBytesUTF8(String x)
Converts to bytes using UTF-8 |
static String |
toString(byte[] x)
Converts to String using Latin1 (ISO-8859-1) |
static String |
toString(byte[] x,
int offset,
int len)
Converts to String using Latin1 (ISO-8859-1) |
static String |
toStringUTF8(byte[] x)
Converts to string using UTF-8 |
static String |
toStringUTF8(byte[] x,
int offset,
int len)
Converts to string using UTF-8 |
static int |
trimList(List<PngChunk> target,
ChunkPredicate predicateRemove)
Remove (in place) the chunks that "match" the predicate See also filterList |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte[] b_IDAT
public static final byte[] b_IEND
public static final byte[] b_IHDR
public static final byte[] b_PLTE
public static final String bKGD
public static final String cHRM
public static final String gAMA
public static final String hIST
public static final String iCCP
public static final String IDAT
public static final String IEND
public static final String IHDR
public static final String iTXt
public static final String pHYs
public static final String PLTE
public static final String sBIT
public static final String sPLT
public static final String sRGB
public static final String tEXt
public static final String tIME
public static final String tRNS
public static final String zTXt
Constructor Detail |
---|
public ChunkHelper()
Method Detail |
---|
public static final byte[] compressBytes(byte[] ori, boolean compress)
public static byte[] compressBytes(byte[] ori, int offset, int len, boolean compress)
public static final boolean equivalent(PngChunk c1, PngChunk c2)
public static List<PngChunk> filterList(List<PngChunk> target, ChunkPredicate predicateKeep)
public static boolean isCritical(String id)
id
-
public static boolean isPublic(String id)
id
-
public static boolean isSafeToCopy(String id)
id
-
public static boolean isUnknown(PngChunk c)
c
- chunk
public static boolean maskMatch(int v, int mask)
public static int posNullByte(byte[] b)
b
-
public static boolean shouldLoad(String id, ChunkLoadBehaviour behav)
id
- behav
-
public static byte[] toBytes(String x)
x
-
public static byte[] toBytesUTF8(String x)
x
-
public static String toString(byte[] x)
x
-
public static String toString(byte[] x, int offset, int len)
x
- offset
- len
-
public static String toStringUTF8(byte[] x)
x
-
public static String toStringUTF8(byte[] x, int offset, int len)
x
- offset
- len
-
public static int trimList(List<PngChunk> target, ChunkPredicate predicateRemove)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |