Package com.sun.media.jai.codec

Examples of com.sun.media.jai.codec.FileSeekableStream


     * @param file The file to be processed.
     */
    public void processFile(File file) {
        try {
            log("Processing File: " + file.getAbsolutePath());
            FileSeekableStream input = new FileSeekableStream(file);
            PlanarImage image = JAI.create("stream", input);
            for (int i = 0; i < instructions.size(); i++) {
                Object instr = instructions.elementAt(i);
                if (instr instanceof TransformOperation) {
                    image = ((TransformOperation) instr)
                        .executeTransformOperation(image);
                } else {
                    log("Not a TransformOperation: " + instr);
                }
            }
            input.close();

            if (str_encoding.toLowerCase().equals("jpg")) {
                str_encoding = "JPEG";
            } else if (str_encoding.toLowerCase().equals("tif")) {
                str_encoding = "TIFF";
View Full Code Here


     * @param file The file to be processed
     */
    public void processFile(File file) {
        try {
            log("Processing File: " + file.getAbsolutePath());
            FileSeekableStream input = new FileSeekableStream(file);
            PlanarImage image = JAI.create("stream", input);
            for (int i = 0; i < instructions.size(); i++) {
                Object instr = instructions.elementAt(i);
                if (instr instanceof TransformOperation) {
                    image = ((TransformOperation) instr).executeTransformOperation(image);
                } else {
                    log("Not a TransformOperation: " + instr);
                }
            }
            input.close();

            if (str_encoding.toLowerCase().equals("jpg")) {
                str_encoding = "JPEG";
            } else if (str_encoding.toLowerCase().equals("tif")) {
                str_encoding = "TIFF";
View Full Code Here

     * Load a WBMP image from a file and return it as SWT image data.
     * @param file the <code>File</code> containing the image
     * @return an SWT <code>ImageData</code> version of the image data
     */
    public ImageData[] load(File file) throws IOException {
        WBMPImage wbmpImage = new WBMPImage(new FileSeekableStream(file));
        Raster rast = wbmpImage.getData();
        int width = rast.getWidth();
        int height = rast.getHeight();
        int[] pixels = new int[width * height];
        rast.getSamples(0, 0, width, height, 0, pixels);
View Full Code Here

     * @param input the <code>File</code> containing the image
     * @return an SWT <code>ImageData</code> version of the image data
     */
    public ImageData load(File input) throws IOException  {

        SeekableStream s = new FileSeekableStream(input);

        TIFFDecodeParam param = new TIFFDecodeParam();
        param.setDecodePaletteAsShorts( false );
        ImageDecoder dec = ImageCodec.createImageDecoder("tiff", s, param); //$NON-NLS-1$
        int imageToLoad = 0;
View Full Code Here

     */
    public void processFile(File file, File newFile) {
        try {
            log("Processing File: " + file.getAbsolutePath());

            FileSeekableStream input = null;
            PlanarImage image = null;
            try {
                input = new FileSeekableStream(file);
                image = JAI.create("stream", input);
                final int size = instructions.size();
                for (int i = 0; i < size; i++) {
                    Object instr = instructions.elementAt(i);
                    if (instr instanceof TransformOperation) {
View Full Code Here

     */
    public void processFile(File file, File newFile) {
        try {
            log("Processing File: " + file.getAbsolutePath());

            FileSeekableStream input = null;
            PlanarImage image = null;
            try {
                input = new FileSeekableStream(file);
                image = JAI.create("stream", input);
                for (int i = 0; i < instructions.size(); i++) {
                    Object instr = instructions.elementAt(i);
                    if (instr instanceof TransformOperation) {
                        image = ((TransformOperation) instr)
View Full Code Here

     */
    public void processFile(File file, File newFile) {
        try {
            log("Processing File: " + file.getAbsolutePath());

            FileSeekableStream input = null;
            PlanarImage image = null;
            try {
                input = new FileSeekableStream(file);
                image = JAI.create("stream", input);
                final int size = instructions.size();
                for (int i = 0; i < size; i++) {
                    Object instr = instructions.elementAt(i);
                    if (instr instanceof TransformOperation) {
View Full Code Here

     * @param file The file to be processed
     */
    public void processFile(File file) {
        try {
            log("Processing File: " + file.getAbsolutePath());
            FileSeekableStream input = new FileSeekableStream(file);
            PlanarImage image = JAI.create("stream", input);
            for (int i = 0; i < instructions.size(); i++) {
                Object instr = instructions.elementAt(i);
                if (instr instanceof TransformOperation) {
                    image = ((TransformOperation) instr).executeTransformOperation(image);
                } else {
                    log("Not a TransformOperation: " + instr);
                }
            }
            input.close();

            if (str_encoding.toLowerCase().equals("jpg")) {
                str_encoding = "JPEG";
            } else if (str_encoding.toLowerCase().equals("tif")) {
                str_encoding = "TIFF";
View Full Code Here

  }
 
    private RenderedOp loadImage(File file) throws IOException {
      if (file == null)
        return null;
        FileSeekableStream fss = new FileSeekableStream(file);
        return JAI.create("stream", fss);
    }
View Full Code Here

    }

    public static void main(String[] args) {
        try {
            RandomAccessFile f = new RandomAccessFile(args[0], "r");
            SeekableStream sis = new FileSeekableStream(f);
            StructuredStorage ss = new StructuredStorage(sis);

            ss.changeDirectoryToRoot();

            byte[] s = ss.getStreamAsBytes("SummaryInformation");
View Full Code Here

TOP

Related Classes of com.sun.media.jai.codec.FileSeekableStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.