Třída generující štětce.
More...
|
static NBitmap | createRoundBrush (int size, double hardness, Depth depth) throws UnsupportedBitmapException, BitmapAllocationException |
| Vytvoří kulatý štětec o zadaných parametrech, pokud neuspěje, hodí výjimku.
|
|
static int | createRoundBrushIn (NBitmap dst, int size, double hardness) |
|
|
static native long | createRoundBrush (int nativeType, int size, double hardness) |
| JNI metoda.
|
|
static native int | createRoundBrushIn (int nativeType, long dstAdress, int size, double hardness) |
|
Třída generující štětce.
Definition at line 15 of file BrushGenerator.java.
mhr.appcore.generators.BrushGenerator.BrushGenerator |
( |
| ) |
|
|
inlineprotected |
static native long mhr.appcore.generators.BrushGenerator.createRoundBrush |
( |
int |
nativeType, |
|
|
int |
size, |
|
|
double |
hardness |
|
) |
| |
|
staticprotected |
Vytvoří kulatý štětec o zadaných parametrech, pokud neuspěje, hodí výjimku.
- Parameters
-
size | Průměr štětce v px. |
hardness | Tvrdost štětce 0..1 |
depth | Hloubka výsledné bitmapy |
- Returns
- Jednokanálová bitmapa obsahující štětec.
- Exceptions
-
UnsupportedBitmapException | |
BitmapAllocationException | |
Definition at line 43 of file BrushGenerator.java.
{
BitmapInfo info =
new BitmapInfo(size, size, ChannelCount.SINGLE_CHANNEL, depth,
ColorMode.MONO,
false);
NativeType type = info.getNativeType();
if (type == NativeType.INVALID_TYPE) {
throw new UnsupportedBitmapException("Requested bitmap type is not supported.");
}
if (adress == 0) {
throw new BitmapAllocationException("Could allocate bitmap");
}
return new NBitmap(adress, info);
}
static native int mhr.appcore.generators.BrushGenerator.createRoundBrushIn |
( |
int |
nativeType, |
|
|
long |
dstAdress, |
|
|
int |
size, |
|
|
double |
hardness |
|
) |
| |
|
staticprotected |
static int mhr.appcore.generators.BrushGenerator.createRoundBrushIn |
( |
NBitmap |
dst, |
|
|
int |
size, |
|
|
double |
hardness |
|
) |
| |
|
inlinestatic |
Definition at line 57 of file BrushGenerator.java.
{
BitmapInfo info = dst.getInfo();
if (info.channelCount != ChannelCount.SINGLE_CHANNEL) {
throw new IllegalArgumentException("Brush must be created in single channel bitmap.");
}
long adress = dst.getAdress();
if (adress == 0) {
throw new IllegalStateException("Bitmap is already disposed.");
}
}
The documentation for this class was generated from the following file: