Skip to content

Commit

Permalink
for Jitpack
Browse files Browse the repository at this point in the history
  • Loading branch information
xyzxqs committed Oct 2, 2016
1 parent 46b2e79 commit 3e161a3
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'

classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
36 changes: 35 additions & 1 deletion xlowpoly/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'

group='io.github.xyzxqs'

android {
compileSdkVersion 24
Expand All @@ -8,7 +11,7 @@ android {
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
versionName "1.0.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

Expand Down Expand Up @@ -41,3 +44,34 @@ dependencies {
compile 'com.android.support:appcompat-v7:24.2.1'
testCompile 'junit:junit:4.12'
}

///////////////////

// 指定编码
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}

// 打包源码
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

task javadoc(type: Javadoc) {
failOnError false
source = android.sourceSets.main.java.sourceFiles
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += configurations.compile
}

// 制作文档(Javadoc)
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives sourcesJar
archives javadocJar
}
14 changes: 14 additions & 0 deletions xlowpoly/src/main/java/io/github/xyzxqs/xlowpoly/LowPoly.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,24 @@ private LowPoly() {
throw new IllegalStateException("no instance!");
}

/**
* generate lowpoly picture
* @param input src Bitmap
* @param alphaOrPointCount (0.0~1) or [1,max)
* @param fill fill ? Paint.Style.FILL : Paint.Style.STROKE
* @return out Bitmap
*/
public static Bitmap lowPoly(Bitmap input, float alphaOrPointCount, boolean fill) {
return generate(input, 50, alphaOrPointCount, true, fill);
}

/**
* generate sandpainting
* @param input src Bitmap
* @param threshold recommend(30,90)
* @param alphaOrPointCount (0.0,1) or [1,max)
* @return out Bitmap
*/
public static Bitmap sandPainting(Bitmap input, int threshold, float alphaOrPointCount) {
return generate(input, threshold, alphaOrPointCount, false, false);
}
Expand Down

0 comments on commit 3e161a3

Please sign in to comment.