Skip to content
This repository was archived by the owner on Jul 22, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RawSpeed/DcrDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ RawImage DcrDecoder::decodeRawInternal() {
TiffEntry *ifdoffset = mRootIFD->getEntryRecursive(KODAK_IFD);
if (!ifdoffset)
ThrowRDE("DCR Decoder: Couldn't find the Kodak IFD offset");
TiffIFDBE kodakifd = TiffIFDBE(mFile, ifdoffset->getInt());
TiffIFDSwap kodakifd = TiffIFDSwap(mFile, ifdoffset->getInt());
TiffEntry *linearization = kodakifd.getEntryRecursive(KODAK_LINEARIZATION);
if (!linearization)
ThrowRDE("DCR Decoder: Couldn't find the linearization table");
Expand Down
2 changes: 1 addition & 1 deletion RawSpeed/DcrDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define DCR_DECODER_H

#include "RawDecoder.h"
#include "TiffIFDBE.h"
#include "TiffIFDSwap.h"

namespace RawSpeed {

Expand Down
1 change: 1 addition & 0 deletions RawSpeed/ErfDecoder.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "StdAfx.h"
#include "ErfDecoder.h"
#include "TiffIFDSwap.h"

/*
RawSpeed - RAW file decoder.
Expand Down
1 change: 0 additions & 1 deletion RawSpeed/ErfDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#define ERF_DECODER_H

#include "RawDecoder.h"
#include "TiffIFDBE.h"

namespace RawSpeed {

Expand Down
2 changes: 1 addition & 1 deletion RawSpeed/KdcDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define KDC_DECODER_H

#include "RawDecoder.h"
#include "TiffIFDBE.h"
#include "TiffIFDSwap.h"

namespace RawSpeed {

Expand Down
2 changes: 1 addition & 1 deletion RawSpeed/OrfDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ void OrfDecoder::decodeMetaDataInternal(CameraMetaData *meta) {
if (makertiff.getHostEndian() == makertiff.tiff_endian)
ImageProcessing = new TiffIFD(&makermap2, offset);
else
ImageProcessing = new TiffIFDBE(&makermap2, offset);
ImageProcessing = new TiffIFDSwap(&makermap2, offset);
blackEntry = ImageProcessing->getEntry((TiffTag)0x600);
} catch (TiffParserException) {
}
Expand Down
4 changes: 2 additions & 2 deletions RawSpeed/RawParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "TiffParser.h"
#include "X3fParser.h"
#include "ByteStreamSwap.h"
#include "TiffEntryBE.h"
#include "TiffEntrySwap.h"
#include "MrwDecoder.h"

/*
Expand Down Expand Up @@ -161,7 +161,7 @@ void RawParser::ParseFuji(uint32 offset, TiffIFD *target_ifd)
case 0x100:
case 0x121:
case 0x2ff0:
t = new TiffEntryBE((TiffTag)tag, TIFF_SHORT, length/2, bytes.getData());
t = new TiffEntrySwap((TiffTag)tag, TIFF_SHORT, length/2, bytes.getData());
break;

case 0xc000:
Expand Down
8 changes: 4 additions & 4 deletions RawSpeed/RawSpeed.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,15 @@
>
</File>
<File
RelativePath=".\TiffEntryBE.cpp"
RelativePath=".\TiffEntrySwap.cpp"
>
</File>
<File
RelativePath=".\TiffIFD.cpp"
>
</File>
<File
RelativePath=".\TiffIFDBE.cpp"
RelativePath=".\TiffIFDSwap.cpp"
>
</File>
<File
Expand Down Expand Up @@ -692,15 +692,15 @@
>
</File>
<File
RelativePath=".\TiffEntryBE.h"
RelativePath=".\TiffEntrySwap.h"
>
</File>
<File
RelativePath=".\TiffIFD.h"
>
</File>
<File
RelativePath=".\TiffIFDBE.h"
RelativePath=".\TiffIFDSwap.h"
>
</File>
<File
Expand Down
18 changes: 9 additions & 9 deletions RawSpeed/TiffEntryBE.cpp → RawSpeed/TiffEntrySwap.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "StdAfx.h"
#include "TiffEntryBE.h"
#include "TiffEntrySwap.h"
/*
RawSpeed - RAW file decoder.

Expand All @@ -24,7 +24,7 @@

namespace RawSpeed {

TiffEntryBE::TiffEntryBE(FileMap* f, uint32 offset) {
TiffEntrySwap::TiffEntrySwap(FileMap* f, uint32 offset) {
own_data = NULL;
type = TIFF_UNDEFINED; // We set type to undefined to avoid debug assertion errors.
data = f->getDataWrt(offset);
Expand Down Expand Up @@ -57,7 +57,7 @@ TiffEntryBE::TiffEntryBE(FileMap* f, uint32 offset) {
#endif
}

TiffEntryBE::TiffEntryBE( TiffTag tag, TiffDataType type, uint32 count, const uchar8* data /*= NULL*/ )
TiffEntrySwap::TiffEntrySwap( TiffTag tag, TiffDataType type, uint32 count, const uchar8* data /*= NULL*/ )
: TiffEntry(tag, type,count, data)
{
#ifdef _DEBUG
Expand All @@ -71,24 +71,24 @@ TiffEntryBE::TiffEntryBE( TiffTag tag, TiffDataType type, uint32 count, const uc
#endif
}

TiffEntryBE::~TiffEntryBE(void) {
TiffEntrySwap::~TiffEntrySwap(void) {
}

unsigned int TiffEntryBE::getInt() {
unsigned int TiffEntrySwap::getInt() {
if (!(type == TIFF_LONG || type == TIFF_SHORT || type == TIFF_UNDEFINED))
ThrowTPE("TIFF, getInt: Wrong type 0x%x encountered. Expected Int", type);
if (type == TIFF_SHORT)
return getShort();
return (unsigned int)data[0] << 24 | (unsigned int)data[1] << 16 | (unsigned int)data[2] << 8 | (unsigned int)data[3];
}

unsigned short TiffEntryBE::getShort() {
unsigned short TiffEntrySwap::getShort() {
if (!(type == TIFF_SHORT || type == TIFF_UNDEFINED))
ThrowTPE("TIFF, getShort: Wrong type 0x%x encountered. Expected Short", type);
return (unsigned short)data[0] << 8 | (unsigned short)data[1];
}

const uint32* TiffEntryBE::getIntArray() {
const uint32* TiffEntrySwap::getIntArray() {
if (!(type == TIFF_LONG || type == TIFF_UNDEFINED || type == TIFF_RATIONAL || type == TIFF_SRATIONAL))
ThrowTPE("TIFF, getIntArray: Wrong type 0x%x encountered. Expected Int", type);
if (own_data)
Expand All @@ -107,7 +107,7 @@ const uint32* TiffEntryBE::getIntArray() {
return (uint32*)own_data;
}

const ushort16* TiffEntryBE::getShortArray() {
const ushort16* TiffEntrySwap::getShortArray() {
if (!(type == TIFF_SHORT || type == TIFF_UNDEFINED))
ThrowTPE("TIFF, getShortArray: Wrong type 0x%x encountered. Expected Short", type);

Expand All @@ -122,7 +122,7 @@ const ushort16* TiffEntryBE::getShortArray() {
return d;
}

void TiffEntryBE::setData( const void *in_data, uint32 byte_count )
void TiffEntrySwap::setData( const void *in_data, uint32 byte_count )
{
if (datashifts[type] != 0)
ThrowTPE("TIFF, Unable to set data on byteswapped platforms (unsupported)");
Expand Down
10 changes: 5 additions & 5 deletions RawSpeed/TiffEntryBE.h → RawSpeed/TiffEntrySwap.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@

namespace RawSpeed {

class TiffEntryBE :
class TiffEntrySwap :
public TiffEntry
{
public:
// TiffEntryBE(void);
TiffEntryBE(FileMap* f, uint32 offset);
TiffEntryBE(TiffTag tag, TiffDataType type, uint32 count, const uchar8* data = NULL);
virtual ~TiffEntryBE(void);
// TiffEntrySwap(void);
TiffEntrySwap(FileMap* f, uint32 offset);
TiffEntrySwap(TiffTag tag, TiffDataType type, uint32 count, const uchar8* data = NULL);
virtual ~TiffEntrySwap(void);
virtual uint32 getInt();
virtual ushort16 getShort();
virtual const uint32* getIntArray();
Expand Down
2 changes: 1 addition & 1 deletion RawSpeed/TiffIFD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ TiffIFD* TiffIFD::parseMakerNote(FileMap *f, uint32 offset, Endianness parent_en
if (parent_end == getHostEndianness())
maker_ifd = new TiffIFD(mFile, offset);
else
maker_ifd = new TiffIFDBE(mFile, offset);
maker_ifd = new TiffIFDSwap(mFile, offset);
} catch (...) {
if (mFile != f)
delete mFile;
Expand Down
14 changes: 7 additions & 7 deletions RawSpeed/TiffIFDBE.cpp → RawSpeed/TiffIFDSwap.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "StdAfx.h"
#include "TiffIFDBE.h"
#include "TiffEntryBE.h"
#include "TiffIFDSwap.h"
#include "TiffEntrySwap.h"
/*
RawSpeed - RAW file decoder.

Expand All @@ -25,11 +25,11 @@

namespace RawSpeed {

TiffIFDBE::TiffIFDBE() {
TiffIFDSwap::TiffIFDSwap() {
endian = big;
}

TiffIFDBE::TiffIFDBE(FileMap* f, uint32 offset) {
TiffIFDSwap::TiffIFDSwap(FileMap* f, uint32 offset) {
mFile = f;
endian = big;
int entries;
Expand All @@ -40,7 +40,7 @@ TiffIFDBE::TiffIFDBE(FileMap* f, uint32 offset) {

CHECKSIZE(offset + 2 + entries*4);
for (int i = 0; i < entries; i++) {
TiffEntryBE *t = new TiffEntryBE(f, offset + 2 + i*12);
TiffEntrySwap *t = new TiffEntrySwap(f, offset + 2 + i*12);

if (t->tag == SUBIFDS || t->tag == EXIFIFDPOINTER || t->tag == DNGPRIVATEDATA || t->tag == MAKERNOTE) { // subIFD tag
if (t->tag == DNGPRIVATEDATA) {
Expand All @@ -64,7 +64,7 @@ TiffIFDBE::TiffIFDBE(FileMap* f, uint32 offset) {
const unsigned int* sub_offsets = t->getIntArray();
try {
for (uint32 j = 0; j < t->count; j++) {
mSubIFD.push_back(new TiffIFDBE(f, sub_offsets[j]));
mSubIFD.push_back(new TiffIFDSwap(f, sub_offsets[j]));
}
delete(t);
} catch (TiffParserException) {
Expand All @@ -81,7 +81,7 @@ TiffIFDBE::TiffIFDBE(FileMap* f, uint32 offset) {
}


TiffIFDBE::~TiffIFDBE(void) {
TiffIFDSwap::~TiffIFDSwap(void) {
}

} // namespace RawSpeed
8 changes: 4 additions & 4 deletions RawSpeed/TiffIFDBE.h → RawSpeed/TiffIFDSwap.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@

namespace RawSpeed {

class TiffIFDBE :
class TiffIFDSwap :
public TiffIFD
{
public:
TiffIFDBE();
TiffIFDBE(FileMap* f, uint32 offset);
virtual ~TiffIFDBE(void);
TiffIFDSwap();
TiffIFDSwap(FileMap* f, uint32 offset);
virtual ~TiffIFDSwap(void);
};

} // namespace RawSpeed
Expand Down
4 changes: 2 additions & 2 deletions RawSpeed/TiffParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void TiffParser::parseData() {
if (tiff_endian == host_endian)
mRootIFD = new TiffIFD();
else
mRootIFD = new TiffIFDBE();
mRootIFD = new TiffIFDSwap();

uint32 nextIFD;
data = mInput->getData(4);
Expand All @@ -102,7 +102,7 @@ void TiffParser::parseData() {
if (tiff_endian == host_endian)
mRootIFD->mSubIFD.push_back(new TiffIFD(mInput, nextIFD));
else
mRootIFD->mSubIFD.push_back(new TiffIFDBE(mInput, nextIFD));
mRootIFD->mSubIFD.push_back(new TiffIFDSwap(mInput, nextIFD));

nextIFD = mRootIFD->mSubIFD.back()->getNextIFD();
}
Expand Down
2 changes: 1 addition & 1 deletion RawSpeed/TiffParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#include "FileMap.h"
#include "TiffIFD.h"
#include "TiffIFDBE.h"
#include "TiffIFDSwap.h"
#include "TiffParserException.h"
#include "RawDecoder.h"

Expand Down
4 changes: 2 additions & 2 deletions RawSpeed/TiffParserHeaderless.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void TiffParserHeaderless::parseData(uint32 firstIfdOffset) {
if (tiff_endian == host_endian)
mRootIFD = new TiffIFD();
else
mRootIFD = new TiffIFDBE();
mRootIFD = new TiffIFDSwap();

uint32 nextIFD = firstIfdOffset;
do {
Expand All @@ -62,7 +62,7 @@ void TiffParserHeaderless::parseData(uint32 firstIfdOffset) {
if (tiff_endian == host_endian)
mRootIFD->mSubIFD.push_back(new TiffIFD(mInput, nextIFD));
else
mRootIFD->mSubIFD.push_back(new TiffIFDBE(mInput, nextIFD));
mRootIFD->mSubIFD.push_back(new TiffIFDSwap(mInput, nextIFD));

nextIFD = mRootIFD->mSubIFD.back()->getNextIFD();
} while (nextIFD);
Expand Down
4 changes: 2 additions & 2 deletions RawSpeed/TiffParserOlympus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void TiffParserOlympus::parseData() {
if (tiff_endian == host_endian)
mRootIFD = new TiffIFD();
else
mRootIFD = new TiffIFDBE();
mRootIFD = new TiffIFDSwap();

uint32 nextIFD = 4; // Skip Endian and magic
do {
Expand All @@ -69,7 +69,7 @@ void TiffParserOlympus::parseData() {
if (tiff_endian == host_endian)
mRootIFD->mSubIFD.push_back(new TiffIFD(mInput, nextIFD));
else
mRootIFD->mSubIFD.push_back(new TiffIFDBE(mInput, nextIFD));
mRootIFD->mSubIFD.push_back(new TiffIFDSwap(mInput, nextIFD));

nextIFD = mRootIFD->mSubIFD.back()->getNextIFD();
} while (nextIFD);
Expand Down