// Path: src/integeruser/jglsdk/glimg/ImageFormat.java
// enum PixelDataType {
//     NORM_UNSIGNED_INTEGER,     // Image data are unsigned integers that are mapped to floats on the range [0, 1].
//     NORM_SIGNED_INTEGER,       // Image data are signed integers that are mapped to floats on the range [-1, 1].
//     UNSIGNED_INTEGRAL,         // Image data are unsigned integers.
//     SIGNED_INTEGRAL,           // Image data are signed integers.
//     FLOAT,                     // Image data are individual floating-point numbers.
//     SHARED_EXP_FLOAT,          // Image data are floats, but each pixel uses the same exponent.
//     NUM_UNCOMPRESSED_TYPES,
// 
//     COMPRESSED_BC1,            // Image data is compressed with DXT1/BC1 compression. Unsigned normalized integers.
//     COMPRESSED_BC2,            // Image data is compressed with DXT3/BC2 compression. Unsigned normalized integers.
//     COMPRESSED_BC3,            // Image data is compressed with DXT5/BC3 compression. Unsigned normalized integers.
//     COMPRESSED_UNSIGNED_BC4,   // Image is compressed with BC4 compression (1-component), with unsigned normalized integers.
//     COMPRESSED_SIGNED_BC4,     // Image is compressed with BC4 compression (1-component), with signed normalized integers.
//     COMPRESSED_UNSIGNED_BC5,   // Image is compressed with BC5 compression (2-component), with unsigned normalized integers.
//     COMPRESSED_SIGNED_BC5,     // Image is compressed with BC5 compression (2-component), with signed normalized integers.
//     COMPRESSED_UNSIGNED_BC6H,  // Image is compressed with BC6H compression, with unsigned floats [0, +inf).
//     COMPRESSED_SIGNED_BC6H,    // Image is compressed with BC6H compression, with floats.
//     COMPRESSED_BC7,            // Image data is compressed with BC7 compression. Unsigned normalized integers.
// 
//     NUM_TYPES
// }
// 
// Path: src/integeruser/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/integeruser/jglsdk/glimg/Util.java
// static class CompressedBlockData {
//     Dimensions dimensions;  // The dimensionality of a block.
//     int byteCount;          // Number of bytes in a block.
// }


import integeruser.jglsdk.glimg.ImageFormat.PixelDataType;
import integeruser.jglsdk.glimg.ImageSet.Dimensions;
import integeruser.jglsdk.glimg.Util.CompressedBlockData;
import java.util.ArrayList;
import java.util.Arrays;
            throw new RuntimeException("Not implemented.");
        } else {
            int imageDataOffset = ((arrayIx * faceCount) + faceIx) * imageSizes[mipmapLevel];
            copyImageFlipped(sourceData, imageData, imageDataOffset, mipmapLevel);
        }
    }


    ImageSet createImage() {
        if (imageData.isEmpty()) throw new RuntimeException("ImageSet already created.");
        return new ImageSet(imageFormat, imageDimensions, mipmapCount, arrayCount, faceCount, imageData, imageSizes);
    }

    ////////////////////////////////
    private ImageFormat imageFormat;
    private Dimensions imageDimensions;

    private int mipmapCount;
    private int arrayCount;
    private int faceCount;

    private ArrayList<byte[]> imageData;
    private int[] imageSizes;

    ////////////////////////////////
    private void copyImageFlipped(byte[] sourceData, byte[] imageData, int imageDataOffset, int mipmapLevel) {
        assert (sourceData.length * faceCount * arrayCount) == imageData.length;

        Dimensions mipmapImageDimensions = Util.calcMipmapLevelDimensions(new Dimensions(imageDimensions), mipmapLevel);

// Path: src/integeruser/jglsdk/glimg/ImageFormat.java
// enum PixelDataType {
//     NORM_UNSIGNED_INTEGER,     // Image data are unsigned integers that are mapped to floats on the range [0, 1].
//     NORM_SIGNED_INTEGER,       // Image data are signed integers that are mapped to floats on the range [-1, 1].
//     UNSIGNED_INTEGRAL,         // Image data are unsigned integers.
//     SIGNED_INTEGRAL,           // Image data are signed integers.
//     FLOAT,                     // Image data are individual floating-point numbers.
//     SHARED_EXP_FLOAT,          // Image data are floats, but each pixel uses the same exponent.
//     NUM_UNCOMPRESSED_TYPES,
// 
//     COMPRESSED_BC1,            // Image data is compressed with DXT1/BC1 compression. Unsigned normalized integers.
//     COMPRESSED_BC2,            // Image data is compressed with DXT3/BC2 compression. Unsigned normalized integers.
//     COMPRESSED_BC3,            // Image data is compressed with DXT5/BC3 compression. Unsigned normalized integers.
//     COMPRESSED_UNSIGNED_BC4,   // Image is compressed with BC4 compression (1-component), with unsigned normalized integers.
//     COMPRESSED_SIGNED_BC4,     // Image is compressed with BC4 compression (1-component), with signed normalized integers.
//     COMPRESSED_UNSIGNED_BC5,   // Image is compressed with BC5 compression (2-component), with unsigned normalized integers.
//     COMPRESSED_SIGNED_BC5,     // Image is compressed with BC5 compression (2-component), with signed normalized integers.
//     COMPRESSED_UNSIGNED_BC6H,  // Image is compressed with BC6H compression, with unsigned floats [0, +inf).
//     COMPRESSED_SIGNED_BC6H,    // Image is compressed with BC6H compression, with floats.
//     COMPRESSED_BC7,            // Image data is compressed with BC7 compression. Unsigned normalized integers.
// 
//     NUM_TYPES
// }
// 
// Path: src/integeruser/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/integeruser/jglsdk/glimg/Util.java
// static class CompressedBlockData {
//     Dimensions dimensions;  // The dimensionality of a block.
//     int byteCount;          // Number of bytes in a block.
// }


// Path: src/integeruser/jglsdk/glimg/ImageCreator.java
import integeruser.jglsdk.glimg.ImageFormat.PixelDataType;
import integeruser.jglsdk.glimg.ImageSet.Dimensions;
import integeruser.jglsdk.glimg.Util.CompressedBlockData;
import java.util.ArrayList;
import java.util.Arrays;

            throw new RuntimeException("Not implemented.");
        } else {
            int imageDataOffset = ((arrayIx * faceCount) + faceIx) * imageSizes[mipmapLevel];
            copyImageFlipped(sourceData, imageData, imageDataOffset, mipmapLevel);
        }
    }


    ImageSet createImage() {
        if (imageData.isEmpty()) throw new RuntimeException("ImageSet already created.");
        return new ImageSet(imageFormat, imageDimensions, mipmapCount, arrayCount, faceCount, imageData, imageSizes);
    }

    ////////////////////////////////
    private ImageFormat imageFormat;
    private Dimensions imageDimensions;

    private int mipmapCount;
    private int arrayCount;
    private int faceCount;

    private ArrayList<byte[]> imageData;
    private int[] imageSizes;

    ////////////////////////////////
    private void copyImageFlipped(byte[] sourceData, byte[] imageData, int imageDataOffset, int mipmapLevel) {
        assert (sourceData.length * faceCount * arrayCount) == imageData.length;

        Dimensions mipmapImageDimensions = Util.calcMipmapLevelDimensions(new Dimensions(imageDimensions), mipmapLevel);

        if (imageFormat.getPixelDataType().ordinal() < PixelDataType.NUM_UNCOMPRESSED_TYPES.ordinal()) {