X-Git-Url: http://www2.svjatoslav.eu/gitweb/?p=imagesqueeze.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fimagesqueeze%2Fcodec%2FImageMetaData.java;h=22163e33a7558df76e1f22ed93af575325c4b439;hp=49e9000032b56630140001124591c075b083e010;hb=4595d6b97aff8e6d9dcce902bc2f1119d4ab2f0e;hpb=a4acb4f31760b0c654f9a041eef9797782d6043a diff --git a/src/main/java/eu/svjatoslav/imagesqueeze/codec/ImageMetaData.java b/src/main/java/eu/svjatoslav/imagesqueeze/codec/ImageMetaData.java index 49e9000..22163e3 100755 --- a/src/main/java/eu/svjatoslav/imagesqueeze/codec/ImageMetaData.java +++ b/src/main/java/eu/svjatoslav/imagesqueeze/codec/ImageMetaData.java @@ -1,10 +1,9 @@ /* - * Imagesqueeze - Image codec optimized for photos. - * Copyright (C) 2012, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Imagesqueeze - Image codec. Copyright ©2012-2019, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation. + * modify it under the terms of version 3 of the GNU Lesser General Public License + * or later as published by the Free Software Foundation. */ package eu.svjatoslav.imagesqueeze.codec; @@ -14,27 +13,27 @@ package eu.svjatoslav.imagesqueeze.codec; * Like image dimensions, header version, compression quality, etc.. */ -import java.io.IOException; - import eu.svjatoslav.commons.data.BitInputStream; import eu.svjatoslav.commons.data.BitOutputStream; +import java.io.IOException; + public class ImageMetaData { - int version; - int width; - int height; - - public void load(final BitInputStream inputStream) throws IOException { - version = inputStream.readBits(16); - width = ImageDecoder.readIntegerCompressed8(inputStream); - height = ImageDecoder.readIntegerCompressed8(inputStream); - } - - public void save(final BitOutputStream outputStream) throws IOException { - outputStream.storeBits(version, 16); - ImageEncoder.storeIntegerCompressed8(outputStream, width); - ImageEncoder.storeIntegerCompressed8(outputStream, height); - } + int version; + int width; + int height; + + public void load(final BitInputStream inputStream) throws IOException { + version = inputStream.readBits(16); + width = ImageDecoder.readIntegerCompressed8(inputStream); + height = ImageDecoder.readIntegerCompressed8(inputStream); + } + + public void save(final BitOutputStream outputStream) throws IOException { + outputStream.storeBits(version, 16); + ImageEncoder.storeIntegerCompressed8(outputStream, width); + ImageEncoder.storeIntegerCompressed8(outputStream, height); + } }