kis_tiff_ycbcr_reader.h
1/*
2 * Copyright (c) 2006 Cyrille Berger <cberger@cberger.net>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20#ifndef _KIS_TIFF_YCBCR_READER_H_
21#define _KIS_TIFF_YCBCR_READER_H_
22
23#include "kis_tiff_reader.h"
24
25namespace KisTIFFYCbCr {
26 enum Position {
27 POSITION_CENTERED = 1,
28 POSITION_COSITED = 2
29 };
30}
31
32class KisTIFFYCbCrReaderTarget8Bit : public KisTIFFReaderBase {
33 public:
38 KisTIFFYCbCrReaderTarget8Bit( KisPaintDeviceSP device, TQ_UINT8* poses, int8 alphapos, uint8 sourceDepth, uint8 nbcolorssamples, uint8 extrasamplescount, cmsHTRANSFORM transformProfile, KisTIFFPostProcessor* postprocessor, uint16 hsub, uint16 vsub, KisTIFFYCbCr::Position position );
39 ~KisTIFFYCbCrReaderTarget8Bit();
40 virtual uint copyDataToChannels( TQ_UINT32 x, TQ_UINT32 y, TQ_UINT32 dataWidth, TIFFStreamBase* tiffstream);
41 virtual void finalize();
42 private:
43 TQ_UINT8* m_bufferCb;
44 TQ_UINT8* m_bufferCr;
45 TQ_UINT32 m_bufferWidth, m_bufferHeight;
46 uint16 m_hsub;
47 uint16 m_vsub;
48 KisTIFFYCbCr::Position m_position;
49
50};
51
52class KisTIFFYCbCrReaderTarget16Bit : public KisTIFFReaderBase {
53 public:
58 KisTIFFYCbCrReaderTarget16Bit( KisPaintDeviceSP device, TQ_UINT8* poses, int8 alphapos, uint8 sourceDepth, uint8 nbcolorssamples, uint8 extrasamplescount, cmsHTRANSFORM transformProfile, KisTIFFPostProcessor* postprocessor, uint16 hsub, uint16 vsub, KisTIFFYCbCr::Position position );
59 ~KisTIFFYCbCrReaderTarget16Bit();
60 virtual uint copyDataToChannels( TQ_UINT32 x, TQ_UINT32 y, TQ_UINT32 dataWidth, TIFFStreamBase* tiffstream);
61 virtual void finalize();
62 private:
63 TQ_UINT16* m_bufferCb;
64 TQ_UINT16* m_bufferCr;
65 TQ_UINT32 m_bufferWidth, m_bufferHeight;
66 uint16 m_hsub;
67 uint16 m_vsub;
68 KisTIFFYCbCr::Position m_position;
69
70};
71
72
73#endif