Exemple #1
0
  /** @noRefGuide */
  public int initialize() {
    super.initialize();

    // this may be different depending on the image
    m_channelsCount = 3;

    String vhash = getParamString(imageParams);

    Object co = ParamCache.getInstance().get(vhash);
    if (co == null) {
      long t0 = time();
      int res = prepareImage();

      printf("sizeX: %f\n", m_sizeX);
      printf("sizeY: %f\n", m_sizeY);
      printf("sizeZ: %f\n", m_sizeZ);
      printf("originX: %f\n", m_originX);
      printf("originY: %f\n", m_originY);
      printf("originZ: %f\n", m_originZ);
      printf("imageSizeX: %d\n", m_imageSizeX);
      printf("imageSizeY: %d\n", m_imageSizeY);

      printf("ImageColorMap.prepareImage() time: %d ms\n", (time() - t0));

      if (res != ResultCodes.RESULT_OK) {
        // something wrong with the image
        throw new IllegalArgumentException("undefined image");
      }

      ParamCache.getInstance().put(vhash, m_imageData);

    } else {
      m_imageData = (ImageColor) co;
    }

    Vector3d center = (Vector3d) mp_center.getValue();
    Vector3d size = (Vector3d) mp_size.getValue();
    m_originX = center.x - size.x / 2;
    m_originY = center.y - size.y / 2;
    m_originZ = center.z - size.z / 2;
    m_sizeX = size.x;
    m_sizeY = size.y;
    m_sizeZ = size.z;

    m_imageSizeX = m_imageData.getWidth();
    m_imageSizeY = m_imageData.getHeight();
    m_repeatX = mp_repeatX.getValue();
    m_repeatY = mp_repeatY.getValue();

    return ResultCodes.RESULT_OK;
  }
Exemple #2
0
 /** Is repeatY set */
 public boolean getRepeatY() {
   return mp_repeatY.getValue();
 }