Aurelon Open API 8.1.1
Loading...
Searching...
No Matches
AOI_SoftProofRenderer.h
1/*
2 * AOI_SoftProofRenderer
3 * Copyright (c) 2014 Aurelon. All rights reserved.
4 *
5 */
6#pragma once
7
8#include "./AOI_Renderer.h"
9#include "./AOI_Document.h"
10#include "../GTypes.h"
11
12namespace aur { namespace PDF {
13 class Document;
14 class Renderer;
15 class CMM;
16 class Profile;
17}
18namespace ACPL {
19 class FileSpec;
20 class UString;
21 class FileStream;
22}}
23
25{
26public:
27 class AOIAPI TileSettings
28 {
29 public:
30 uint32_t mTileSize;
31 uint32_t mMinZoomSize;
32 uint32_t mMaxMemoryUsage;
33 float mMaxDpi;
34 int16_t mJpgQuality;
35 uint64_t mVisiblePlates;
36
37 TileSettings( uint32_t tileSize, uint32_t minZoomSize, uint32_t maxMemoryUsage, float maxDpi, int16_t jpgQuality, uint64_t visiblePlates );
38 void SetVisiblePlates( uint64_t visiblePlates );
39 };
40
41 class TileGenerator
42 {
43 public:
44 TileGenerator( const TileSettings& );
45 void InitPage( float pageWidth, float pageHeight );
46 void SetZoomLevel( uint32_t level );
47 bool WriteTile( uint32_t x, uint32_t y, uint32_t currentTileNumber, uint32_t yInBand, uint8_t* bandData, uint32_t rowbytes, const aur::ACPL::FileSpec& outputPath, uint32_t tilePositionInCurrentZoomLevel );
48 void CreateTilesXML( const aur::ACPL::FileSpec& outputPath );
49
50 uint32_t GetPageWidth() const;
51 uint32_t GetPageHeight() const;
52 uint32_t GetNrBands() const;
53 uint32_t GetBandHeight() const;
54 uint32_t GetNrZoomLevels() const;
55 uint32_t GetTilesHorizontal() const;
56 uint32_t GetTilesVertical() const;
57 uint32_t GetTilesVerticalInBand() const;
58 uint32_t GetScaledWidth() const;
59 uint32_t GetScaledHeight() const;
60 uint32_t GetCurrentZoomLevel() const;
61 uint32_t GetTotalNrOfTiles() const;
62
63 private:
64 TileSettings mSettings;
65 uint32_t mPageWidth;
66 uint32_t mPageHeight;
67 uint32_t mNrBands;
68 uint32_t mBandHeight;
69 uint32_t mNrOfzoomLevels;
70 uint32_t mCurrentZoomLevel;
71 uint32_t mTilesHorizontal;
72 uint32_t mTilesVertical;
73 uint32_t mScaledWidth;
74 uint32_t mScaledHeight;
75 uint32_t mTotalNrOfTiles;
76 };
77
80 bool Setup( const aur::ACPL::FileSpec& profileFile, const aur::ACPL::FileSpec& cmmFile );
81 // intent values 0 - relative colorimetric, 1 - perceptual, 2 - absolute
82 void AssignInputProfiles( const aur::ACPL::FileSpec& rgbProfile, const aur::ACPL::FileSpec& cmykProfile, const aur::ACPL::FileSpec& grayProfile, int32_t intent );
83 void SetupPage();
84 uint32_t GetDocumentChannelCount();
85 const char* GetDocumentChannelName( uint32_t index );
86 void UpdateRenderer( uint32_t width, uint32_t height );
87 bool Render( const aur::ACPL::FileSpec& outputPath, const char* thumbnailType, int32_t x, int32_t y, int32_t width, int32_t height, uint32_t quality = 100, uint64_t visiblePlates = UINT64_MAX );
88 bool RenderTiles( const TileSettings& tileSettings, const aur::ACPL::FileSpec& outputPath, int16_t channelIndex, const aur::ACPL::UString& multichannelRender );
89
90private:
91 aur::PDF::Document* mDocument;
92 aur::PDF::Profile* mProfile;
93 aur::PDF::CMM* mCMM;
94 float mDPU;
95
96 // use the renderer to render a part of the current page and put the resulting data into bandData as simple RGB 8 bit data
97 void RenderBand( uint8_t* doubleBandData, uint32_t y, uint32_t height, uint32_t renderingWidth, uint32_t renderingHeight );
98 void SaveMultichannelRender( aur::ACPL::FileStream& stream, uint32_t renderingWidth, uint32_t renderingHeight );
99 void LoadMultiChannelRender( uint8_t* doubleBandData, int16_t channelIndex, aur::ACPL::FileStream& stream, uint32_t renderingWidth, uint32_t renderingHeight, uint32_t pixelBytes, uint32_t lineBytes, bool hasAlpha );
100 //use the passed stream to load n lines to fill up the band data
101 void LoadBand( uint8_t* bandData, aur::ACPL::FileStream& stream, int32_t byteCount );
102 //save the band data into stream
103 void SaveBand( const uint8_t* bandData, aur::ACPL::FileStream& stream, int32_t byteCount );
104 //downsample 2x a band of data
105 void DownsampleRGBBy2( uint8_t* inBandData, uint8_t* outBandData, uint32_t inRowbytes, uint32_t inHeight, uint32_t inWidth, uint32_t outRowBytes, uint32_t inComponents );
106};
107
PDF Document.