Java 类com.lowagie.text.pdf.codec.CCITTG4Encoder 实例源码

项目:itext2    文件:BarcodeDatamatrix.java   
/** Gets an <CODE>Image</CODE> with the barcode. A successful call to the method <CODE>generate()</CODE>
 * before calling this method is required.
 * @return the barcode <CODE>Image</CODE>
 * @throws BadElementException on error
 */    
public Image createImage() throws BadElementException {
    if (image == null)
        return null;
    byte g4[] = CCITTG4Encoder.compress(image, width + 2 * ws, height + 2 * ws);
    return Image.getInstance(width + 2 * ws, height + 2 * ws, false, Image.CCITTG4, 0, g4, null);
}
项目:camel-spring    文件:BarcodeQRCode.java   
/**
 * Gets an <CODE>Image</CODE> with the barcode.
 *
 * @return the barcode <CODE>Image</CODE>
 * @throws BadElementException on error
 */
public Image getImage() throws BadElementException {

    byte[] b = getBitMatrix();
    byte g4[] = CCITTG4Encoder.compress(b, bm.getWidth(), bm.getHeight());

    return Image.getInstance(bm.getWidth(), bm.getHeight(), false, Image.CCITTG4, Image.CCITT_BLACKIS1, g4, null);
}
项目:DroidText    文件:BarcodeDatamatrix.java   
/** Gets an <CODE>Image</CODE> with the barcode. A successful call to the method <CODE>generate()</CODE>
 * before calling this method is required.
 * @return the barcode <CODE>Image</CODE>
 * @throws BadElementException on error
 */    
public Image createImage() throws BadElementException {
    if (image == null)
        return null;
    byte g4[] = CCITTG4Encoder.compress(image, width + 2 * ws, height + 2 * ws);
    return Image.getInstance(width + 2 * ws, height + 2 * ws, false, Image.CCITTG4, 0, g4, null);
}
项目:itext2    文件:Image.java   
/**
 * Gets an instance of an Image in raw mode.
 * 
 * @param width
 *            the width of the image in pixels
 * @param height
 *            the height of the image in pixels
 * @param components
 *            1,3 or 4 for GrayScale, RGB and CMYK
 * @param data
 *            the image data
 * @param bpc
 *            bits per component
 * @param transparency
 *            transparency information in the Mask format of the image
 *            dictionary
 * @return an object of type <CODE>ImgRaw</CODE>
 * @throws BadElementException
 *             on error
 */
public static Image getInstance(int width, int height, int components,
        int bpc, byte data[], int transparency[])
        throws BadElementException {
    if (transparency != null && transparency.length != components * 2)
        throw new BadElementException(
                "Transparency length must be equal to (componentes * 2)");
    if (components == 1 && bpc == 1) {
        byte g4[] = CCITTG4Encoder.compress(data, width, height);
        return Image.getInstance(width, height, false, Image.CCITTG4,
                Image.CCITT_BLACKIS1, g4, transparency);
    }
    Image img = new ImgRaw(width, height, components, bpc, data);
    img.transparency = transparency;
    return img;
}
项目:DroidText    文件:Image.java   
/**
 * Gets an instance of an Image in raw mode.
 * 
 * @param width
 *            the width of the image in pixels
 * @param height
 *            the height of the image in pixels
 * @param components
 *            1,3 or 4 for GrayScale, RGB and CMYK
 * @param data
 *            the image data
 * @param bpc
 *            bits per component
 * @param transparency
 *            transparency information in the Mask format of the image
 *            dictionary
 * @return an object of type <CODE>ImgRaw</CODE>
 * @throws BadElementException
 *             on error
 */
public static Image getInstance(int width, int height, int components,
        int bpc, byte data[], int transparency[])
        throws BadElementException {
    if (transparency != null && transparency.length != components * 2)
        throw new BadElementException(
                "Transparency length must be equal to (componentes * 2)");
    if (components == 1 && bpc == 1) {
        byte g4[] = CCITTG4Encoder.compress(data, width, height);
        return Image.getInstance(width, height, false, Image.CCITTG4,
                Image.CCITT_BLACKIS1, g4, transparency);
    }
    Image img = new ImgRaw(width, height, components, bpc, data);
    img.transparency = transparency;
    return img;
}
项目:MesquiteArchive    文件:Image.java   
/**
 * Gets an instance of an Image in raw mode.
 * 
 * @param width
 *            the width of the image in pixels
 * @param height
 *            the height of the image in pixels
 * @param components
 *            1,3 or 4 for GrayScale, RGB and CMYK
 * @param data
 *            the image data
 * @param bpc
 *            bits per component
 * @param transparency
 *            transparency information in the Mask format of the image
 *            dictionary
 * @return an object of type <CODE>ImgRaw</CODE>
 * @throws BadElementException
 *             on error
 */

public static Image getInstance(int width, int height, int components,
        int bpc, byte data[], int transparency[])
        throws BadElementException {
    if (transparency != null && transparency.length != components * 2)
        throw new BadElementException(
                "Transparency length must be equal to (componentes * 2)");
    if (components == 1 && bpc == 1) {
        byte g4[] = CCITTG4Encoder.compress(data, width, height);
        return Image.getInstance(width, height, false, Image.CCITTG4,
                Image.CCITT_BLACKIS1, g4, transparency);
    }
    Image img = new ImgRaw(width, height, components, bpc, data);
    img.transparency = transparency;
    return img;
}
项目:MesquiteArchive    文件:Image.java   
/**
 * Gets an instance of an Image in raw mode.
 * 
 * @param width
 *            the width of the image in pixels
 * @param height
 *            the height of the image in pixels
 * @param components
 *            1,3 or 4 for GrayScale, RGB and CMYK
 * @param data
 *            the image data
 * @param bpc
 *            bits per component
 * @param transparency
 *            transparency information in the Mask format of the image
 *            dictionary
 * @return an object of type <CODE>ImgRaw</CODE>
 * @throws BadElementException
 *             on error
 */

public static Image getInstance(int width, int height, int components,
        int bpc, byte data[], int transparency[])
        throws BadElementException {
    if (transparency != null && transparency.length != components * 2)
        throw new BadElementException(
                "Transparency length must be equal to (componentes * 2)");
    if (components == 1 && bpc == 1) {
        byte g4[] = CCITTG4Encoder.compress(data, width, height);
        return Image.getInstance(width, height, false, Image.CCITTG4,
                Image.CCITT_BLACKIS1, g4, transparency);
    }
    Image img = new ImgRaw(width, height, components, bpc, data);
    img.transparency = transparency;
    return img;
}
项目:MesquiteArchive    文件:Image.java   
/**
 * Gets an instance of an Image in raw mode.
 * 
 * @param width
 *            the width of the image in pixels
 * @param height
 *            the height of the image in pixels
 * @param components
 *            1,3 or 4 for GrayScale, RGB and CMYK
 * @param data
 *            the image data
 * @param bpc
 *            bits per component
 * @param transparency
 *            transparency information in the Mask format of the image
 *            dictionary
 * @return an object of type <CODE>ImgRaw</CODE>
 * @throws BadElementException
 *             on error
 */

public static Image getInstance(int width, int height, int components,
        int bpc, byte data[], int transparency[])
        throws BadElementException {
    if (transparency != null && transparency.length != components * 2)
        throw new BadElementException(
                "Transparency length must be equal to (componentes * 2)");
    if (components == 1 && bpc == 1) {
        byte g4[] = CCITTG4Encoder.compress(data, width, height);
        return Image.getInstance(width, height, false, Image.CCITTG4,
                Image.CCITT_BLACKIS1, g4, transparency);
    }
    Image img = new ImgRaw(width, height, components, bpc, data);
    img.transparency = transparency;
    return img;
}
项目:MesquiteArchive    文件:Image.java   
/**
 * Gets an instance of an Image in raw mode.
 * 
 * @param width
 *            the width of the image in pixels
 * @param height
 *            the height of the image in pixels
 * @param components
 *            1,3 or 4 for GrayScale, RGB and CMYK
 * @param data
 *            the image data
 * @param bpc
 *            bits per component
 * @param transparency
 *            transparency information in the Mask format of the image
 *            dictionary
 * @return an object of type <CODE>ImgRaw</CODE>
 * @throws BadElementException
 *             on error
 */

public static Image getInstance(int width, int height, int components,
        int bpc, byte data[], int transparency[])
        throws BadElementException {
    if (transparency != null && transparency.length != components * 2)
        throw new BadElementException(
                "Transparency length must be equal to (componentes * 2)");
    if (components == 1 && bpc == 1) {
        byte g4[] = CCITTG4Encoder.compress(data, width, height);
        return Image.getInstance(width, height, false, Image.CCITTG4,
                Image.CCITT_BLACKIS1, g4, transparency);
    }
    Image img = new ImgRaw(width, height, components, bpc, data);
    img.transparency = transparency;
    return img;
}
项目:MesquiteArchive    文件:Image.java   
/**
 * Gets an instance of an Image in raw mode.
 * 
 * @param width
 *            the width of the image in pixels
 * @param height
 *            the height of the image in pixels
 * @param components
 *            1,3 or 4 for GrayScale, RGB and CMYK
 * @param data
 *            the image data
 * @param bpc
 *            bits per component
 * @param transparency
 *            transparency information in the Mask format of the image
 *            dictionary
 * @return an object of type <CODE>ImgRaw</CODE>
 * @throws BadElementException
 *             on error
 */

public static Image getInstance(int width, int height, int components,
        int bpc, byte data[], int transparency[])
        throws BadElementException {
    if (transparency != null && transparency.length != components * 2)
        throw new BadElementException(
                "Transparency length must be equal to (componentes * 2)");
    if (components == 1 && bpc == 1) {
        byte g4[] = CCITTG4Encoder.compress(data, width, height);
        return Image.getInstance(width, height, false, Image.CCITTG4,
                Image.CCITT_BLACKIS1, g4, transparency);
    }
    Image img = new ImgRaw(width, height, components, bpc, data);
    img.transparency = transparency;
    return img;
}
项目:MesquiteArchive    文件:Image.java   
/**
 * Gets an instance of an Image in raw mode.
 * 
 * @param width
 *            the width of the image in pixels
 * @param height
 *            the height of the image in pixels
 * @param components
 *            1,3 or 4 for GrayScale, RGB and CMYK
 * @param data
 *            the image data
 * @param bpc
 *            bits per component
 * @param transparency
 *            transparency information in the Mask format of the image
 *            dictionary
 * @return an object of type <CODE>ImgRaw</CODE>
 * @throws BadElementException
 *             on error
 */

public static Image getInstance(int width, int height, int components,
        int bpc, byte data[], int transparency[])
        throws BadElementException {
    if (transparency != null && transparency.length != components * 2)
        throw new BadElementException(
                "Transparency length must be equal to (componentes * 2)");
    if (components == 1 && bpc == 1) {
        byte g4[] = CCITTG4Encoder.compress(data, width, height);
        return Image.getInstance(width, height, false, Image.CCITTG4,
                Image.CCITT_BLACKIS1, g4, transparency);
    }
    Image img = new ImgRaw(width, height, components, bpc, data);
    img.transparency = transparency;
    return img;
}
项目:MesquiteArchive    文件:Image.java   
/**
 * Gets an instance of an Image in raw mode.
 * 
 * @param width
 *            the width of the image in pixels
 * @param height
 *            the height of the image in pixels
 * @param components
 *            1,3 or 4 for GrayScale, RGB and CMYK
 * @param data
 *            the image data
 * @param bpc
 *            bits per component
 * @param transparency
 *            transparency information in the Mask format of the image
 *            dictionary
 * @return an object of type <CODE>ImgRaw</CODE>
 * @throws BadElementException
 *             on error
 */

public static Image getInstance(int width, int height, int components,
        int bpc, byte data[], int transparency[])
        throws BadElementException {
    if (transparency != null && transparency.length != components * 2)
        throw new BadElementException(
                "Transparency length must be equal to (componentes * 2)");
    if (components == 1 && bpc == 1) {
        byte g4[] = CCITTG4Encoder.compress(data, width, height);
        return Image.getInstance(width, height, false, Image.CCITTG4,
                Image.CCITT_BLACKIS1, g4, transparency);
    }
    Image img = new ImgRaw(width, height, components, bpc, data);
    img.transparency = transparency;
    return img;
}
项目:MesquiteArchive    文件:Image.java   
/**
 * Gets an instance of an Image in raw mode.
 * 
 * @param width
 *            the width of the image in pixels
 * @param height
 *            the height of the image in pixels
 * @param components
 *            1,3 or 4 for GrayScale, RGB and CMYK
 * @param data
 *            the image data
 * @param bpc
 *            bits per component
 * @param transparency
 *            transparency information in the Mask format of the image
 *            dictionary
 * @return an object of type <CODE>ImgRaw</CODE>
 * @throws BadElementException
 *             on error
 */

public static Image getInstance(int width, int height, int components,
        int bpc, byte data[], int transparency[])
        throws BadElementException {
    if (transparency != null && transparency.length != components * 2)
        throw new BadElementException(
                "Transparency length must be equal to (componentes * 2)");
    if (components == 1 && bpc == 1) {
        byte g4[] = CCITTG4Encoder.compress(data, width, height);
        return Image.getInstance(width, height, false, Image.CCITTG4,
                Image.CCITT_BLACKIS1, g4, transparency);
    }
    Image img = new ImgRaw(width, height, components, bpc, data);
    img.transparency = transparency;
    return img;
}
项目:MesquiteArchive    文件:Image.java   
/**
 * Gets an instance of an Image in raw mode.
 * 
 * @param width
 *            the width of the image in pixels
 * @param height
 *            the height of the image in pixels
 * @param components
 *            1,3 or 4 for GrayScale, RGB and CMYK
 * @param data
 *            the image data
 * @param bpc
 *            bits per component
 * @param transparency
 *            transparency information in the Mask format of the image
 *            dictionary
 * @return an object of type <CODE>ImgRaw</CODE>
 * @throws BadElementException
 *             on error
 */

public static Image getInstance(int width, int height, int components,
        int bpc, byte data[], int transparency[])
        throws BadElementException {
    if (transparency != null && transparency.length != components * 2)
        throw new BadElementException(
                "Transparency length must be equal to (componentes * 2)");
    if (components == 1 && bpc == 1) {
        byte g4[] = CCITTG4Encoder.compress(data, width, height);
        return Image.getInstance(width, height, false, Image.CCITTG4,
                Image.CCITT_BLACKIS1, g4, transparency);
    }
    Image img = new ImgRaw(width, height, components, bpc, data);
    img.transparency = transparency;
    return img;
}
项目:MesquiteArchive    文件:Image.java   
/**
 * Gets an instance of an Image in raw mode.
 * 
 * @param width
 *            the width of the image in pixels
 * @param height
 *            the height of the image in pixels
 * @param components
 *            1,3 or 4 for GrayScale, RGB and CMYK
 * @param data
 *            the image data
 * @param bpc
 *            bits per component
 * @param transparency
 *            transparency information in the Mask format of the image
 *            dictionary
 * @return an object of type <CODE>ImgRaw</CODE>
 * @throws BadElementException
 *             on error
 */

public static Image getInstance(int width, int height, int components,
        int bpc, byte data[], int transparency[])
        throws BadElementException {
    if (transparency != null && transparency.length != components * 2)
        throw new BadElementException(
                "Transparency length must be equal to (componentes * 2)");
    if (components == 1 && bpc == 1) {
        byte g4[] = CCITTG4Encoder.compress(data, width, height);
        return Image.getInstance(width, height, false, Image.CCITTG4,
                Image.CCITT_BLACKIS1, g4, transparency);
    }
    Image img = new ImgRaw(width, height, components, bpc, data);
    img.transparency = transparency;
    return img;
}
项目:MesquiteArchive    文件:Image.java   
/**
 * Gets an instance of an Image in raw mode.
 * 
 * @param width
 *            the width of the image in pixels
 * @param height
 *            the height of the image in pixels
 * @param components
 *            1,3 or 4 for GrayScale, RGB and CMYK
 * @param data
 *            the image data
 * @param bpc
 *            bits per component
 * @param transparency
 *            transparency information in the Mask format of the image
 *            dictionary
 * @return an object of type <CODE>ImgRaw</CODE>
 * @throws BadElementException
 *             on error
 */

public static Image getInstance(int width, int height, int components,
        int bpc, byte data[], int transparency[])
        throws BadElementException {
    if (transparency != null && transparency.length != components * 2)
        throw new BadElementException(
                "Transparency length must be equal to (componentes * 2)");
    if (components == 1 && bpc == 1) {
        byte g4[] = CCITTG4Encoder.compress(data, width, height);
        return Image.getInstance(width, height, false, Image.CCITTG4,
                Image.CCITT_BLACKIS1, g4, transparency);
    }
    Image img = new ImgRaw(width, height, components, bpc, data);
    img.transparency = transparency;
    return img;
}
项目:MesquiteArchive    文件:Image.java   
/**
 * Gets an instance of an Image in raw mode.
 * 
 * @param width
 *            the width of the image in pixels
 * @param height
 *            the height of the image in pixels
 * @param components
 *            1,3 or 4 for GrayScale, RGB and CMYK
 * @param data
 *            the image data
 * @param bpc
 *            bits per component
 * @param transparency
 *            transparency information in the Mask format of the image
 *            dictionary
 * @return an object of type <CODE>ImgRaw</CODE>
 * @throws BadElementException
 *             on error
 */

public static Image getInstance(int width, int height, int components,
        int bpc, byte data[], int transparency[])
        throws BadElementException {
    if (transparency != null && transparency.length != components * 2)
        throw new BadElementException(
                "Transparency length must be equal to (componentes * 2)");
    if (components == 1 && bpc == 1) {
        byte g4[] = CCITTG4Encoder.compress(data, width, height);
        return Image.getInstance(width, height, false, Image.CCITTG4,
                Image.CCITT_BLACKIS1, g4, transparency);
    }
    Image img = new ImgRaw(width, height, components, bpc, data);
    img.transparency = transparency;
    return img;
}
项目:MesquiteArchive    文件:Image.java   
/**
 * Gets an instance of an Image in raw mode.
 * 
 * @param width
 *            the width of the image in pixels
 * @param height
 *            the height of the image in pixels
 * @param components
 *            1,3 or 4 for GrayScale, RGB and CMYK
 * @param data
 *            the image data
 * @param bpc
 *            bits per component
 * @param transparency
 *            transparency information in the Mask format of the image
 *            dictionary
 * @return an object of type <CODE>ImgRaw</CODE>
 * @throws BadElementException
 *             on error
 */

public static Image getInstance(int width, int height, int components,
        int bpc, byte data[], int transparency[])
        throws BadElementException {
    if (transparency != null && transparency.length != components * 2)
        throw new BadElementException(
                "Transparency length must be equal to (componentes * 2)");
    if (components == 1 && bpc == 1) {
        byte g4[] = CCITTG4Encoder.compress(data, width, height);
        return Image.getInstance(width, height, false, Image.CCITTG4,
                Image.CCITT_BLACKIS1, g4, transparency);
    }
    Image img = new ImgRaw(width, height, components, bpc, data);
    img.transparency = transparency;
    return img;
}
项目:MesquiteArchive    文件:Image.java   
/**
 * Gets an instance of an Image in raw mode.
 * 
 * @param width
 *            the width of the image in pixels
 * @param height
 *            the height of the image in pixels
 * @param components
 *            1,3 or 4 for GrayScale, RGB and CMYK
 * @param data
 *            the image data
 * @param bpc
 *            bits per component
 * @param transparency
 *            transparency information in the Mask format of the image
 *            dictionary
 * @return an object of type <CODE>ImgRaw</CODE>
 * @throws BadElementException
 *             on error
 */

public static Image getInstance(int width, int height, int components,
        int bpc, byte data[], int transparency[])
        throws BadElementException {
    if (transparency != null && transparency.length != components * 2)
        throw new BadElementException(
                "Transparency length must be equal to (componentes * 2)");
    if (components == 1 && bpc == 1) {
        byte g4[] = CCITTG4Encoder.compress(data, width, height);
        return Image.getInstance(width, height, false, Image.CCITTG4,
                Image.CCITT_BLACKIS1, g4, transparency);
    }
    Image img = new ImgRaw(width, height, components, bpc, data);
    img.transparency = transparency;
    return img;
}
项目:MesquiteArchive    文件:Image.java   
/**
 * Gets an instance of an Image in raw mode.
 * 
 * @param width
 *            the width of the image in pixels
 * @param height
 *            the height of the image in pixels
 * @param components
 *            1,3 or 4 for GrayScale, RGB and CMYK
 * @param data
 *            the image data
 * @param bpc
 *            bits per component
 * @param transparency
 *            transparency information in the Mask format of the image
 *            dictionary
 * @return an object of type <CODE>ImgRaw</CODE>
 * @throws BadElementException
 *             on error
 */

public static Image getInstance(int width, int height, int components,
        int bpc, byte data[], int transparency[])
        throws BadElementException {
    if (transparency != null && transparency.length != components * 2)
        throw new BadElementException(
                "Transparency length must be equal to (componentes * 2)");
    if (components == 1 && bpc == 1) {
        byte g4[] = CCITTG4Encoder.compress(data, width, height);
        return Image.getInstance(width, height, false, Image.CCITTG4,
                Image.CCITT_BLACKIS1, g4, transparency);
    }
    Image img = new ImgRaw(width, height, components, bpc, data);
    img.transparency = transparency;
    return img;
}
项目:MesquiteArchive    文件:Image.java   
/**
 * Gets an instance of an Image in raw mode.
 * 
 * @param width
 *            the width of the image in pixels
 * @param height
 *            the height of the image in pixels
 * @param components
 *            1,3 or 4 for GrayScale, RGB and CMYK
 * @param data
 *            the image data
 * @param bpc
 *            bits per component
 * @param transparency
 *            transparency information in the Mask format of the image
 *            dictionary
 * @return an object of type <CODE>ImgRaw</CODE>
 * @throws BadElementException
 *             on error
 */

public static Image getInstance(int width, int height, int components,
        int bpc, byte data[], int transparency[])
        throws BadElementException {
    if (transparency != null && transparency.length != components * 2)
        throw new BadElementException(
                "Transparency length must be equal to (componentes * 2)");
    if (components == 1 && bpc == 1) {
        byte g4[] = CCITTG4Encoder.compress(data, width, height);
        return Image.getInstance(width, height, false, Image.CCITTG4,
                Image.CCITT_BLACKIS1, g4, transparency);
    }
    Image img = new ImgRaw(width, height, components, bpc, data);
    img.transparency = transparency;
    return img;
}
项目:MesquiteArchive    文件:Image.java   
/**
 * Gets an instance of an Image in raw mode.
 * 
 * @param width
 *            the width of the image in pixels
 * @param height
 *            the height of the image in pixels
 * @param components
 *            1,3 or 4 for GrayScale, RGB and CMYK
 * @param data
 *            the image data
 * @param bpc
 *            bits per component
 * @param transparency
 *            transparency information in the Mask format of the image
 *            dictionary
 * @return an object of type <CODE>ImgRaw</CODE>
 * @throws BadElementException
 *             on error
 */

public static Image getInstance(int width, int height, int components,
        int bpc, byte data[], int transparency[])
        throws BadElementException {
    if (transparency != null && transparency.length != components * 2)
        throw new BadElementException(
                "Transparency length must be equal to (componentes * 2)");
    if (components == 1 && bpc == 1) {
        byte g4[] = CCITTG4Encoder.compress(data, width, height);
        return Image.getInstance(width, height, false, Image.CCITTG4,
                Image.CCITT_BLACKIS1, g4, transparency);
    }
    Image img = new ImgRaw(width, height, components, bpc, data);
    img.transparency = transparency;
    return img;
}
项目:MesquiteArchive    文件:Image.java   
/**
 * Gets an instance of an Image in raw mode.
 * 
 * @param width
 *            the width of the image in pixels
 * @param height
 *            the height of the image in pixels
 * @param components
 *            1,3 or 4 for GrayScale, RGB and CMYK
 * @param data
 *            the image data
 * @param bpc
 *            bits per component
 * @param transparency
 *            transparency information in the Mask format of the image
 *            dictionary
 * @return an object of type <CODE>ImgRaw</CODE>
 * @throws BadElementException
 *             on error
 */

public static Image getInstance(int width, int height, int components,
        int bpc, byte data[], int transparency[])
        throws BadElementException {
    if (transparency != null && transparency.length != components * 2)
        throw new BadElementException(
                "Transparency length must be equal to (componentes * 2)");
    if (components == 1 && bpc == 1) {
        byte g4[] = CCITTG4Encoder.compress(data, width, height);
        return Image.getInstance(width, height, false, Image.CCITTG4,
                Image.CCITT_BLACKIS1, g4, transparency);
    }
    Image img = new ImgRaw(width, height, components, bpc, data);
    img.transparency = transparency;
    return img;
}
项目:MesquiteCore    文件:Image.java   
/**
 * Gets an instance of an Image in raw mode.
 * 
 * @param width
 *            the width of the image in pixels
 * @param height
 *            the height of the image in pixels
 * @param components
 *            1,3 or 4 for GrayScale, RGB and CMYK
 * @param data
 *            the image data
 * @param bpc
 *            bits per component
 * @param transparency
 *            transparency information in the Mask format of the image
 *            dictionary
 * @return an object of type <CODE>ImgRaw</CODE>
 * @throws BadElementException
 *             on error
 */

public static Image getInstance(int width, int height, int components,
        int bpc, byte data[], int transparency[])
        throws BadElementException {
    if (transparency != null && transparency.length != components * 2)
        throw new BadElementException(
                "Transparency length must be equal to (componentes * 2)");
    if (components == 1 && bpc == 1) {
        byte g4[] = CCITTG4Encoder.compress(data, width, height);
        return Image.getInstance(width, height, false, Image.CCITTG4,
                Image.CCITT_BLACKIS1, g4, transparency);
    }
    Image img = new ImgRaw(width, height, components, bpc, data);
    img.transparency = transparency;
    return img;
}
项目:itext2    文件:BarcodePDF417.java   
/** Gets an <CODE>Image</CODE> with the barcode. The image will have to be
 * scaled in the Y direction by <CODE>yHeight</CODE>for the barcode
 * to have the right printing aspect.
 * @return the barcode <CODE>Image</CODE>
 * @throws BadElementException on error
 */    
public Image getImage() throws BadElementException {
    paintCode();
    byte g4[] = CCITTG4Encoder.compress(outBits, bitColumns, codeRows);
    return Image.getInstance(bitColumns, codeRows, false, Image.CCITTG4, (options & PDF417_INVERT_BITMAP) == 0 ? 0 : Image.CCITT_BLACKIS1, g4, null);
}
项目:DroidText    文件:BarcodePDF417.java   
/** Gets an <CODE>Image</CODE> with the barcode. The image will have to be
 * scaled in the Y direction by <CODE>yHeight</CODE>for the barcode
 * to have the right printing aspect.
 * @return the barcode <CODE>Image</CODE>
 * @throws BadElementException on error
 */    
public Image getImage() throws BadElementException {
    paintCode();
    byte g4[] = CCITTG4Encoder.compress(outBits, bitColumns, codeRows);
    return Image.getInstance(bitColumns, codeRows, false, Image.CCITTG4, (options & PDF417_INVERT_BITMAP) == 0 ? 0 : Image.CCITT_BLACKIS1, g4, null);
}