Skip to content

Commit

Permalink
Merge pull request #2 from CameraKit/v0.2.0
Browse files Browse the repository at this point in the history
v0.2.0
  • Loading branch information
Dylan McIntyre authored Aug 1, 2018
2 parents ed919be + d006e86 commit 9c79772
Show file tree
Hide file tree
Showing 31 changed files with 1,371 additions and 86 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This is all done without decoding the JPEG to RGB. All operations on the JPEG ar
Add __JpegKit__ to the dependencies block in your `app` level `build.gradle`:

```groovy
compile 'com.camerakit:jpegkit:0.0.1'
compile 'com.camerakit:jpegkit:0.2.0'
```

## Usage
Expand Down
8 changes: 8 additions & 0 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.4.1)

add_library(demo SHARED src/main/cpp/demo.cpp)

find_library(log-lib log)
find_library(android-lib android)

target_link_libraries(demo ${log-lib} ${android-lib})
32 changes: 26 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,37 @@
apply plugin: 'com.android.application'
plugins {
id 'com.android.application'
id 'kotlin-android'
}

android {
compileSdkVersion 26
compileSdkVersion = 28
buildToolsVersion = '28.0.0'
defaultConfig {
applicationId 'com.jpegkit.app'
applicationId 'jpegkit.app'
minSdkVersion 15
targetSdkVersion 26
targetSdkVersion 28
versionCode 1
versionName '0.1.0'
versionName '0.2.0'
externalNativeBuild {
cmake {
cppFlags ''
}
}
}
externalNativeBuild {
cmake {
path 'CMakeLists.txt'
}
}
}

repositories {
jcenter()
google()
}

dependencies {
implementation project(':jpegkit')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.50'
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
}
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jpegkit.app">
package="jpegkit.app">

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Expand Down
File renamed without changes
5 changes: 5 additions & 0 deletions app/src/main/cpp/demo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include <jni.h>

extern "C" JNIEXPORT void JNICALL
Java_com_jpegkit_app_MainActivity_init(JNIEnv *env, jobject obj) {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jpegkit.app;
package jpegkit.app;

import android.content.Context;
import android.content.DialogInterface;
Expand All @@ -21,8 +21,8 @@
import android.widget.TextView;
import android.widget.Toast;

import com.jpegkit.JpegFile;
import com.jpegkit.JpegImageView;
import jpegkit.JpegFile;
import jpegkit.JpegImageView;

import java.util.Set;
import java.util.TreeSet;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jpegkit.app;
package jpegkit.app;

import android.Manifest;
import android.content.Intent;
Expand All @@ -23,9 +23,9 @@
import android.widget.TextView;
import android.widget.Toast;

import com.jpegkit.Jpeg;
import com.jpegkit.JpegFile;
import com.jpegkit.JpegImageView;
import jpegkit.Jpeg;
import jpegkit.JpegFile;
import jpegkit.JpegImageView;

import java.io.File;
import java.io.FileOutputStream;
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_jpeg.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
android:layout_height="match_parent"
android:background="#EEEEEE">

<com.jpegkit.JpegImageView
<jpegkit.JpegImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/jpeg_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
android:layout_height="match_parent"
android:orientation="horizontal">

<com.jpegkit.JpegImageView
<jpegkit.JpegImageView
android:id="@+id/imageView"
android:layout_width="80dp"
android:layout_height="80dp"
Expand Down
20 changes: 2 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,10 @@
ext {
compileSdkVersion = 27
buildToolsVersion = '27.0.0'

minSdkVersion = 15
targetSdkVersion = 27
}


buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}


allprojects {
repositories {
google()
jcenter()
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.50'
}
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Jan 22 05:18:53 EST 2018
#Mon Jun 11 14:39:14 EDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
25 changes: 25 additions & 0 deletions jpegkit/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
cmake_minimum_required(VERSION 3.4.1)

include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/libjpeg/include)

add_library(libjpeg STATIC IMPORTED)
set_target_properties(
libjpeg
PROPERTIES
IMPORTED_LOCATION
${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libjpeg-turbo.a
)

include_directories(src/main/cpp/jpegkit/include)
file(GLOB SOURCES "src/main/cpp/jpegkit/*.cpp")
add_library(jpegkit SHARED ${SOURCES})

find_library(android-lib android)
find_library(gl-lib GLESv2)

target_link_libraries(
jpegkit
libjpeg
${android-lib}
${gl-lib}
)
31 changes: 21 additions & 10 deletions jpegkit/build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'com.jfrog.bintray' version '1.7.3'
id 'com.github.dcendents.android-maven' version '1.5'
}

apply plugin: 'com.android.library'

android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdkVersion = 28
buildToolsVersion = '28.0.0'
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
minSdkVersion 15
targetSdkVersion 28
externalNativeBuild {
cmake {
cppFlags ''
}
}
}
externalNativeBuild {
cmake {
path 'src/main/CMakeLists.txt'
path 'CMakeLists.txt'
}
}
}

repositories {
jcenter()
google()
}

dependencies {
implementation 'com.android.support:exifinterface:27.1.0'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.50'
implementation 'com.android.support:exifinterface:28.0.0-alpha3'
}

ext.getBintrayUser = { ->
Expand All @@ -30,7 +41,7 @@ ext.getBintrayUser = { ->

Properties properties = new Properties()
properties.load(rootProject.file('local.properties').newDataInputStream())
return properties.getProperty('bintray.user');
return properties.getProperty('bintray.user')
}

ext.getBintrayKey = { ->
Expand Down Expand Up @@ -100,7 +111,7 @@ task deployRelease {
}

group = 'com.camerakit'
version = '0.1.0'
version = '0.2.0'

install {
repositories.mavenInstaller {
Expand Down
13 changes: 0 additions & 13 deletions jpegkit/src/main/CMakeLists.txt

This file was deleted.

11 changes: 11 additions & 0 deletions jpegkit/src/main/cpp/jpegkit/include/platform.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef __JKUTILS_H__
#define __JKUTILS_H__

#include <jni.h>
#include <unistd.h>
#include <turbojpeg.h>
#include <GLES2/gl2.h>

typedef struct { unsigned char *bytes; } Allocation;

#endif
Loading

0 comments on commit 9c79772

Please sign in to comment.