Atlaspublic class Atlas extends Object
Fields Summary |
---|
public static final int | FLAG_ALLOW_ROTATIONSThis flag indicates whether the packing algorithm will attempt
to rotate entries to make them fit better in the atlas. | public static final int | FLAG_ADD_PADDINGThis flag indicates whether the packing algorithm should leave
an empty 1 pixel wide border around each bitmap. This border can
be useful if the content of the atlas will be used in OpenGL using
bilinear filtering. | public static final int | FLAG_DEFAULTSDefault flags: allow rotations and add padding. | private final Policy | mPolicy |
Constructors Summary |
---|
public Atlas(Type type, int width, int height)Creates a new atlas with the specified algorithm and dimensions
in pixels. Calling this constructor is equivalent to calling
{@link #Atlas(Atlas.Type, int, int, int)} with {@link #FLAG_DEFAULTS}.
this(type, width, height, FLAG_DEFAULTS);
| public Atlas(Type type, int width, int height, int flags)Creates a new atlas with the specified algorithm and dimensions
in pixels. A set of flags can also be specified to control the
behavior of the atlas.
mPolicy = findPolicy(type, width, height, flags);
|
Methods Summary |
---|
private static android.graphics.Atlas$Policy | findPolicy(android.graphics.Atlas$Type type, int width, int height, int flags)
switch (type) {
case SliceMinArea:
return new SlicePolicy(width, height, flags,
new SlicePolicy.MinAreaSplitDecision());
case SliceMaxArea:
return new SlicePolicy(width, height, flags,
new SlicePolicy.MaxAreaSplitDecision());
case SliceShortAxis:
return new SlicePolicy(width, height, flags,
new SlicePolicy.ShorterFreeAxisSplitDecision());
case SliceLongAxis:
return new SlicePolicy(width, height, flags,
new SlicePolicy.LongerFreeAxisSplitDecision());
}
return null;
| public android.graphics.Atlas$Entry | pack(int width, int height)Packs a rectangle of the specified dimensions in this atlas.
return pack(width, height, null);
| public android.graphics.Atlas$Entry | pack(int width, int height, android.graphics.Atlas$Entry entry)Packs a rectangle of the specified dimensions in this atlas.
if (entry == null) entry = new Entry();
return mPolicy.pack(width, height, entry);
|
|