Package net.sourceforge.jiu.data

Examples of net.sourceforge.jiu.data.MemoryBilevelImage


  {
    final int HEIGHT = in.getHeight();
    final int WIDTH = in.getWidth();
    if (out == null)
    {
      out = new MemoryBilevelImage(WIDTH, HEIGHT);
    }
    final int NUM_ERROR_PIXELS = errorNum.length;
    // create buffer
    int[] buffer = new int[newWidth * numRows];
    //System.out.println("buffer  length=" + buffer.length);
View Full Code Here


  private void process(Gray8Image in, BilevelImage out)
  {
    if (out == null)
    {
      out = new MemoryBilevelImage(in.getWidth(), in.getHeight());
      setOutputImage(out);
    }
    if (values == null)
    {
      setStandardThresholdValues();
View Full Code Here

      throw new WrongParameterException("Input image must implement GrayIntegerImage.");
    }
    PixelImage out = getOutputImage();
    if (out == null)
    {
      out = new MemoryBilevelImage(in.getWidth(), in.getHeight());
      setOutputImage(out);
    }
    else
    {
      if (!(out instanceof BilevelImage))
View Full Code Here

  private void process(GrayIntegerImage in, final int MASK, BilevelImage out)
  {
    if (out == null)
    {
      out = new MemoryBilevelImage(in.getWidth(), in.getHeight());
    }
    out.clear(BilevelImage.BLACK);
    for (int y = 0; y < in.getHeight(); y++)
    {
      for (int x = 0; x < in.getWidth(); x++)
View Full Code Here

      throw new WrongParameterException("Input image must implement GrayIntegerImage.");
    }
    PixelImage out = getOutputImage();
    if (out == null)
    {
      out = new MemoryBilevelImage(in.getWidth(), in.getHeight());
      setOutputImage(out);
    }
    if (out != null && !(out instanceof BilevelImage))
    {
      throw new WrongParameterException("Output image must implement BilevelImage.");
View Full Code Here

   * Creates a bilevel image from any grayscale (or RGB) image
   * that has been checked to be bilevel.
   */
  private void createBilevelFromGrayOrRgb(IntegerImage in)
  {
    MemoryBilevelImage out = new MemoryBilevelImage(in.getWidth(), in.getHeight());
    out.clear(BilevelImage.BLACK);
    for (int y = 0; y < in.getHeight(); y++)
    {
      for (int x = 0; x < in.getWidth(); x++)
      {
        if (in.getSample(0, x, y) != 0)
        {
          out.putWhite(x, y);
        }
      }
      setProgress(y, in.getHeight());
    }
    outputImage = out;
View Full Code Here

  }

  private void createBilevelFromPaletted(Paletted8Image in)
  {
    Palette palette = in.getPalette();
    MemoryBilevelImage out = new MemoryBilevelImage(in.getWidth(), in.getHeight());
    out.clear(BilevelImage.BLACK);
    for (int y = 0; y < in.getHeight(); y++)
    {
      for (int x = 0; x < in.getWidth(); x++)
      {
        if (palette.getSample(RGBIndex.INDEX_RED, in.getSample(0, x, y)) != 0)
        {
          out.putWhite(x, y);
        }
      }
      setProgress(y, in.getHeight());
    }
    outputImage = out;
View Full Code Here

      switch (imageType)
      {
        case(TIFFImageFileDirectory.TYPE_BILEVEL_BYTE):
        case(TIFFImageFileDirectory.TYPE_BILEVEL_PACKED):
        {
          image = new MemoryBilevelImage(width, height);
          break;
        }
        case(TIFFImageFileDirectory.TYPE_GRAY4):
        case(TIFFImageFileDirectory.TYPE_GRAY8):
        case(TIFFImageFileDirectory.TYPE_LOGL):
View Full Code Here

    int h = getBoundsHeight();
    if (colorType == COLOR_TYPE_GRAY || colorType == COLOR_TYPE_GRAY_ALPHA)
    {
      if (precision == 1)
      {
        image = new MemoryBilevelImage(w, h);
      }
      else
      if (precision <= 8)
      {
        image = new MemoryGray8Image(w, h);
View Full Code Here

    WrongParameterException
  {
    PixelImage image = getImage();
    if (image == null)
    {
      setImage(new MemoryBilevelImage(getBoundsWidth(), getBoundsHeight()));
    }
    else
    {
      if (!(image instanceof BilevelImage))
      {
View Full Code Here

TOP

Related Classes of net.sourceforge.jiu.data.MemoryBilevelImage

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.