You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+56-14Lines changed: 56 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,63 +27,95 @@ JpegKit bridges the libjpeg-turbo C++ library into android and wraps it with an
27
27
28
28
This is all done without decoding the JPEG to RGB. All operations on the JPEG are done in C++ space and does not touch the Java memory, allowing you to work with extremely large JPEGs without the risk of an `OutOfMemoryException`.
29
29
30
+
## The State Of The Union
31
+
We've been working on a major update to the JpegKit project that we will dub `v0.3.0`. This release separates concerns away from the single Jpeg class to several classes, each handling different functions of JpegKit.
32
+
33
+
In a previous release we deprecated the Jpeg class with the intention of having the new functionality ready for the spotlight.
34
+
35
+
However we discovered some bugs and issues after the initial release. Until `v0.3.0` is finalized, we've un-deprecated that Jpeg class and its other supporting classes. Below is the intended Setup and Usage for `v0.2.2`.
36
+
30
37
## Setup
31
38
Add __JpegKit__ to the dependencies block in your `app` level `build.gradle`:
32
39
33
40
```groovy
34
-
compile 'com.camerakit:jpegkit:0.2.1'
41
+
compile 'com.camerakit:jpegkit:0.2.2'
35
42
```
36
43
37
44
## Usage
38
45
39
-
JpegKit currently expects a JPEG parameter in the form of a `byte[]`. In the future you'll be able to just pass a file.
46
+
The core of JpegKit is the Jpeg class. When creating an object of type `Jpeg`, the constructor expects a `byte[]`. In the future you'll be able to pass just a file.
One can then transform this Jpeg object with the transformations listed in the **Transformations** section below.
61
+
62
+
63
+
### Jpeg result
48
64
After you perform your transformations, you can get a new JPEG `byte[]` back:
49
65
50
66
```java
51
-
byte[] newJpeg=jpegTransformer.getJpeg();
67
+
byte[] newJpegBytes=mJpeg.getJpeg();
52
68
```
53
69
54
70
The `getJpeg()` call can only be used once. At this point our C++ libjpeg-turbo wrapper encodes the new JPEG and also disposes of the original and clears any other memory it used.
55
71
56
72
Transformations are performed in C++ right when you make the method call, as opposed to doing all after you finish with `getJpeg()`. The transformations will be applied in the order you make the method calls.
57
73
58
-
### MetaData
74
+
## JpegImageView
75
+
76
+
`JpegImageView` is a view to display JpegKit's `Jpeg` objects.
77
+
78
+
Create a `JpegImageView` in **xml** as follows.
59
79
60
-
You can currently retrieve a JPEGs width and height. This only decodes the JPEGs header information and is very fast.
80
+
```xml
81
+
<jpegkit.JpegImageView
82
+
android:id="@+id/jpegView"
83
+
android:layout_width="200dp"
84
+
android:layout_height="200dp" />
85
+
```
86
+
87
+
Access and set the JPEG from your Activity as follows.
0 commit comments