Group5.cpp
1 #include "g5dec.inl" 2 #include "g5enc.inl" 3 // 4 // Group5 1-bit image compression library 5 // Written by Larry Bank (bitbank@pobox.com) 6 // Decoder C++ wrapper functions 7 // 8 // SPDX-FileCopyrightText: 2024 BitBank Software, Inc. 9 // SPDX-License-Identifier: GPL-3.0-or-later 10 // 11 // This program is free software: you can redistribute it and/or modify 12 // it under the terms of the GNU General Public License as published by 13 // the Free Software Foundation, either version 3 of the License, or 14 // (at your option) any later version. 15 // 16 // This program is distributed in the hope that it will be useful, 17 // but WITHOUT ANY WARRANTY; without even the implied warranty of 18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 // GNU General Public License for more details. 20 // 21 // You should have received a copy of the GNU General Public License 22 // along with this program. If not, see <http://www.gnu.org/licenses/>. 23 // 24 int G5DECODER::init(int iWidth, int iHeight, uint8_t* pData, int iDataSize) { 25 return g5_decode_init(&_g5dec, iWidth, iHeight, pData, iDataSize); 26 } /* init() */ 27 28 int G5DECODER::decodeLine(uint8_t* pOut) { return g5_decode_line(&_g5dec, pOut); } /* decodeLine() */ 29 30 // 31 // Encoder C++ wrapper functions 32 // 33 int G5ENCODER::init(int iWidth, int iHeight, uint8_t* pOut, int iOutSize) { 34 return g5_encode_init(&_g5enc, iWidth, iHeight, pOut, iOutSize); 35 } /* init() */ 36 37 int G5ENCODER::encodeLine(uint8_t* pPixels) { return g5_encode_encodeLine(&_g5enc, pPixels); } /* encodeLine() */ 38 39 int G5ENCODER::size() { return g5_encode_getOutSize(&_g5enc); } /* size() */