//================================================================
// Camera RAW file loading for lib2D
//
// AUTHOR:  Gabor Nagy
// DATE:    2025-Aug-27 19:36:29
//
// Copyright (C) 1996-2026 by Gabor Nagy. All rights reserved.
//================================================================
#ifndef _EpDCamRAW_h
#define _EpDCamRAW_h

#define EpDebugFoveonGENERAL       0
#define EpDebugFoveonSPATIAL_GAIN  0

#define EpUseLIBX3F                1

typedef struct
{
	char*            Name;
	uint16_t         Type;
	EStrFilterChar*  NameTokenized;
} EpNameAndType;

typedef struct EpDCamRAW_S  EpDCamRAW;

typedef int (*EpRAWLoadFunc)(EpDCamRAW* PData);

struct EpDCamRAW_S
{
	FILE*           File;
	int32_t         Verbosity;   // 0: quiet, 1: basic debugging info, 2: detailed debugging info
	EIndex2         ISize;
	EpPixelBuffer*  PixelBuffer;
	uint8_t*        MetaData;EIndex  MetaOffset, MetaLength;
	EIndex2         ThumbSize;
	EIndex          ThumbOffset, ThumbLength;
	EIndex          DataOffset;
	EpRAWLoadFunc   LoadFunc;
	uint32_t        ByteOrder : 16, RotatedDegrees : 9, LoadFlags : 1;
	uint32_t        DNGVersion;
	uint32_t        ZeroAfterFF;
	time_t          TimeStamp;
	char            Make[64], Model[256], WBName[64];
	float           ISOSpeed, Shutter, Aperture, FocalLength;
	float           RGB_Cam[3][4];
};

#endif // _EpDCamRAW_h
