Ejemplo n.º 1
0
  /** {@inheritDoc} */
  public void writeToStream(OutputStream os) throws IOException {
    byte[] data = new byte[11];
    copySF(data, Type.MAP, Category.IMAGE);
    int tripletLen = getTripletDataLength();

    byte[] len = BinaryUtils.convert(10 + tripletLen, 2);
    data[1] = len[0];
    data[2] = len[1];

    len = BinaryUtils.convert(2 + tripletLen, 2);
    data[9] = len[0];
    data[10] = len[1];
    os.write(data);
    writeTriplets(os);
  }
Ejemplo n.º 2
0
  /** {@inheritDoc} */
  public void writeToStream(OutputStream os) throws IOException {
    byte[] data = new byte[9];
    copySF(data, Type.DATA, Category.IM_IMAGE);
    // The size of the structured field
    byte[] len = BinaryUtils.convert(rasterData.length + 8, 2);
    data[1] = len[0];
    data[2] = len[1];
    os.write(data);

    os.write(rasterData);
  }
Ejemplo n.º 3
0
  /** {@inheritDoc} */
  @Override
  public void writeToStream(final OutputStream os) throws IOException {

    final byte[] data = new byte[45];
    copySF(data, Type.DESCRIPTOR, Category.IM_IMAGE);

    data[1] = 0x00; // length
    data[2] = 0x2C;

    // Constant data.
    data[9] = 0x00;
    data[10] = 0x00;
    data[11] = 0x09;
    data[12] = 0x60;
    data[13] = 0x09;
    data[14] = 0x60;
    data[15] = 0x00;
    data[16] = 0x00;
    data[17] = 0x00;
    data[18] = 0x00;
    data[19] = 0x00;
    data[20] = 0x00;

    // X Base (Fixed x00)
    data[21] = 0x00;
    // Y Base (Fixed x00)
    data[22] = 0x00;

    final byte[] imagepoints = BinaryUtils.convert(this.resolution * 10, 2);

    /**
     * Specifies the number of image points per unit base for the X axis of the image. This value is
     * ten times the resolution of the image in the X direction.
     */
    data[23] = imagepoints[0];
    data[24] = imagepoints[1];

    /**
     * Specifies the number of image points per unit base for the Y axis of the image. This value is
     * ten times the resolution of the image in the Y direction.
     */
    data[25] = imagepoints[0];
    data[26] = imagepoints[1];

    /**
     * Specifies the extent in the X direction, in image points, of an non-celled (simple) image.
     */
    data[27] = 0x00;
    data[28] = 0x01;

    /**
     * Specifies the extent in the Y direction, in image points, of an non-celled (simple) image.
     */
    data[29] = 0x00;
    data[30] = 0x01;

    // Constant Data
    data[31] = 0x00;
    data[32] = 0x00;
    data[33] = 0x00;
    data[34] = 0x00;
    data[35] = 0x2D;
    data[36] = 0x00;

    // Default size of image cell in X direction
    data[37] = 0x00;
    data[38] = 0x01;

    // Default size of image cell in Y direction
    data[39] = 0x00;
    data[40] = 0x01;

    // Constant Data
    data[41] = 0x00;
    data[42] = 0x01;

    // Image Color
    data[43] = (byte) 0xFF;
    data[44] = (byte) 0xFF;

    os.write(data);
  }