/*
 * 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
 */


const PngChunk = require("./PngChunk");

class PngHead extends PngChunk {
    
    get width() {
        let i0 = 0;
        let res = this.data[i0];
        res <<= 8;
        res |= (this.data[i0 + 1]);
        res <<= 8;
        res |= (this.data[i0 + 2]);
        res <<= 8;
        res |= (this.data[i0 + 3]);
        return res;
    }
    set width(value) {
        let i0 = 0;
        this.data[i0] = (((value >> 24)) & 0xFF);
        this.data[i0 + 1] = (((value >> 16)) & 0xFF);
        this.data[i0 + 2] = (((value >> 8)) & 0xFF);
        this.data[i0 + 3] = ((value) & 0xFF);
        return value;
    }
    
    get height() {
        let i0 = 4;
        let res = this.data[i0];
        res <<= 8;
        res |= (this.data[i0 + 1]);
        res <<= 8;
        res |= (this.data[i0 + 2]);
        res <<= 8;
        res |= (this.data[i0 + 3]);
        return res;
    }
    set height(value) {
        let i0 = 4;
        this.data[i0] = (((value >> 24)) & 0xFF);
        this.data[i0 + 1] = (((value >> 16)) & 0xFF);
        this.data[i0 + 2] = (((value >> 8)) & 0xFF);
        this.data[i0 + 3] = ((value) & 0xFF);
        return value;
    }
    
    get bitDepth() {
        return this.data[8];
    }
    set bitDepth(value) {
        this.data[8] = value;
        return value;
    }
    
    get colorType() {
        return this.data[9];
    }
    set colorType(value) {
        this.data[9] = value;
        return value;
    }
    
    get compression() {
        return this.data[10];
    }
    set compression(value) {
        this.data[10] = value;
        return value;
    }
    
    get filter() {
        return this.data[11];
    }
    set filter(value) {
        this.data[11] = value;
        return value;
    }
    
    get interlace() {
        return this.data[12];
    }
    set interlace(value) {
        this.data[12] = value;
        return value;
    }
    
    constructor() {
        super("IHDR");
        this.data = new Uint8Array(13);
        this.bitDepth = 8;
    }
}


module.exports = PngHead