Package java.awt.color

Examples of java.awt.color.ICC_ColorSpace


            }

            /**create CMYK colorspace using icm profile*/
            ICC_Profile p =ICC_Profile.getInstance(GenericColorSpace.class.getResourceAsStream(
            "/org/jpedal/res/cmm/cmyk.icm"));
            ICC_ColorSpace cmykCS = new ICC_ColorSpace(p);

            /**define the conversion. PdfColor.hints can be replaced with null or some hints*/
            CSToRGB = new ColorConvertOp(cmykCS, rgbCS, ColorSpaces.hints);
        } catch (Exception e) {
          if(LogWriter.isOutput())
View Full Code Here


        String profile=System.getProperty("org.jpedal.RGBprofile");

        if(profile!=null){
            try{
                rgbCS=new ICC_ColorSpace(ICC_Profile.getInstance(new FileInputStream(profile)));

                System.out.println("use "+profile);
            }catch(Exception e){
                e.printStackTrace();
                if(LogWriter.isOutput())
View Full Code Here

    public void doParse(byte[] src) throws Exception {
        byte[] dest = new byte[src.length];
        System.arraycopy(src, 0, dest, 0, src.length);

        ICC_Profile profile = ICC_Profile.getInstance(dest);
        ColorSpace cs = new ICC_ColorSpace(profile);
        Random rand = new Random();
        float[] color = new float[3];
        color[0] = rand.nextFloat();
        color[1] = rand.nextFloat();
        color[2] = rand.nextFloat();

        float[] res = cs.toRGB(color);
        System.out.println(res[0] + ", " + res[1] + ", " + res[2]);
    }
View Full Code Here

         * embedded data.
         */
        if (oldData == null ||
            !java.util.Arrays.equals(oldData, newData))
        {
            iccCS = new ICC_ColorSpace(newProfile);
        }
    }
View Full Code Here

            float tmpData[][] = scaler.scaleNormalize(src);
           
            // Get source and destination color spaces
            ColorSpace srcCS = (srcPf == null) ?
                    (ColorSpace) first:
                    new ICC_ColorSpace(srcPf);
            ColorSpace dstCS = (dstPf == null) ?
                    (ColorSpace) last:
                    new ICC_ColorSpace(dstPf);
                   
            applySequence(sequence, tmpData, srcCS, dstCS);
           
            scaler.loadScalingData(dst, null);
            scaler.unscaleNormalized(dst, tmpData);
View Full Code Here

        // Get destination color space
        Object destination = conversionSequence[nSpaces-1];
        ColorSpace dstCS =
            (destination instanceof ColorSpace) ?
                    (ColorSpace) destination :
                    new ICC_ColorSpace((ICC_Profile) destination);
       
        ColorModel srcCM = src.getColorModel();    
        ColorModel dstCM = new ComponentColorModel(dstCS,
                srcCM.hasAlpha(),
                srcCM.isAlphaPremultiplied(),
View Full Code Here

            float tmpData[][] = scaler.scaleNormalize(src);
           
            // Get source and destination color spaces
            ColorSpace srcCS = (srcPf == null) ?
                    (ColorSpace) first:
                    new ICC_ColorSpace(srcPf);
            ColorSpace dstCS = (dstPf == null) ?
                    (ColorSpace) last:
                    new ICC_ColorSpace(dstPf);
                   
            applySequence(sequence, tmpData, srcCS, dstCS);
           
            scaler.loadScalingData(dst, null);
            scaler.unscaleNormalized(dst, tmpData);
View Full Code Here

        // Get destination color space
        Object destination = conversionSequence[nSpaces-1];
        ColorSpace dstCS =
            (destination instanceof ColorSpace) ?
                    (ColorSpace) destination :
                    new ICC_ColorSpace((ICC_Profile) destination);
       
        ColorModel srcCM = src.getColorModel();    
        ColorModel dstCM = new ComponentColorModel(dstCS,
                srcCM.hasAlpha(),
                srcCM.isAlphaPremultiplied(),
View Full Code Here

/*  854 */       byte[] palette = this.expandBits[this.bitDepth];
/*  855 */       this.colorModel = new IndexColorModel(this.bitDepth, palette.length, palette, palette, palette);
/*      */     }
/*      */     else
/*      */     {
/*  861 */       this.colorModel = ImageCodec.createComponentColorModel(this.sampleModel, this.iccProfile == null ? null : new ICC_ColorSpace(this.iccProfile));
/*      */     }
/*      */   }
View Full Code Here

/*     */     throws IOException
/*     */   {
/* 147 */     ColorSpace cs = null;
/* 148 */     int colorSpaceType = in.readInt();
/* 149 */     if (colorSpaceType == 2)
/* 150 */       cs = new ICC_ColorSpace(ICC_Profile.getInstance(in));
/* 151 */     else if (colorSpaceType == 1)
/* 152 */       cs = ColorSpace.getInstance(in.readInt());
/* 153 */     else if (colorSpaceType == 0)
/*     */     {
/* 155 */       switch (in.readInt()) {
View Full Code Here

TOP

Related Classes of java.awt.color.ICC_ColorSpace

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.