Package com.lightcrafts.utils

Examples of com.lightcrafts.utils.DCRaw$ImageData


            info = (RawImageInfo)m_imageInfo.getAuxiliaryInfo();
        }
        catch ( LightCraftsException e ) {
            return;
        }
        final DCRaw dcraw = info.getDCRaw();

        final ImageMetadata metadata = m_imageInfo.getCurrentMetadata();
        final EXIFDirectory exifDir =
            (EXIFDirectory)metadata.getDirectoryFor(
                EXIFDirectory.class, true
            );

        final float aperture = dcraw.getAperture();
        if ( aperture > 0 )
            exifDir.putValue(
                EXIF_FNUMBER,
                new UnsignedRationalMetaValue( (int)(aperture * 10), 10 )
            );

        final Date captureDateTime = dcraw.getCaptureDateTime();
        if ( captureDateTime != null )
            exifDir.putValue(
                EXIF_DATE_TIME, new DateMetaValue( captureDateTime )
            );

        final float focalLength = dcraw.getFocalLength();
        if ( focalLength > 0 )
            exifDir.putValue(
                EXIF_FOCAL_LENGTH,
                new UnsignedRationalMetaValue( (int)(focalLength * 10), 10 )
            );

        final int width = dcraw.getImageWidth();
        final int height = dcraw.getImageHeight();
        if ( width > 0 && height > 0 ) {
            exifDir.putValue(
                EXIF_IMAGE_WIDTH, new UnsignedShortMetaValue( width )
            );
            exifDir.putValue(
                EXIF_IMAGE_HEIGHT, new UnsignedShortMetaValue( height )
            );
        }

        final int iso = dcraw.getISO();
        if ( iso > 0 )
            exifDir.putValue(
                EXIF_ISO_SPEED_RATINGS, new UnsignedShortMetaValue( iso )
            );

        final String make = dcraw.getMake();
        if ( make != null )
            exifDir.putValue( EXIF_MAKE, new StringMetaValue( make ) );

        final String model = dcraw.getModel();
        if ( model != null )
            exifDir.putValue( EXIF_MODEL, new StringMetaValue( model ) );

        final float shutterSpeed = dcraw.getShutterSpeed();
        if ( shutterSpeed > 0 )
            exifDir.putValue(
                EXIF_EXPOSURE_TIME,
                new RationalMetaValue( (int)(shutterSpeed * 10000), 10000 )
            );
View Full Code Here


            }
            catch ( Exception e ) {
                return;
            }
            if ( auxInfo instanceof RawImageInfo ) {
                final DCRaw dcRaw = ((RawImageInfo)auxInfo).getDCRaw();
                camera = dcRaw.getCameraMake( true );
            }
        }
        if ( camera != null )
            putValue( CORE_CAMERA, new StringMetaValue( camera ) );
    }
View Full Code Here

    {
        final ImageMetadata metadata = imageInfo.getMetadata();
        Date captureDate = metadata.getCaptureDateTime();
        if ( captureDate == null ) {
            final RawImageInfo rawInfo = (RawImageInfo)imageInfo.getAuxiliaryInfo();
            final DCRaw dcRaw = rawInfo.getDCRaw();
            captureDate = dcRaw.getCaptureDateTime();
        }
        if ( captureDate != null ) {
            final long time = captureDate.getTime();
            return imageInfo.getFile().getName() + time + version;
        }
View Full Code Here

        auxInfo = rendering.getEngine().getAuxInfo();
        metadata = rendering.getEngine().getMetadata();

        if (auxInfo instanceof RawImageInfo) {
            final DCRaw dcRaw = ((RawImageInfo)auxInfo).getDCRaw();

            daylightMultipliers = dcRaw.getDaylightMultipliers(); // pre_mul
            preMul = daylightMultipliers.clone();
            cameraMultipliers = dcRaw.getCameraMultipliers();

            if (daylightMultipliers[0] != 0) {
                daylightTemperature = neutralTemperature(daylightMultipliers, 5000);

                System.out.println("daylightMultipliers: " + daylightMultipliers[0] + ", " + daylightMultipliers[1] + ", " + daylightMultipliers[2]);

                System.out.println("Daylight Temperature : " + daylightTemperature);
            } else
                daylightTemperature = 5000;

            if (cameraMultipliers[0] != 0) {
                originalTemperature = temperature = neutralTemperature(cameraMultipliers, 5000);

                System.out.println("cameraMultipliers: " + cameraMultipliers[0] + ", " + cameraMultipliers[1] + ", " + cameraMultipliers[2]);

                System.out.println("Camera Temperature: " + originalTemperature);
            } else
                originalTemperature = temperature = daylightTemperature;

            // we preserve the hilights in dcraw, here we have to make sure that
            // we clip them appropratedly together with white balance
            // double dmin = Math.min(daylightMultipliers[0], Math.min(daylightMultipliers[1], daylightMultipliers[2]));
            double dmax = Math.max(daylightMultipliers[0], Math.max(daylightMultipliers[1], daylightMultipliers[2]));

            // System.out.println("dmax: " + dmax + ", dmin: " + dmin);

            for (int c=0; c < 3; c++)
                daylightMultipliers[c] /= dmax;

            // Apply camera white balance
            if (cameraMultipliers[0] > 0) {
                float[] wb = new float[] {(cameraMultipliers[0] / (cameraMultipliers[1] * daylightMultipliers[0])),
                                          (cameraMultipliers[1] / (cameraMultipliers[1] * daylightMultipliers[1])),
                                          (cameraMultipliers[2] / (cameraMultipliers[1] * daylightMultipliers[2]))};

                System.out.println("Scaling with: " + wb[0] + ", " + wb[1] + ", " + wb[2]);
                System.out.println("Correlated Temperature: " + neutralTemperature(wb, 5000));

                cameraRGBWB = dcRaw.getCameraRGB();

                for (int i = 0; i < 3; i++)
                    for (int j = 0; j < 3; j++)
                        cameraRGBWB[j][i] *= wb[i];

                Matrix B = new Matrix(ColorScience.chromaticAdaptation(daylightTemperature, originalTemperature, caMethod));
                Matrix combo = XYZtoRGB.times(B.times(RGBtoZYX));

                cameraRGBWB = combo.inverse().times(new Matrix(cameraRGBWB)).getArrayFloat();
            }
           
            cameraRGBCA = dcRaw.getCameraRGB();
            dcRaw.getDaylightMultipliers();

            for (int i = 0; i < 3; i++)
                for (int j = 0; j < 3; j++)
                    cameraRGBCA[j][i] *= dmax;
        } else {
View Full Code Here

        caMethod = ColorScience.CAMethod.Mixed;

        AuxiliaryImageInfo auxInfo = rendering.getEngine().getAuxInfo();

        if (false && auxInfo instanceof RawImageInfo) {
            final DCRaw dcRaw = ((RawImageInfo)auxInfo).getDCRaw();

            float[] daylightMultipliers = dcRaw.getDaylightMultipliers();
            float[] cameraMultipliers = dcRaw.getCameraMultipliers();

            System.out.println("daylightMultipliers: " + daylightMultipliers[0] + ", " + daylightMultipliers[1] + ", " + daylightMultipliers[2]);
            System.out.println("cameraMultipliers: " + cameraMultipliers[0] + ", " + cameraMultipliers[1] + ", " + cameraMultipliers[2]);

            float RGBToXYZMat[][] = ColorScience.RGBToXYZMat;
View Full Code Here

TOP

Related Classes of com.lightcrafts.utils.DCRaw$ImageData

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.