// CodeGear C++Builder
// Copyright (c) 1995, 2015 by Embarcadero Technologies, Inc.
// All rights reserved

// (DO NOT EDIT: machine generated header) 'iedicom.pas' rev: 30.00 (Windows)

#ifndef IedicomHPP
#define IedicomHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member 
#pragma pack(push,8)
#include <System.hpp>
#include <SysInit.hpp>
#include <Winapi.Windows.hpp>
#include <Winapi.Messages.hpp>
#include <System.SysUtils.hpp>
#include <System.Classes.hpp>
#include <Vcl.Graphics.hpp>
#include <hyieutils.hpp>
#include <jpegfilt.hpp>
#include <imageenio.hpp>
#include <hyiedefs.hpp>
#include <imageenproc.hpp>
#include <iej2000.hpp>

//-- user supplied -----------------------------------------------------------

namespace Iedicom
{
//-- forward type declarations -----------------------------------------------
struct TIEDicomTagInfo;
class DELPHICLASS TDicomReadContext;
//-- type declarations -------------------------------------------------------
struct DECLSPEC_DRECORD TIEDicomTagInfo
{
public:
	System::Word Group;
	System::Word Element;
	System::SmallString<80> Desc;
	Hyieutils::TIEDicomTagType VType;
	Hyieutils::TIEDicomTagSource Src;
};


typedef TIEDicomTagInfo *PIEDicomTagInfo;

class PASCALIMPLEMENTATION TDicomReadContext : public System::TObject
{
	typedef System::TObject inherited;
	
private:
	Imageenio::TIOParamsVals* IOParams;
	Hyieutils::TIEBitmap* Bitmap;
	Hyiedefs::TProgressRec Progress;
	Hyieutils::TIEBufferedReadStream* Stream;
	__int64 StreamSize;
	bool Implicit;
	bool LittleEndian;
	System::AnsiString TransferSyntax;
	__int64 ThumbPos;
	__int64 ImagePos;
	int SamplesPerPixel;
	System::AnsiString PhotometricInterpretation;
	int PlanarConfiguration;
	int FrameCount;
	int PixelRepresentation;
	int Width;
	int Height;
	int BitsAllocated;
	int BitsStored;
	int BytesPerChannel;
	System::Sysutils::TWordArray *RMap;
	System::Sysutils::TWordArray *GMap;
	System::Sysutils::TWordArray *BMap;
	void *GrayMap;
	double WindowCenter;
	double WindowWidth;
	double RescaleIntercept;
	double RescaleSlope;
	System::Byte __fastcall ReadByte(void);
	System::Word __fastcall ReadWord(bool rev);
	unsigned __fastcall ReadDWord(bool rev);
	void __fastcall AdjustRange16g_adjust(void);
	void __fastcall AdjustRange16g_set(void);
	void __fastcall AdjustRange16g(void);
	void __fastcall AdjustRange8g_adjust(void);
	void __fastcall AdjustRange8g_set(void);
	void __fastcall AdjustRange8g(void);
	void __fastcall AdjustMonochrome16g_adjust(void);
	void __fastcall AdjustMonochrome16g_set(void);
	void __fastcall AdjustMonochrome16g(void);
	void __fastcall AdjustMonochrome8g_adjust(void);
	void __fastcall AdjustMonochrome8g_set(void);
	void __fastcall AdjustMonochrome8g(void);
	void __fastcall VerticalFlip(void);
	bool __fastcall ReadTag(Hyieutils::TIEDicomTags* tags);
	
public:
	__fastcall TDicomReadContext(System::Classes::TStream* Stream_, Hyiedefs::TProgressRec &Progress_);
	__fastcall virtual ~TDicomReadContext(void);
	void __fastcall ReadHeader(void);
	void __fastcall ReadTags(Imageenio::TIOParamsVals* Params);
	void __fastcall GetImage(Hyieutils::TIEBitmap* DstBitmap, Imageenio::TIOParamsVals* Params, bool Preview);
};


//-- var, const, procedure ---------------------------------------------------
extern DELPHI_PACKAGE System::AnsiString IEDICOM_TRANSFERSYNTAX_UNCOMP_LITTLEENDIAN_IMPLICIT;
extern DELPHI_PACKAGE System::AnsiString IEDICOM_TRANSFERSYNTAX_UNCOMP_LITTLEENDIAN_EXPLICIT;
extern DELPHI_PACKAGE System::AnsiString IEDICOM_TRANSFERSYNTAX_UNCOMP_BIGENDIAN_EXPLICIT;
extern DELPHI_PACKAGE System::AnsiString IEDICOM_TRANSFERSYNTAX_RLE;
extern DELPHI_PACKAGE System::AnsiString IEDICOM_TRANSFERSYNTAX_LOSSLESSJPEG1;
extern DELPHI_PACKAGE System::AnsiString IEDICOM_TRANSFERSYNTAX_LOSSLESSJPEG2;
extern DELPHI_PACKAGE System::AnsiString IEDICOM_TRANSFERSYNTAX_LOSSYJPEG8BIT;
extern DELPHI_PACKAGE System::AnsiString IEDICOM_TRANSFERSYNTAX_LOSSYJPEG12BIT;
extern DELPHI_PACKAGE System::AnsiString IEDICOM_TRANSFERSYNTAX_JPEG2000;
extern DELPHI_PACKAGE System::AnsiString IEDICOM_TRANSFERSYNTAX_MPEG;
extern DELPHI_PACKAGE System::AnsiString IEDICOM_TRANSFERSYNTAX_MPEG101;
extern DELPHI_PACKAGE System::AnsiString IEDICOM_TRANSFERSYNTAX_MPEG102;
extern DELPHI_PACKAGE System::AnsiString IEDICOM_TRANSFERSYNTAX_MPEG103;
#define IEDICOM_PHOTOMETINTERPRET_MONOCHROME_ZEROISWHITE L"MONOCHROME1"
#define IEDICOM_PHOTOMETINTERPRET_MONOCHROME_ZEROISBLACK L"MONOCHROME2"
#define IEDICOM_PHOTOMETINTERPRET_PALETTECOLOR L"PALETTE COLOR"
#define IEDICOM_PHOTOMETINTERPRET_YBRFULL L"YBR_FULL"
#define IEDICOM_PHOTOMETINTERPRET_RGB L"RGB"
static const System::Word Dicom_Tag_Count = System::Word(0x1313);
extern DELPHI_PACKAGE PIEDicomTagInfo __fastcall IEDicomGetTagInfo(System::Word Group, System::Word Element)/* overload */;
extern DELPHI_PACKAGE TIEDicomTagInfo __fastcall IEDicomGetTagInfo(int Idx)/* overload */;
extern DELPHI_PACKAGE void __fastcall IEDicomRead(System::Classes::TStream* Stream, Imageenio::TIOParamsVals* Params, Hyieutils::TIEBitmap* DstBitmap, Hyiedefs::TProgressRec &Progress, bool Preview);
extern DELPHI_PACKAGE bool __fastcall IEDicomTryStream(System::Classes::TStream* Stream);
extern DELPHI_PACKAGE int __fastcall IEDicomImageCount(System::Classes::TStream* Stream)/* overload */;
extern DELPHI_PACKAGE int __fastcall IEDicomImageCount(System::UnicodeString FileName)/* overload */;
extern DELPHI_PACKAGE void * __fastcall IEDicomWrite_init(System::Classes::TStream* Stream, Imageenio::TIOParamsVals* Params, int ImagesCount, Hyiedefs::TProgressRec &Progress);
extern DELPHI_PACKAGE void __fastcall IEDicomWrite_addImage(void * Context, Hyieutils::TIEBitmap* Image);
extern DELPHI_PACKAGE void __fastcall IEDicomWrite_finalize(void * Context);
}	/* namespace Iedicom */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_IEDICOM)
using namespace Iedicom;
#endif
#pragma pack(pop)
#pragma option pop

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// IedicomHPP
