/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
class LCMSImageLayout {
public static int BYTES_SH(int x) {
return x;
}
public static int EXTRA_SH(int x) {
return x<<7;
}
public static int CHANNELS_SH(int x) {
return x<<3;
}
public static final int PT_RGB_8 =
public static final int PT_GRAY_8 =
public static final int PT_GRAY_16 =
public static final int PT_RGBA_8 =
public static final int PT_ARGB_8 =
public static final int PT_BGR_8 =
public static final int PT_ABGR_8 =
boolean isIntPacked = false;
int pixelType;
int dataType;
int width;
int height;
int nextRowOffset;
private int nextPixelOffset;
int offset;
throws ImageLayoutException
{
height = 1;
offset = 0;
}
int pixelSize)
throws ImageLayoutException
{
offset = 0;
}
throws ImageLayoutException
{
verify();
}
throws ImageLayoutException
{
verify();
}
throws ImageLayoutException
{
verify();
}
throws ImageLayoutException
{
verify();
}
case BufferedImage.TYPE_INT_RGB:
isIntPacked = true;
break;
case BufferedImage.TYPE_INT_ARGB:
isIntPacked = true;
break;
case BufferedImage.TYPE_INT_BGR:
isIntPacked = true;
break;
case BufferedImage.TYPE_3BYTE_BGR:
break;
case BufferedImage.TYPE_4BYTE_ABGR:
break;
case BufferedImage.TYPE_BYTE_GRAY:
break;
break;
default:
// TODO: Add support for some images having
// SinglePixelPackedModel and ComponentSampleModel
throw new IllegalArgumentException(
"CMMImageLayout - bad image type passed to constructor");
}
case BufferedImage.TYPE_INT_RGB:
case BufferedImage.TYPE_INT_ARGB:
case BufferedImage.TYPE_INT_BGR:
break;
case BufferedImage.TYPE_3BYTE_BGR:
case BufferedImage.TYPE_4BYTE_ABGR:
break;
case BufferedImage.TYPE_BYTE_GRAY:
break;
break;
}
verify();
}
case BufferedImage.TYPE_INT_RGB:
case BufferedImage.TYPE_INT_ARGB:
case BufferedImage.TYPE_INT_BGR:
case BufferedImage.TYPE_3BYTE_BGR:
case BufferedImage.TYPE_4BYTE_ABGR:
case BufferedImage.TYPE_BYTE_GRAY:
return true;
}
return false;
}
throw new ImageLayoutException("Invalid image layout");
}
throw new ImageLayoutException("Invalid image layout");
}
throw new ImageLayoutException("Invalid image layout");
}
}
long res = a;
res += b;
throw new ImageLayoutException("Invalid image layout");
}
return (int)res;
}
long res = a;
res *= b;
throw new ImageLayoutException("Invalid image layout");
}
return (int)res;
}
super(message);
}
}
/**
* Derives number of bytes per pixel from the pixel format.
* Following bit fields are used here:
* [0..2] - bytes per sample
* [3..6] - number of color samples per pixel
* [7..9] - number of non-color samples per pixel
*
* A complete description of the pixel format can be found
* here: lcms2.h, lines 651 - 667.
*
* @param pixelType pixel format in lcms2 notation.
* @return number of bytes per pixel for given pixel format.
*/
}
}