static void usage()

in java/TJBench.java [762:864]


  static void usage() throws Exception {
    int i;
    TJScalingFactor[] scalingFactors = TJ.getScalingFactors();
    int nsf = scalingFactors.length;
    String className = new TJBench().getClass().getName();

    System.out.println("\nUSAGE: java " + className);
    System.out.println("       <Inputimage (BMP|PPM)> <Quality or PSV> [options]\n");
    System.out.println("       java " + className);
    System.out.println("       <Inputimage (JPG)> [options]");

    System.out.println("\nGENERAL OPTIONS");
    System.out.println("---------------");
    System.out.println("-benchtime T = Run each benchmark for at least T seconds [default = 5.0]");
    System.out.println("-bmp = Use Windows Bitmap format for output images [default = PPM]");
    System.out.println("     ** 8-bit data precision only **");
    System.out.println("-bottomup = Use bottom-up row order for packed-pixel source/destination buffers");
    System.out.println("-componly = Stop after running compression tests.  Do not test decompression.");
    System.out.println("-lossless = Generate lossless JPEG images when compressing (implies");
    System.out.println("     -subsamp 444).  PSV is the predictor selection value (1-7).");
    System.out.println("-maxmemory N = Memory limit (in megabytes) for intermediate buffers used with");
    System.out.println("     progressive JPEG compression and decompression, Huffman table");
    System.out.println("     optimization, lossless JPEG compression, and lossless transformation");
    System.out.println("     [default = no limit]");
    System.out.println("-maxpixels N = Input image size limit (in pixels) [default = no limit]");
    System.out.println("-nowrite = Do not write reference or output images (improves consistency of");
    System.out.println("     benchmark results)");
    System.out.println("-rgb, -bgr, -rgbx, -bgrx, -xbgr, -xrgb =");
    System.out.println("     Use the specified pixel format for packed-pixel source/destination buffers");
    System.out.println("     [default = BGR]");
    System.out.println("-cmyk = Indirectly test YCCK JPEG compression/decompression");
    System.out.println("     (use the CMYK pixel format for packed-pixel source/destination buffers)");
    System.out.println("-precision N = Use N-bit data precision when compressing [N is 8, 12, or 16;");
    System.out.println("     default = 8; if N is 16, then -lossless must also be specified]");
    System.out.println("     (-precision 12 implies -optimize unless -arithmetic is also specified)");
    System.out.println("-quiet = Output results in tabular rather than verbose format");
    System.out.println("-restart N = When compressing, add a restart marker every N MCU rows");
    System.out.println("     [default = 0 (no restart markers)].  Append 'B' to specify the restart");
    System.out.println("     marker interval in MCUs (lossy only.)");
    System.out.println("-stoponwarning = Immediately discontinue the current");
    System.out.println("     compression/decompression/transform operation if a warning (non-fatal");
    System.out.println("     error) occurs");
    System.out.println("-tile = Compress/transform the input image into separate JPEG tiles of varying");
    System.out.println("     sizes (useful for measuring JPEG overhead)");
    System.out.println("-warmup T = Run each benchmark for T seconds [default = 1.0] prior to starting");
    System.out.println("     the timer, in order to prime the caches and thus improve the consistency");
    System.out.println("     of the benchmark results");

    System.out.println("\nLOSSY JPEG OPTIONS");
    System.out.println("------------------");
    System.out.println("-arithmetic = Use arithmetic entropy coding in JPEG images generated by");
    System.out.println("     compression and transform operations (can be combined with -progressive)");
    System.out.println("-crop WxH+X+Y = Decompress only the specified region of the JPEG image, where W");
    System.out.println("     and H are the width and height of the region (0 = maximum possible width");
    System.out.println("     or height) and X and Y are the left and upper boundary of the region, all");
    System.out.println("     specified relative to the scaled image dimensions.  X must be divible by");
    System.out.println("     the scaled iMCU width.");
    System.out.println("-fastdct = Use the fastest DCT/IDCT algorithm available");
    System.out.println("-fastupsample = Use the fastest chrominance upsampling algorithm available");
    System.out.println("-optimize = Compute optimal Huffman tables for JPEG images generated by");
    System.out.println("     compession and transform operations");
    System.out.println("-progressive = Generate progressive JPEG images when compressing or");
    System.out.println("     transforming (can be combined with -arithmetic; implies -optimize unless");
    System.out.println("     -arithmetic is also specified)");
    System.out.println("-limitscans = Refuse to decompress or transform progressive JPEG images that");
    System.out.println("     have an unreasonably large number of scans");
    System.out.println("-scale M/N = When decompressing, scale the width/height of the JPEG image by a");
    System.out.print("     factor of M/N (M/N = ");
    for (i = 0; i < nsf; i++) {
      System.out.format("%d/%d", scalingFactors[i].getNum(),
                        scalingFactors[i].getDenom());
      if (nsf == 2 && i != nsf - 1)
        System.out.print(" or ");
      else if (nsf > 2) {
        if (i != nsf - 1)
          System.out.print(", ");
        if (i == nsf - 2)
          System.out.print("or ");
      }
      if (i % 8 == 0 && i != 0)
        System.out.print("\n     ");
    }
    System.out.println(")");
    System.out.println("-subsamp S = When compressing, use the specified level of chrominance");
    System.out.println("     subsampling (S = 444, 422, 440, 420, 411, 441, or GRAY) [default = test");
    System.out.println("     Grayscale, 4:2:0, 4:2:2, and 4:4:4 in sequence]");
    System.out.println("-hflip, -vflip, -transpose, -transverse, -rot90, -rot180, -rot270 =");
    System.out.println("     Perform the specified lossless transform operation on the input image");
    System.out.println("     prior to decompression (these operations are mutually exclusive)");
    System.out.println("-grayscale = Transform the input image into a grayscale JPEG image prior to");
    System.out.println("     decompression (can be combined with the other transform operations above)");
    System.out.println("-copynone = Do not copy any extra markers (including Exif and ICC profile data)");
    System.out.println("     when transforming the input image");
    System.out.println("-yuv = Compress from/decompress to intermediate planar YUV images");
    System.out.println("     ** 8-bit data precision only **");
    System.out.println("-yuvpad N = The number of bytes by which each row in each plane of an");
    System.out.println("     intermediate YUV image is evenly divisible (N must be a power of 2)");
    System.out.println("     [default = 1]");

    System.out.println("\nNOTE:  If the quality/PSV is specified as a range (e.g. 90-100 or 1-4), a");
    System.out.println("separate test will be performed for all values in the range.\n");
    System.exit(1);
  }