App

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
mhr.appandroid.adapters.APDBitmap Class Reference

Android Platform Dependent Bitmap. More...

Inheritance diagram for mhr.appandroid.adapters.APDBitmap:

## Public Member Functions
| APDBitmap ()
| Defaultní konstruktor, vytvoří napleatnou instanci.
| APDBitmap (Bitmap bitmap)
| Vytvoří instanci okolo Androidí bitmapy.
| APDBitmap (BitmapInfo info) throws UnsupportedBitmapException
| Vytvoří objekt tak, aby odpocídal dané specifikaci.
Bitmap | getBitmap ()
| Vrátí Androidí bitmapu, na které je založená.
void | setBitmap (Bitmap bitmap)
| Nastaví Androidí bitmapu.
long | getAndLockData () throws NullPointerException
| Zpřístupní data bitmapy a vrátí jejich adresu v paměti.
int | unlockData () throws NullPointerException
| Voláno v okamžiku, kdy již aplikace dopracovala s daty bitmapy.
BitmapInfo | getInfo () throws UnsupportedBitmapException, NullPointerException
| Vrací informace o bitmapě.
PDBitmap | makeCopy ()
| Vytvoří kopii bitmapy.
void | dispose ()
PDBitmap | createBitmap (BitmapInfo i) throws UnsupportedBitmapException

## Static Protected Member Functions
static native long | getAndLockData (Object bitmap)
| Získá a zamkne adresu bitmapy.
static native int | unlockData (Object bitmap)
| Uvolní bitmapu, jak vyžaduje API v <android/bitmap.h>

## Protected Attributes
Bitmap | bitmap = null

## Detailed Description

Android Platform Dependent Bitmap.

Definition at line 14 of file APDBitmap.java.

## Constructor & Destructor Documentation

mhr.appandroid.adapters.APDBitmap.APDBitmap | ( |  | ) |
| inline

Defaultní konstruktor, vytvoří napleatnou instanci.

Definition at line 32 of file APDBitmap.java.

{
}

mhr.appandroid.adapters.APDBitmap.APDBitmap | ( | Bitmap | bitmap | ) |
| inline

Vytvoří instanci okolo Androidí bitmapy.

Parameters

  bitmap |

Definition at line 39 of file APDBitmap.java.

{
this.bitmap = bitmap;
}

mhr.appandroid.adapters.APDBitmap.APDBitmap | ( | BitmapInfo | info | ) | throws UnsupportedBitmapException
| inline

Vytvoří objekt tak, aby odpocídal dané specifikaci.

Parameters

  info |

Definition at line 47 of file APDBitmap.java.

{
if (info.channelCount == ChannelCount.SINGLE_CHANNEL && info.depth == Depth.DEPTH_8_BIT) {
this.bitmap = Bitmap.createBitmap(info.width, info.height, Bitmap.Config.ALPHA_8);
} else if (info.channelCount == ChannelCount.FOUR_CHANNEL && info.depth == Depth.DEPTH_8_BIT) {
this.bitmap = Bitmap.createBitmap(info.width, info.height, Bitmap.Config.ARGB_8888);
} else {
throw new UnsupportedBitmapException("Could not create bitmap with supplied parameters");
}
}

## Member Function Documentation

PDBitmap mhr.appandroid.adapters.APDBitmap.createBitmap | ( | BitmapInfo | i | ) | throws UnsupportedBitmapException
| inline

Implements mhr.appcore.interfaces.PDBitmap.

Definition at line 148 of file APDBitmap.java.

{
return new APDBitmap(i);
}

void mhr.appandroid.adapters.APDBitmap.dispose | ( |  | ) |
| inline

Implements mhr.appcore.interfaces.PDBitmap.

Definition at line 142 of file APDBitmap.java.

{
bitmap.recycle();
}

static native long mhr.appandroid.adapters.APDBitmap.getAndLockData | ( | Object | bitmap | ) |
| staticprotected

Získá a zamkne adresu bitmapy.

Parameters

  bitmap | Bitmapa

Returns
  Vrací adresu dat, případně NULL jako 0x0.

long mhr.appandroid.adapters.APDBitmap.getAndLockData | ( |  | ) | throws NullPointerException
| inline

Zpřístupní data bitmapy a vrátí jejich adresu v paměti.

Returns
  Adresa dat v paměti, null (0x0) při neúspěchu.

Implements mhr.appcore.interfaces.PDBitmap.

Definition at line 93 of file APDBitmap.java.

{
if (bitmap == null) {
throw new NullPointerException();
}
return APDBitmap.getAndLockData(bitmap);
}

Bitmap mhr.appandroid.adapters.APDBitmap.getBitmap | ( |  | ) |
| inline

Vrátí Androidí bitmapu, na které je založená.

Returns

Definition at line 80 of file APDBitmap.java.

{
return bitmap;
}

BitmapInfo mhr.appandroid.adapters.APDBitmap.getInfo | ( |  | ) | throws UnsupportedBitmapException, NullPointerException
| inline

Vrací informace o bitmapě.

Returns
  Info o bitmapě, pokud není typ podporován tak hodí výjimku.

Implements mhr.appcore.interfaces.PDBitmap.

Definition at line 109 of file APDBitmap.java.

{
BitmapInfo retVal = new BitmapInfo();
retVal.width = bitmap.getWidth();
retVal.height = bitmap.getHeight();
retVal.premultiplied = true; // tohle nelze zjisit, až v API 17
Bitmap.Config config = bitmap.getConfig();
if (config != null) {
switch (config) {
case ARGB_8888:
retVal.depth = Depth.DEPTH_8_BIT;
retVal.channelCount = ChannelCount.FOUR_CHANNEL;
retVal.colorMode = ColorMode.RGBA;
break;
case ALPHA_8:
retVal.depth = Depth.DEPTH_8_BIT;
retVal.channelCount = ChannelCount.SINGLE_CHANNEL;
retVal.colorMode = ColorMode.MONO;
break;
default:
throw new UnsupportedBitmapException("Bitmap type is not supported");
}
} else {
throw new NullPointerException();
}
return retVal;
}

PDBitmap mhr.appandroid.adapters.APDBitmap.makeCopy | ( |  | ) |
| inline

Vytvoří kopii bitmapy.

Returns

Implements mhr.appcore.interfaces.PDBitmap.

Definition at line 137 of file APDBitmap.java.

{
return new APDBitmap(bitmap.copy(bitmap.getConfig(), false));
}

void mhr.appandroid.adapters.APDBitmap.setBitmap | ( | Bitmap | bitmap | ) |
| inline

Nastaví Androidí bitmapu.

Parameters

  bitmap |

Definition at line 88 of file APDBitmap.java.

{
this.bitmap = bitmap;
}

static native int mhr.appandroid.adapters.APDBitmap.unlockData | ( | Object | bitmap | ) |
| staticprotected

Uvolní bitmapu, jak vyžaduje API v <android/bitmap.h>

Parameters

  bitmap | Bitmapa

Returns
  vrací návratovou hodntou AndroidBitmap_unlockPixels()

int mhr.appandroid.adapters.APDBitmap.unlockData | ( |  | ) | throws NullPointerException
| inline

Voláno v okamžiku, kdy již aplikace dopracovala s daty bitmapy.

Returns
  0 v případě úspěchu.

Implements mhr.appcore.interfaces.PDBitmap.

Definition at line 101 of file APDBitmap.java.

{
if (bitmap == null) {
throw new NullPointerException();
}
return APDBitmap.unlockData(bitmap);
}

## Member Data Documentation

Bitmap mhr.appandroid.adapters.APDBitmap.bitmap = null
| protected

Definition at line 22 of file APDBitmap.java.

The documentation for this class was generated from the following file:

- /home/xxx/eclipse_workspaces/app/appandroid/src/mhr/appandroid/adapters/APDBitmap.java