|
||||||||
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 java.lang.String |
bKGD
|
static java.lang.String |
cHRM
|
static java.lang.String |
gAMA
|
static java.lang.String |
hIST
|
static java.lang.String |
iCCP
|
static java.lang.String |
IDAT
|
static java.lang.String |
IEND
|
static java.lang.String |
IHDR
|
static java.lang.String |
iTXt
|
static java.lang.String |
pHYs
|
static java.lang.String |
PLTE
|
static java.lang.String |
sBIT
|
static java.lang.String |
sPLT
|
static java.lang.String |
sRGB
|
static java.lang.String |
tEXt
|
static java.lang.String |
tIME
|
static java.lang.String |
tRNS
|
static java.lang.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 java.util.List<PngChunk> |
filterList(java.util.List<PngChunk> target,
ChunkPredicate predicateKeep)
Returns only the chunks that "match" the predicate See also trimList() |
static boolean |
isCritical(java.lang.String id)
critical chunk : first letter is uppercase |
static boolean |
isPublic(java.lang.String id)
public chunk: second letter is uppercase |
static boolean |
isSafeToCopy(java.lang.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(java.lang.String id,
ChunkLoadBehaviour behav)
Decides if a chunk should be loaded, according to a ChunkLoadBehaviour |
static byte[] |
toBytes(java.lang.String x)
Converts to bytes using Latin1 (ISO-8859-1) |
static byte[] |
toBytesUTF8(java.lang.String x)
Converts to bytes using UTF-8 |
static java.lang.String |
toString(byte[] x)
Converts to String using Latin1 (ISO-8859-1) |
static java.lang.String |
toString(byte[] x,
int offset,
int len)
Converts to String using Latin1 (ISO-8859-1) |
static java.lang.String |
toStringUTF8(byte[] x)
Converts to string using UTF-8 |
static java.lang.String |
toStringUTF8(byte[] x,
int offset,
int len)
Converts to string using UTF-8 |
static int |
trimList(java.util.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 java.lang.String bKGD
public static final java.lang.String cHRM
public static final java.lang.String gAMA
public static final java.lang.String hIST
public static final java.lang.String iCCP
public static final java.lang.String IDAT
public static final java.lang.String IEND
public static final java.lang.String IHDR
public static final java.lang.String iTXt
public static final java.lang.String pHYs
public static final java.lang.String PLTE
public static final java.lang.String sBIT
public static final java.lang.String sPLT
public static final java.lang.String sRGB
public static final java.lang.String tEXt
public static final java.lang.String tIME
public static final java.lang.String tRNS
public static final java.lang.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 java.util.List<PngChunk> filterList(java.util.List<PngChunk> target, ChunkPredicate predicateKeep)
public static boolean isCritical(java.lang.String id)
id
-
public static boolean isPublic(java.lang.String id)
id
-
public static boolean isSafeToCopy(java.lang.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(java.lang.String id, ChunkLoadBehaviour behav)
id
- behav
-
public static byte[] toBytes(java.lang.String x)
x
-
public static byte[] toBytesUTF8(java.lang.String x)
x
-
public static java.lang.String toString(byte[] x)
x
-
public static java.lang.String toString(byte[] x, int offset, int len)
x
- offset
- len
-
public static java.lang.String toStringUTF8(byte[] x)
x
-
public static java.lang.String toStringUTF8(byte[] x, int offset, int len)
x
- offset
- len
-
public static int trimList(java.util.List<PngChunk> target, ChunkPredicate predicateRemove)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |