/*
 * SDK Pullenti Unitext, version 4.33, fabruary 2026. Copyright (c) 2013-2026, Pullenti. All rights reserved. 
 * Non-Commercial Freeware and Commercial Software. 
 * This class is generated using the converter Unisharping (www.unisharping.ru) from Pullenti C# project. 
 * The latest version of the code is available on the site www.pullenti.ru
 */

package com.pullenti.unitext.internal.misc;

public class PngHead extends PngChunk {

    public int getWidth() {
        int i0 = 0;
        int res = Byte.toUnsignedInt(data[i0]);
        res <<= 8;
        res |= (Byte.toUnsignedInt(data[i0 + 1]));
        res <<= 8;
        res |= (Byte.toUnsignedInt(data[i0 + 2]));
        res <<= 8;
        res |= (Byte.toUnsignedInt(data[i0 + 3]));
        return res;
    }

    public int setWidth(int value) {
        int i0 = 0;
        data[i0] = (byte)((((value >> 24)) & 0xFF));
        data[i0 + 1] = (byte)((((value >> 16)) & 0xFF));
        data[i0 + 2] = (byte)((((value >> 8)) & 0xFF));
        data[i0 + 3] = (byte)(((value) & 0xFF));
        return value;
    }


    public int getHeight() {
        int i0 = 4;
        int res = Byte.toUnsignedInt(data[i0]);
        res <<= 8;
        res |= (Byte.toUnsignedInt(data[i0 + 1]));
        res <<= 8;
        res |= (Byte.toUnsignedInt(data[i0 + 2]));
        res <<= 8;
        res |= (Byte.toUnsignedInt(data[i0 + 3]));
        return res;
    }

    public int setHeight(int value) {
        int i0 = 4;
        data[i0] = (byte)((((value >> 24)) & 0xFF));
        data[i0 + 1] = (byte)((((value >> 16)) & 0xFF));
        data[i0 + 2] = (byte)((((value >> 8)) & 0xFF));
        data[i0 + 3] = (byte)(((value) & 0xFF));
        return value;
    }


    public byte getBitDepth() {
        return data[8];
    }

    public byte setBitDepth(byte value) {
        data[8] = value;
        return value;
    }


    public byte getColorType() {
        return data[9];
    }

    public byte setColorType(byte value) {
        data[9] = value;
        return value;
    }


    public byte getCompression() {
        return data[10];
    }

    public byte setCompression(byte value) {
        data[10] = value;
        return value;
    }


    public byte getFilter() {
        return data[11];
    }

    public byte setFilter(byte value) {
        data[11] = value;
        return value;
    }


    public byte getInterlace() {
        return data[12];
    }

    public byte setInterlace(byte value) {
        data[12] = value;
        return value;
    }


    public PngHead() {
        super("IHDR");
        data = new byte[13];
        setBitDepth((byte)8);
    }
}
