Aurelon Open API 8.1.1
Loading...
Searching...
No Matches
AOI_TIFFRenderer.h
1/*
2 * AOI_TIFFRenderer
3 * Copyright (c) 2011 Aurelon BV. All rights reserved.
4 *
5 */
6#pragma once
7
8#include "./AOI_Renderer.h"
9#include <ACPL/Multithreading.h>
10#include <ACPL/CString.h>
11#include "../GTypes.h"
12#include "../GBitmap.h"
13
14namespace aur { namespace PDF {
15 class CMM;
16 class ColorSpaceObject;
17}}
18
19class AOI_TIFFRenderer
20{
21 class Unit
22 {
23 public:
24 uint8_t* mInputData;
25 uint8_t* mOutputData;
26 bool mIsLast;
27 Unit* mNext;
28 };
29 class UnitQueue
30 {
31 aur::ACPL::CriticalSection mSemaphore;
32 Unit* mUnits;
33 public:
34 UnitQueue();
35 ~UnitQueue();
36 void AddBuffer( Unit* );
37 Unit* AquireBuffer();
38 void DestroyBuffers();
39 };
40 typedef struct ImageDefinition
41 {
42 uint32_t channelCount;
43 uint32_t rowBytes;
44 uint32_t width;
45 uint32_t height;
46 } ImageDefinition;
47
48 aur::PDF::Document* mDocument;
49 aur::ACPL::FileSpec* mImageSpec;
50 aur::PDF::Renderer* mColorConvertor;
51 aur::PDF::Mapping mRenderMapping;
52 aur::PDF::Mapping mImageMapping;
53 ImageDefinition mInputOriginal;
54 ImageDefinition mOutputOriginal;
55 ImageDefinition mInputClipped;
56 ImageDefinition mOutputClipped;
57 uint16_t* mLABLine;
58 uint8_t* mOutputBand;
59 uint8_t mWhite;
60 float mPageWidth;
61 float mPageHeight;
62 volatile bool mContinue;
63 bool mImageExhausted;
64
65 uint32_t mY_Input;
66 uint32_t mY_Input_Start;
67 uint32_t mInput_X_OffsetBytes;
68 double mYScale;
69 float mPreviousMapY;
70 double mY_Input_Threshold;
71 bool mResetInput;
72 UnitQueue mReaderQueue; // Units available to image readering process
73 ACPL_THREAD mReaderThreadH;
74 volatile bool mReaderEnded;
75 static ACPL_RES ReaderCreate( void* );
76 void Reader();
77 static aur::ExceptionCode ReaderPlugSetup( void* ref, const aur::PDF::BitmapT& inBitmap );
78 static aur::ExceptionCode ReaderPlugSaveLine( void* ref, const uint8_t* inImageLine );
79
80 UnitQueue mCMMQueue; // Units available to CMM & Up/down sample process
81 ACPL_THREAD mCMMThreadH;
82 volatile bool mCMMEnded;
83 ColorConvertCB mColorConvertCallBack;
84 void* mColorConvertRef;
85 aur::PDF::CMM* mInputCMM;
86 aur::PDF::CMM* mOutputCMM;
87 aur::PDF::ColorSpaceObject* mInputCS;
88 aur::PDF::ColorSpaceObject* mOutputCS;
89 static ACPL_RES CMMCreate( void* );
90 void ScaleCMM();
91 void SimpleConvert( uint32_t width, const uint8_t* src, uint8_t* dest );
92 void DownscaleFree( uint32_t channels, const uint8_t* inImage, int32_t inWidth, uint8_t* outImage, int32_t outWidth );
93 void UpscaleFree( uint32_t channels, const uint8_t* inImage, int32_t inWidth, uint8_t* outImage, int32_t outWidth );
94
95 uint32_t mY_Output_Start;
96 uint32_t mOutput_X_OffsetBytes;
97 double mY_Output_Threshold;
98 UnitQueue mWriterQueue; // Units available for writing in band
99public:
100 AOI_TIFFRenderer( AOI_Document& doc );
101 ~AOI_TIFFRenderer();
102 aur::ExceptionCode Setup( const aur::ACPL::FileSpec&, const aur::ACPL::StringList&, void* banddata, int32_t w, int32_t h, bool alpha );
103 void SetColorConvertCallBack( ColorConvertCB cb, void* ref );
104
105 void SetMapping( const AOI_Mapping& docToBandMap );
106 void Render();
107private:
108 void Cleanup();
109};
PDF Document.
3x3 matrix
Definition AOI_Types.h:113
bool(* ColorConvertCB)(ColorConvert_Data &, void *)
CMM callback routine.