package yi.iu.processor.texture.reg;

import java.util.*;
import java.awt.*;
import yi.iu.region.Region;
import yi.iu.processor.color.CIELab;
import yi.util.data.Conversion;
/**
 * Class DS_ColorPatternRegions is to represent and store the segmentation
 * results from processor ColorPatternSeg.
 * @see yi.iu.processor.texture.reg.ColorPatternSeg
 */
public class DS_ColorPatternRegions implements java.io.Serializable{
  /**
   * The labels of color patterned regions.  The segmentation result.
   */
  int[] m_labels;
  /**
   * The number of the labels
   */
  int m_labelNum;
  /**
   * Image width and height
   */
  int m_width, m_height;
  /**
   * The color pattern regions
   */
  ColorPatternRegion[] m_colorPatternRegions;

  /**
   * For Castor
   */
  public DS_ColorPatternRegions() {
  }

  /**
   * Simple constructor
   * @param colors the colors
   * @param color_num the color number
   * @param labels the lable of pixels representing the region index
   * @param label_num the number of regions
   * @param regionColors for each region, a hashmap is used to store the map
   *                     from the color index to pixel count of that color
   * @param width image width
   * @param height image height
   */
  public DS_ColorPatternRegions(
    int[] labels, int label_num,
    ColorPatternRegion[] color_regions, int width, int height) {
      m_labels = labels;
      m_labelNum = label_num;
      m_width = width;
      m_height = height;

      m_colorPatternRegions = color_regions;
  }

  public int getImageWidth() {
    return m_width;
  }

  public void setImageWidth(int w) {
    m_width = w;
  }

  public int getImageHeight() {
    return m_height;
  }

  public void setImageHeight(int h) {
    m_height = h;
  }

  public void setLabelNum(int num) {
    m_labelNum = num;
  }

  public int getLabelNum() {
    return m_labelNum;
  }

  public ColorPatternRegion[] getColorPatternRegions() {
    return m_colorPatternRegions;
  }

  public void setColorPatternRegions(ColorPatternRegion[] regions) {
    m_colorPatternRegions = regions;
  }

  public int[] getLabels() {
    return m_labels;
  }

}