Skip to content

Commit

Permalink
fix execute final step
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulTR committed Oct 24, 2023
1 parent 2935e39 commit f1461d6
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,22 @@ class ImageGenerationHelper(

fun execute(showResult: Boolean): Bitmap {
// Step 5 - generate with iterations
return Bitmap.createBitmap(256, 256, Bitmap.Config.ARGB_8888)
val result = imageGenerator.execute(showResult)

if (result == null || result.generatedImage() == null) {
return Bitmap.createBitmap(512, 512, Bitmap.Config.ARGB_8888)
.apply {
val canvas = Canvas(this)
val paint = Paint()
paint.color = Color.WHITE
canvas.drawPaint(paint)
}
}

val bitmap =
BitmapExtractor.extract(result.generatedImage())

return bitmap
}

fun close() {
Expand Down

0 comments on commit f1461d6

Please sign in to comment.