ResImageViewCreate.java 9.25 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.scene7.is.ipp.messages;

import com.scene7.is.ipp.messages.InMessage;
import com.scene7.is.ipp.messages.Ipp;
import com.scene7.is.ipp.messages.IppByteArray;
import com.scene7.is.ipp.messages.IppColorModelType;
import com.scene7.is.ipp.messages.IppDate;
import com.scene7.is.ipp.messages.IppDouble;
import com.scene7.is.ipp.messages.IppInt;
import com.scene7.is.ipp.messages.IppInt64;
import com.scene7.is.ipp.messages.IppString;
import com.scene7.is.ipp.messages.Offset;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.io.Writer;

public class ResImageViewCreate
extends InMessage {
    static int MessageNumber = 131855;
    private int viewId_;
    private int stateId_;
    private int imageXDim_;
    private int imageYDim_;
    private int tileXDim_;
    private int tileYDim_;
    private byte[] encodingData_;
    private long created_;
    private long modified_;
    private String physicalPath_;
    private byte[] imageKey_;
    private int colorModel_;
    private double xDpi_;
    private double yDpi_;
    private int textXOffset_;
    private int textYOffset_;

    public ResImageViewCreate(int tag, int viewId, int stateId, int imageXDim, int imageYDim, int tileXDim, int tileYDim, byte[] encodingData, long created, long modified, String physicalPath, byte[] imageKey, int colorModel, double xDpi, double yDpi, int textXOffset, int textYOffset, int headClientId) {
        this.tag_ = tag;
        this.headerClientId_ = headClientId;
        this.viewId_ = viewId;
        this.stateId_ = stateId;
        this.imageXDim_ = imageXDim;
        this.imageYDim_ = imageYDim;
        this.tileXDim_ = tileXDim;
        this.tileYDim_ = tileYDim;
        this.encodingData_ = encodingData;
        this.created_ = created;
        this.modified_ = modified;
        this.physicalPath_ = physicalPath;
        this.imageKey_ = imageKey;
        this.colorModel_ = colorModel;
        this.xDpi_ = xDpi;
        this.yDpi_ = yDpi;
        this.textXOffset_ = textXOffset;
        this.textYOffset_ = textYOffset;
        int fixedLength = 88;
        Offset varPos = new Offset(fixedLength);
        varPos.val += encodingData.length;
        try {
            varPos.val += physicalPath.getBytes("UTF-8").length + 1;
        }
        catch (UnsupportedEncodingException e) {
            throw new AssertionError(e);
        }
        varPos.val += imageKey.length;
        this.messageLength_ = varPos.val;
        varPos.val = fixedLength;
        Offset pos = new Offset(0);
        this.headBuffer_ = new byte[32];
        this.bodyBuffer_ = new byte[this.messageLength_];
        Ipp.StuffHeader(this.headBuffer_, this.headerClientId_, tag, MessageNumber, this.messageLength_);
        IppInt.Stuff(this.bodyBuffer_, pos, null, this.viewId_);
        IppInt.Stuff(this.bodyBuffer_, pos, null, this.stateId_);
        IppInt.Stuff(this.bodyBuffer_, pos, null, this.imageXDim_);
        IppInt.Stuff(this.bodyBuffer_, pos, null, this.imageYDim_);
        IppInt.Stuff(this.bodyBuffer_, pos, null, this.tileXDim_);
        IppInt.Stuff(this.bodyBuffer_, pos, null, this.tileYDim_);
        IppByteArray.Stuff(this.bodyBuffer_, pos, varPos, this.encodingData_);
        IppInt64.Stuff(this.bodyBuffer_, pos, null, this.created_);
        IppInt64.Stuff(this.bodyBuffer_, pos, null, this.modified_);
        IppString.Stuff(this.bodyBuffer_, pos, varPos, this.physicalPath_);
        IppByteArray.Stuff(this.bodyBuffer_, pos, varPos, this.imageKey_);
        IppInt.Stuff(this.bodyBuffer_, pos, null, this.colorModel_);
        IppDouble.Stuff(this.bodyBuffer_, pos, null, this.xDpi_);
        IppDouble.Stuff(this.bodyBuffer_, pos, null, this.yDpi_);
        IppInt.Stuff(this.bodyBuffer_, pos, null, this.textXOffset_);
        IppInt.Stuff(this.bodyBuffer_, pos, null, this.textYOffset_);
        Ipp.Assert(pos.val == fixedLength, "IppWatermarkType length");
    }

    public ResImageViewCreate() {
    }

    public void process(int headClientId, int tg, byte[] bf) {
        this.headerClientId_ = headClientId;
        this.tag_ = tg;
        this.messageLength_ = bf.length;
        this.headBuffer_ = new byte[32];
        Ipp.StuffHeader(this.headBuffer_, this.headerClientId_, this.tag_, MessageNumber, this.messageLength_);
        this.bodyBuffer_ = bf;
        Offset pos = new Offset(0);
        this.viewId_ = IppInt.Unstuff(this.bodyBuffer_, pos);
        this.stateId_ = IppInt.Unstuff(this.bodyBuffer_, pos);
        this.imageXDim_ = IppInt.Unstuff(this.bodyBuffer_, pos);
        this.imageYDim_ = IppInt.Unstuff(this.bodyBuffer_, pos);
        this.tileXDim_ = IppInt.Unstuff(this.bodyBuffer_, pos);
        this.tileYDim_ = IppInt.Unstuff(this.bodyBuffer_, pos);
        this.encodingData_ = IppByteArray.Unstuff(this.bodyBuffer_, pos);
        this.created_ = IppInt64.Unstuff(this.bodyBuffer_, pos);
        this.modified_ = IppInt64.Unstuff(this.bodyBuffer_, pos);
        this.physicalPath_ = IppString.Unstuff(this.bodyBuffer_, pos);
        this.imageKey_ = IppByteArray.Unstuff(this.bodyBuffer_, pos);
        this.colorModel_ = IppInt.Unstuff(this.bodyBuffer_, pos);
        this.xDpi_ = IppDouble.Unstuff(this.bodyBuffer_, pos);
        this.yDpi_ = IppDouble.Unstuff(this.bodyBuffer_, pos);
        this.textXOffset_ = IppInt.Unstuff(this.bodyBuffer_, pos);
        this.textYOffset_ = IppInt.Unstuff(this.bodyBuffer_, pos);
    }

    public int classification() {
        return 1;
    }

    public int id() {
        return MessageNumber;
    }

    public void print(Writer tf, String heading) throws IOException {
        tf.write("\n");
        tf.write(heading);
        tf.write(": ResImageViewCreate ");
        Ipp.PrintHex(tf, MessageNumber);
        tf.write("\n");
        tf.write("headClientId: " + this.headerClientId() + "\n");
        Ipp.PrintTag(tf, "tag: ", this.tag());
        tf.write("length: " + this.length());
        tf.write("\n");
        IppInt.Print(tf, "viewId: ", this.viewId_);
        IppInt.Print(tf, "stateId: ", this.stateId_);
        IppInt.Print(tf, "imageXDim: ", this.imageXDim_);
        IppInt.Print(tf, "imageYDim: ", this.imageYDim_);
        IppInt.Print(tf, "tileXDim: ", this.tileXDim_);
        IppInt.Print(tf, "tileYDim: ", this.tileYDim_);
        IppByteArray.Print(tf, "encodingData: ", this.encodingData_);
        IppDate.Print(tf, "created: ", this.created_);
        IppDate.Print(tf, "modified: ", this.modified_);
        IppString.Print(tf, "physicalPath: ", this.physicalPath_);
        IppByteArray.Print(tf, "imageKey: ", this.imageKey_);
        IppColorModelType.Print(tf, "colorModel: ", this.colorModel_);
        IppDouble.Print(tf, "xDpi: ", this.xDpi_);
        IppDouble.Print(tf, "yDpi: ", this.yDpi_);
        IppInt.Print(tf, "textXOffset: ", this.textXOffset_);
        IppInt.Print(tf, "textYOffset: ", this.textYOffset_);
    }

    public String toString() {
        StringBuffer buffer = new StringBuffer();
        buffer.append("ResImageViewCreate            ");
        buffer.append("[viewId: " + String.valueOf(this.viewId_) + "],");
        buffer.append("[stateId: " + String.valueOf(this.stateId_) + "],");
        buffer.append("[imageXDim: " + String.valueOf(this.imageXDim_) + "],");
        buffer.append("[imageYDim: " + String.valueOf(this.imageYDim_) + "],");
        buffer.append("[tileXDim: " + String.valueOf(this.tileXDim_) + "],");
        buffer.append("[tileYDim: " + String.valueOf(this.tileYDim_) + "],");
        buffer.append("[encodingData: " + String.valueOf(this.encodingData_) + "],");
        buffer.append("[created: " + String.valueOf(this.created_) + "],");
        buffer.append("[modified: " + String.valueOf(this.modified_) + "],");
        buffer.append("[physicalPath: " + String.valueOf(this.physicalPath_) + "],");
        buffer.append("[imageKey: " + String.valueOf(this.imageKey_) + "],");
        buffer.append("[colorModel: " + String.valueOf(this.colorModel_) + "],");
        buffer.append("[xDpi: " + String.valueOf(this.xDpi_) + "],");
        buffer.append("[yDpi: " + String.valueOf(this.yDpi_) + "],");
        buffer.append("[textXOffset: " + String.valueOf(this.textXOffset_) + "],");
        buffer.append("[textYOffset: " + String.valueOf(this.textYOffset_) + "],");
        return buffer.toString();
    }

    public int viewId() {
        return this.viewId_;
    }

    public int stateId() {
        return this.stateId_;
    }

    public int imageXDim() {
        return this.imageXDim_;
    }

    public int imageYDim() {
        return this.imageYDim_;
    }

    public int tileXDim() {
        return this.tileXDim_;
    }

    public int tileYDim() {
        return this.tileYDim_;
    }

    public byte[] encodingData() {
        return this.encodingData_;
    }

    public long created() {
        return this.created_;
    }

    public long modified() {
        return this.modified_;
    }

    public String physicalPath() {
        return this.physicalPath_;
    }

    public byte[] imageKey() {
        return this.imageKey_;
    }

    public int colorModel() {
        return this.colorModel_;
    }

    public double xDpi() {
        return this.xDpi_;
    }

    public double yDpi() {
        return this.yDpi_;
    }

    public int textXOffset() {
        return this.textXOffset_;
    }

    public int textYOffset() {
        return this.textYOffset_;
    }
}