コード例 #1
0
  public final void makeUsing(final Bitmap aBitmap) {
    // #if DEBUG
    Assert.isFalse("not made", myHasTextureIdFlag);
    // #endif

    myWidth = aBitmap.getWidth();
    myHeight = aBitmap.getHeight();
    makeOpenglTexture(aBitmap);
  }
コード例 #2
0
  private void makeOpenglTexture(final Bitmap aBitmapARGB32) {
    myWidth = aBitmapARGB32.getWidth();
    myHeight = aBitmapARGB32.getHeight();

    myOglTextureId = myUtilities.makeNewOpenglTexture();
    myHasTextureIdFlag = true;

    myUtilities.setTexturePixels(aBitmapARGB32);
  }
コード例 #3
0
  private Bitmap makeProperBitmap(final Bitmap aBitmap, final int aWidth, final int aHeight) {
    final Bitmap bitmap = Bitmap.createBitmap(aWidth, aHeight, Bitmap.Config.ARGB_8888);
    myTextureCloneCanvas.setBitmap(bitmap);
    myTextureCloneCanvas.drawBitmap(aBitmap, 0, 0, myTextureClonePaint);

    // #if DEBUG
    Log.debug("created proper texture bitmap");
    Log.debug("bitmap size: {}x{}", aBitmap.getWidth(), aBitmap.getHeight());
    Log.debug("proper size: {}x{}", aWidth, aHeight);
    // #endif

    return bitmap;
  }
コード例 #4
0
 public final void makeUsing(
     final Bitmap aOriginalBitmap, final int aProperWidth, final int aProperHeight) {
   final Bitmap bitmap = makeProperBitmap(aOriginalBitmap, aProperWidth, aProperHeight);
   makeUsing(bitmap);
   bitmap.recycle();
 }