Skip to content

Commit

Permalink
* Fix Java2DFrameConverter when used with `BufferedImage.TYPE_INT_…
Browse files Browse the repository at this point in the history
…RGB` or other types based on `int`
  • Loading branch information
saudet committed Apr 26, 2015
1 parent c8eb892 commit 918c754
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

* Fix `Java2DFrameConverter` when used with `BufferedImage.TYPE_INT_RGB` or other types based on `int`
* Add new `WebcamAndMicrophoneCapture` sample ([pull #131](https://github.com/bytedeco/javacv/pull/131))
* Add `aspectRatio` property to `FrameGrabber` and `FrameRecorder`, to be able to use pixel aspect ratios other than 1.0 ([issue #90](https://github.com/bytedeco/javacv/issues/90))

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/bytedeco/javacv/Java2DFrameConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,9 @@ public static void copy(BufferedImage image, Frame frame, double gamma, boolean
flipCopyWithGamma(FloatBuffer.wrap(a, start, a.length - start), step, (FloatBuffer)out, frame.imageStride, gamma, false, flipChannels ? channels : 0);
} else if (in instanceof DataBufferInt) {
int[] a = ((DataBufferInt)in).getData();
if (out instanceof ByteBuffer) {
out = ((ByteBuffer)out).asIntBuffer();
}
flipCopyWithGamma(IntBuffer.wrap(a, start, a.length - start), step, (IntBuffer)out, frame.imageStride, gamma, false, flipChannels ? channels : 0);
} else if (in instanceof DataBufferShort) {
short[] a = ((DataBufferShort)in).getData();
Expand Down

0 comments on commit 918c754

Please sign in to comment.