Streamline the BufferedImage functionality in the compressor so that it works the same way as compressing a "normal" image, and deprecate the old BufferedImage methods and other redundant methods. Eliminate the use of deprecated features in the test programs.

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1168 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
DRC
2014-03-14 08:53:33 +00:00
parent 9537c80920
commit d657ebcc92
7 changed files with 373 additions and 307 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C)2011-2012 D. R. Commander. All Rights Reserved.
* Copyright (C)2011-2012, 2014 D. R. Commander. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -324,11 +324,11 @@ public class TJExample implements TJCustomFilter {
tjc.setSubsamp(outSubsamp);
tjc.setJPEGQuality(outQual);
if (img != null)
jpegBuf = tjc.compress(img, flags);
tjc.setSourceImage(img, 0, 0, 0, 0);
else {
tjc.setSourceImage(bmpBuf, width, 0, height, TJ.PF_BGRX);
jpegBuf = tjc.compress(flags);
tjc.setSourceImage(bmpBuf, 0, 0, width, 0, height, TJ.PF_BGRX);
}
jpegBuf = tjc.compress(flags);
jpegSize = tjc.getCompressedSize();
tjc.close();