// Path: src/rosick/jglsdk/glimg/ImageSet.java
// public static class Dimensions {
// 	public int numDimensions; // The number of dimensions of an image. Can be 1, 2, or 3.
// 	public int width; // The width of the image. Always valid.
// 	public int height; // The height of the image. Only valid if numDimensions is 2 or 3.
// 	public int depth; // The depth of the image. Only valid if numDimensions is 3.
// 		
// 	public Dimensions() {}
// 		
// 	public Dimensions(Dimensions dimensions) {
// 		numDimensions = dimensions.numDimensions;
// 		width = dimensions.width;
// 		height = dimensions.height;
// 		depth = dimensions.depth;
// 	}
// 		
// 	// Computes the number of rows of pixel data in the image.
// 	public int calcNumLines() {
// 		switch(numDimensions) {
// 			case 1:
// 				return 1;
// 			case 2:
// 				return height;
// 			case 3:
// 				return depth * height;
// 		}
// 			
// 		// Should not be possible.
// 		return -1;
// 	}
// }


import rosick.jglsdk.glimg.ImageFormat.BitDepth;
import rosick.jglsdk.glimg.ImageFormat.PixelComponents;
import rosick.jglsdk.glimg.ImageFormat.PixelDataType;
import rosick.jglsdk.glimg.ImageSet.Dimensions;

				break;
			default:
				break;
		}
		
		if(format.getBitDepth().ordinal() < BitDepth.NUM_PER_COMPONENT.ordinal()) {
			bytesPerPixel *= calcComponentCount(format.getPixelComponents());
		}
		
		return bytesPerPixel;
	}
	
	static int calcComponentCount(PixelComponents component) {
		PixelComponents[] twoCompFormats = { PixelComponents.COLOR_RG, PixelComponents.DEPTH_X };
		PixelComponents[] threeCompFormats = { PixelComponents.COLOR_RGB, PixelComponents.COLOR_RGB_SRGB };
		PixelComponents[] fourCompFormats = { PixelComponents.COLOR_RGBX, PixelComponents.COLOR_RGBA,
				PixelComponents.COLOR_RGBX_SRGB, PixelComponents.COLOR_RGBA_SRGB };
		
		if(isOneOfThese(component, twoCompFormats)) {
			return 2;
		}
		
		if(isOneOfThese(component, threeCompFormats)) {
			return 3;
		}
		
		if(isOneOfThese(component, fourCompFormats)) {
			return 4;
		}
		

// Path: src/rosick/jglsdk/glimg/ImageSet.java
// public static class Dimensions {
// 	public int numDimensions; // The number of dimensions of an image. Can be 1, 2, or 3.
// 	public int width; // The width of the image. Always valid.
// 	public int height; // The height of the image. Only valid if numDimensions is 2 or 3.
// 	public int depth; // The depth of the image. Only valid if numDimensions is 3.
// 		
// 	public Dimensions() {}
// 		
// 	public Dimensions(Dimensions dimensions) {
// 		numDimensions = dimensions.numDimensions;
// 		width = dimensions.width;
// 		height = dimensions.height;
// 		depth = dimensions.depth;
// 	}
// 		
// 	// Computes the number of rows of pixel data in the image.
// 	public int calcNumLines() {
// 		switch(numDimensions) {
// 			case 1:
// 				return 1;
// 			case 2:
// 				return height;
// 			case 3:
// 				return depth * height;
// 		}
// 			
// 		// Should not be possible.
// 		return -1;
// 	}
// }


// Path: src/rosick/jglsdk/glimg/DdsUtil.java
import rosick.jglsdk.glimg.ImageFormat.BitDepth;
import rosick.jglsdk.glimg.ImageFormat.PixelComponents;
import rosick.jglsdk.glimg.ImageFormat.PixelDataType;
import rosick.jglsdk.glimg.ImageSet.Dimensions;

				break;
			default:
				break;
		}
		
		if(format.getBitDepth().ordinal() < BitDepth.NUM_PER_COMPONENT.ordinal()) {
			bytesPerPixel *= calcComponentCount(format.getPixelComponents());
		}
		
		return bytesPerPixel;
	}
	
	static int calcComponentCount(PixelComponents component) {
		PixelComponents[] twoCompFormats = { PixelComponents.COLOR_RG, PixelComponents.DEPTH_X };
		PixelComponents[] threeCompFormats = { PixelComponents.COLOR_RGB, PixelComponents.COLOR_RGB_SRGB };
		PixelComponents[] fourCompFormats = { PixelComponents.COLOR_RGBX, PixelComponents.COLOR_RGBA,
				PixelComponents.COLOR_RGBX_SRGB, PixelComponents.COLOR_RGBA_SRGB };
		
		if(isOneOfThese(component, twoCompFormats)) {
			return 2;
		}
		
		if(isOneOfThese(component, threeCompFormats)) {
			return 3;
		}
		
		if(isOneOfThese(component, fourCompFormats)) {
			return 4;
		}
		

		return 1;
