use of com.android.assetstudiolib.GraphicGenerator in project android by JetBrains.
the class AndroidIconGenerator method generateIntoMemory.
/**
* Generate icons into a map in memory. This is useful for generating previews.
*
* {@link #sourceAsset()} must both be set prior to calling this method or an exception will be
* thrown.
*/
@NotNull
public final CategoryIconMap generateIntoMemory() {
if (!mySourceAsset.get().isPresent()) {
throw new IllegalStateException("Can't generate icons without a source asset set first");
}
final Map<String, Map<String, BufferedImage>> categoryMap = newAssetMap();
AssetStudioGraphicGeneratorContext context = new AssetStudioGraphicGeneratorContext();
GraphicGenerator graphicGenerator = createGenerator();
GraphicGenerator.Options options = createOptions(mySourceAsset.getValue());
graphicGenerator.generate(null, categoryMap, context, options, myName.get());
return new CategoryIconMap(categoryMap);
}
Aggregations