Package com.lightcrafts.image.libs

Examples of com.lightcrafts.image.libs.LCTIFFWriter


                                                      engine.getLCMSIntent(settings.getRenderingIntent()),
                                                      true);

        try {
            File spoolFile = File.createTempFile("LZPrintSpool", "tif");
            LCTIFFWriter writer = new LCTIFFWriter(spoolFile.getAbsolutePath(),
                                                   rendering.getWidth(),
                                                   rendering.getHeight());
            // No profile for Application Managed Colors
            if (colorProfile == JAIContext.sRGBColorProfile)
                writer.setByteField( TIFFTags.TIFF_ICC_PROFILE, colorProfile.getData());
            writer.putImageStriped(rendering, thread);

            if (!thread.isCanceled())
                MacOSXPrinter.print(jobName, spoolFile, settings.getPrintBounds());

            spoolFile.delete();
View Full Code Here


            if (fileCache != null) {
                try {
                    final File cacheFile = fileCache.putToFile(currentJob.cacheKey);

                    try {
                        LCTIFFWriter writer = new LCTIFFWriter(cacheFile.getAbsolutePath(),
                                                               currentJob.image.getWidth(),
                                                               currentJob.image.getHeight());
                        writer.setByteField( TIFFTags.TIFF_ICC_PROFILE, JAIContext.linearProfile.getData());
                        writer.putImageTiled(currentJob.image, null);
                    } catch ( LCImageLibException e) {
                        e.printStackTrace();
                    } finally {
                        fileCache.notifyAboutCloseOf(cacheFile);
                    }
View Full Code Here

        }
        catch ( UnknownImageTypeException e ) {
            metadata = new ImageMetadata( this );
        }

        final LCTIFFWriter writer;
        try {
            if ( tiffOptions.multilayer.getValue() ) {
                File originalFile = imageInfo.getFile();
                if ( exportFile.equals( originalFile ) ) {
                    tempFile = File.createTempFile( "LightZone", "tif" );
                    FileUtil.copyFile( originalFile, tempFile );
                    originalFile = tempFile;
                }
                writer = new LCTIFFWriter(
                    exportFile.getAbsolutePath(),
                    originalFile.getAbsolutePath(),
                    tiffOptions.resizeWidth.getValue(),
                    tiffOptions.resizeHeight.getValue(),
                    tiffOptions.resolution.getValue(),
                    tiffOptions.resolutionUnit.getValue()
                );
            } else {
                writer = new LCTIFFWriter(
                    options.getExportFile().getAbsolutePath(),
                    tiffOptions.resizeWidth.getValue(),
                    tiffOptions.resizeHeight.getValue(),
                    tiffOptions.resolution.getValue(),
                    tiffOptions.resolutionUnit.getValue()
                );
            }

            writer.setIntField(
                TIFF_COMPRESSION,
                tiffOptions.lzwCompression.getValue() ?
                    TIFF_COMPRESSION_LZW : TIFF_COMPRESSION_NONE
            );

            ICC_Profile profile = ColorProfileInfo.getExportICCProfileFor(
                tiffOptions.colorProfile.getValue()
            );
            if ( profile == null )
                profile = JAIContext.sRGBExportColorProfile;
            writer.setICCProfile( profile );

            if ( lznDoc != null ) {
                final byte[] buf = XMLUtil.encodeDocument( lznDoc, false );
                writer.setByteField( TIFF_LIGHTZONE, buf );
            }

            writer.putMetadata( metadata );
            writer.putImageStriped( image, thread );
            // TODO: allow users to write tiled TIFFs if they want
            // writer.putImageTiled( image, thread );
            writer.dispose();
        }
        catch ( LCImageLibException e ) {
            final IOException ioe = new IOException( "TIFF export failed" );
            ioe.initCause( e );
            throw ioe;
View Full Code Here

TOP

Related Classes of com.lightcrafts.image.libs.LCTIFFWriter

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.