App
Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
mhr.appcore.generators.BrushGenerator Class Reference

Třída generující štětce. More...

Static Public Member Functions

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)
 

Protected Member Functions

 BrushGenerator ()
 

Static Protected Member Functions

static native long createRoundBrush (int nativeType, int size, double hardness)
 JNI metoda.
 
static native int createRoundBrushIn (int nativeType, long dstAdress, int size, double hardness)
 

Detailed Description

Třída generující štětce.

Definition at line 15 of file BrushGenerator.java.

Constructor & Destructor Documentation

mhr.appcore.generators.BrushGenerator.BrushGenerator ( )
inlineprotected

Defultní konstruktor, třída je statická.

Definition at line 30 of file BrushGenerator.java.

{}

Member Function Documentation

static native long mhr.appcore.generators.BrushGenerator.createRoundBrush ( int  nativeType,
int  size,
double  hardness 
)
staticprotected

JNI metoda.

static NBitmap mhr.appcore.generators.BrushGenerator.createRoundBrush ( int  size,
double  hardness,
Depth  depth 
) throws UnsupportedBitmapException, BitmapAllocationException
inlinestatic

Vytvoří kulatý štětec o zadaných parametrech, pokud neuspěje, hodí výjimku.

Parameters
sizePrůměr štětce v px.
hardnessTvrdost štětce 0..1
depthHloubka 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.");
}
long adress = createRoundBrush(type.getValue(), size, hardness);
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.");
}
return createRoundBrushIn(info.getNativeType().getValue(), adress, size, hardness);
}

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