src/share/classes/javax/imageio/plugins/jpeg/JPEGImageWriteParam.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 165,175 ****
}
if ((getCompressionTypes() != null) &&
(getCompressionType() == null)) {
throw new IllegalStateException("No compression type set!");
}
! return (String[])qualityDescs.clone();
}
public float[] getCompressionQualityValues() {
if (getCompressionMode() != MODE_EXPLICIT) {
throw new IllegalStateException
--- 165,175 ----
}
if ((getCompressionTypes() != null) &&
(getCompressionType() == null)) {
throw new IllegalStateException("No compression type set!");
}
! return qualityDescs.clone();
}
public float[] getCompressionQualityValues() {
if (getCompressionMode() != MODE_EXPLICIT) {
throw new IllegalStateException
*** 177,187 ****
}
if ((getCompressionTypes() != null) &&
(getCompressionType() == null)) {
throw new IllegalStateException("No compression type set!");
}
! return (float[])qualityVals.clone();
}
/**
* Returns <code>true</code> if tables are currently set.
*
* @return <code>true</code> if tables are present.
--- 177,187 ----
}
if ((getCompressionTypes() != null) &&
(getCompressionType() == null)) {
throw new IllegalStateException("No compression type set!");
}
! return qualityVals.clone();
}
/**
* Returns <code>true</code> if tables are currently set.
*
* @return <code>true</code> if tables are present.
*** 220,232 ****
(DCHuffmanTables.length > 4) ||
(ACHuffmanTables.length > 4) ||
(DCHuffmanTables.length != ACHuffmanTables.length)) {
throw new IllegalArgumentException("Invalid JPEG table arrays");
}
! this.qTables = (JPEGQTable[])qTables.clone();
! this.DCHuffmanTables = (JPEGHuffmanTable[])DCHuffmanTables.clone();
! this.ACHuffmanTables = (JPEGHuffmanTable[])ACHuffmanTables.clone();
}
/**
* Removes any quantization and Huffman tables that are currently
* set.
--- 220,232 ----
(DCHuffmanTables.length > 4) ||
(ACHuffmanTables.length > 4) ||
(DCHuffmanTables.length != ACHuffmanTables.length)) {
throw new IllegalArgumentException("Invalid JPEG table arrays");
}
! this.qTables = qTables.clone();
! this.DCHuffmanTables = DCHuffmanTables.clone();
! this.ACHuffmanTables = ACHuffmanTables.clone();
}
/**
* Removes any quantization and Huffman tables that are currently
* set.
*** 248,258 ****
* <code>null</code>.
*
* @see #setEncodeTables
*/
public JPEGQTable[] getQTables() {
! return (qTables != null) ? (JPEGQTable[])qTables.clone() : null;
}
/**
* Returns a copy of the array of DC Huffman tables set on the
* most recent call to <code>setEncodeTables</code>, or
--- 248,258 ----
* <code>null</code>.
*
* @see #setEncodeTables
*/
public JPEGQTable[] getQTables() {
! return (qTables != null) ? qTables.clone() : null;
}
/**
* Returns a copy of the array of DC Huffman tables set on the
* most recent call to <code>setEncodeTables</code>, or
*** 263,273 ****
*
* @see #setEncodeTables
*/
public JPEGHuffmanTable[] getDCHuffmanTables() {
return (DCHuffmanTables != null)
! ? (JPEGHuffmanTable[])DCHuffmanTables.clone()
: null;
}
/**
* Returns a copy of the array of AC Huffman tables set on the
--- 263,273 ----
*
* @see #setEncodeTables
*/
public JPEGHuffmanTable[] getDCHuffmanTables() {
return (DCHuffmanTables != null)
! ? DCHuffmanTables.clone()
: null;
}
/**
* Returns a copy of the array of AC Huffman tables set on the
*** 279,289 ****
*
* @see #setEncodeTables
*/
public JPEGHuffmanTable[] getACHuffmanTables() {
return (ACHuffmanTables != null)
! ? (JPEGHuffmanTable[])ACHuffmanTables.clone()
: null;
}
/**
* Tells the writer to generate optimized Huffman tables
--- 279,289 ----
*
* @see #setEncodeTables
*/
public JPEGHuffmanTable[] getACHuffmanTables() {
return (ACHuffmanTables != null)
! ? ACHuffmanTables.clone()
: null;
}
/**
* Tells the writer to generate optimized Huffman tables