mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-05 04:25:29 -04:00
#573: Better naming: LuminanceToGray
This commit is contained in:
parent
b4ef5823f3
commit
bd796429c5
@ -421,7 +421,7 @@ public final class JPEGImageReader extends ImageReaderBase {
|
|||||||
ICC_ColorSpace intendedCS = profile != null ? ColorSpaces.createColorSpace(profile) : null;
|
ICC_ColorSpace intendedCS = profile != null ? ColorSpaces.createColorSpace(profile) : null;
|
||||||
|
|
||||||
if (destination.getNumBands() <= 2 && (csType != JPEGColorSpace.Gray && csType != JPEGColorSpace.GrayA)) {
|
if (destination.getNumBands() <= 2 && (csType != JPEGColorSpace.Gray && csType != JPEGColorSpace.GrayA)) {
|
||||||
convert = new LumaToGray();
|
convert = new LuminanceToGray();
|
||||||
}
|
}
|
||||||
else if (profile != null && (csType == JPEGColorSpace.Gray || csType == JPEGColorSpace.GrayA)) {
|
else if (profile != null && (csType == JPEGColorSpace.Gray || csType == JPEGColorSpace.GrayA)) {
|
||||||
// com.sun. reader does not do ColorConvertOp for CS_GRAY, even if embedded ICC profile,
|
// com.sun. reader does not do ColorConvertOp for CS_GRAY, even if embedded ICC profile,
|
||||||
|
@ -16,7 +16,7 @@ import java.awt.image.WritableRaster;
|
|||||||
* @author last modified by $Author: haraldk$
|
* @author last modified by $Author: haraldk$
|
||||||
* @version $Id: LumaToGray.java,v 1.0 10/04/2021 haraldk Exp$
|
* @version $Id: LumaToGray.java,v 1.0 10/04/2021 haraldk Exp$
|
||||||
*/
|
*/
|
||||||
final class LumaToGray implements RasterOp {
|
final class LuminanceToGray implements RasterOp {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WritableRaster filter(final Raster src, WritableRaster dest) {
|
public WritableRaster filter(final Raster src, WritableRaster dest) {
|
@ -16,10 +16,10 @@ import static org.junit.Assert.*;
|
|||||||
* @author last modified by $Author: haraldk$
|
* @author last modified by $Author: haraldk$
|
||||||
* @version $Id: LumaToGrayTest.java,v 1.0 10/04/2021 haraldk Exp$
|
* @version $Id: LumaToGrayTest.java,v 1.0 10/04/2021 haraldk Exp$
|
||||||
*/
|
*/
|
||||||
public class LumaToGrayTest {
|
public class LuminanceToGrayTest {
|
||||||
@Test
|
@Test
|
||||||
public void testConvertByteYcc() {
|
public void testConvertByteYcc() {
|
||||||
LumaToGray convert = new LumaToGray();
|
LuminanceToGray convert = new LuminanceToGray();
|
||||||
|
|
||||||
WritableRaster input = Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE, 1, 1, 3, null);
|
WritableRaster input = Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE, 1, 1, 3, null);
|
||||||
WritableRaster result = null;
|
WritableRaster result = null;
|
||||||
@ -39,7 +39,7 @@ public class LumaToGrayTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testConvertByteYccK() {
|
public void testConvertByteYccK() {
|
||||||
LumaToGray convert = new LumaToGray();
|
LuminanceToGray convert = new LuminanceToGray();
|
||||||
|
|
||||||
WritableRaster input = Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE, 1, 1, 4, null);
|
WritableRaster input = Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE, 1, 1, 4, null);
|
||||||
WritableRaster result = null;
|
WritableRaster result = null;
|
||||||
@ -59,7 +59,7 @@ public class LumaToGrayTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testConvertByteYccA() {
|
public void testConvertByteYccA() {
|
||||||
LumaToGray convert = new LumaToGray();
|
LuminanceToGray convert = new LuminanceToGray();
|
||||||
|
|
||||||
WritableRaster input = Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE, 1, 1, 4, null);
|
WritableRaster input = Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE, 1, 1, 4, null);
|
||||||
WritableRaster result = Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE, 1, 1, 2, null);
|
WritableRaster result = Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE, 1, 1, 2, null);
|
Loading…
x
Reference in New Issue
Block a user