Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions alg/gdalcutline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@ CPLErr GDALWarpCutlineMaskerEx(void *pMaskFuncArg, int /* nBandCount */,
GByte *pabyPolyMask = static_cast<GByte *>(CPLCalloc(nXSize, nYSize));

auto poMEMDS =
MEMDataset::Create("warp_temp", nXSize, nYSize, 0, GDT_Byte, nullptr);
MEMDataset::Create("warp_temp", nXSize, nYSize, 0, GDT_UInt8, nullptr);
GDALRasterBandH hMEMBand =
MEMCreateRasterBandEx(poMEMDS, 1, pabyPolyMask, GDT_Byte, 0, 0, false);
MEMCreateRasterBandEx(poMEMDS, 1, pabyPolyMask, GDT_UInt8, 0, 0, false);
poMEMDS->AddMEMBand(hMEMBand);

GDALDatasetH hMemDS = GDALDataset::ToHandle(poMEMDS);
Expand Down
8 changes: 4 additions & 4 deletions alg/gdaldither.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,13 +352,13 @@ int GDALDitherRGB2PCTInternal(
/* --------------------------------------------------------------------
*/
CPLErr err1 = GDALRasterIO(hRed, GF_Read, 0, iScanline, nXSize, 1,
pabyRed, nXSize, 1, GDT_Byte, 0, 0);
pabyRed, nXSize, 1, GDT_UInt8, 0, 0);
if (err1 == CE_None)
err1 = GDALRasterIO(hGreen, GF_Read, 0, iScanline, nXSize, 1,
pabyGreen, nXSize, 1, GDT_Byte, 0, 0);
pabyGreen, nXSize, 1, GDT_UInt8, 0, 0);
if (err1 == CE_None)
err1 = GDALRasterIO(hBlue, GF_Read, 0, iScanline, nXSize, 1,
pabyBlue, nXSize, 1, GDT_Byte, 0, 0);
pabyBlue, nXSize, 1, GDT_UInt8, 0, 0);
if (err1 != CE_None)
{
CPLFree(pabyRed);
Expand Down Expand Up @@ -559,7 +559,7 @@ int GDALDitherRGB2PCTInternal(
/* --------------------------------------------------------------------
*/
err = GDALRasterIO(hTarget, GF_Write, 0, iScanline, nXSize, 1,
pabyIndex, nXSize, 1, GDT_Byte, 0, 0);
pabyIndex, nXSize, 1, GDT_UInt8, 0, 0);
if (err != CE_None)
break;
}
Expand Down
6 changes: 3 additions & 3 deletions alg/gdalmediancut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,13 +445,13 @@ int GDALComputeMedianCutPCTInternal(
}

err = GDALRasterIO(hRed, GF_Read, 0, iLine, nXSize, 1, pabyRedLine,
nXSize, 1, GDT_Byte, 0, 0);
nXSize, 1, GDT_UInt8, 0, 0);
if (err == CE_None)
err = GDALRasterIO(hGreen, GF_Read, 0, iLine, nXSize, 1,
pabyGreenLine, nXSize, 1, GDT_Byte, 0, 0);
pabyGreenLine, nXSize, 1, GDT_UInt8, 0, 0);
if (err == CE_None)
err = GDALRasterIO(hBlue, GF_Read, 0, iLine, nXSize, 1,
pabyBlueLine, nXSize, 1, GDT_Byte, 0, 0);
pabyBlueLine, nXSize, 1, GDT_UInt8, 0, 0);
if (err != CE_None)
goto end_and_cleanup;

Expand Down
16 changes: 8 additions & 8 deletions alg/gdalpansharpen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ GDALPansharpenOperation::Initialize(const GDALPansharpenOptions *psOptionsIn)
if (psOptionsIn->nBitDepth)
{
if (psOptionsIn->nBitDepth < 0 || psOptionsIn->nBitDepth > 31 ||
(eWorkDataType == GDT_Byte && psOptionsIn->nBitDepth > 8) ||
(eWorkDataType == GDT_UInt8 && psOptionsIn->nBitDepth > 8) ||
(eWorkDataType == GDT_UInt16 && psOptionsIn->nBitDepth > 16))
{
CPLError(CE_Failure, CPLE_AppDefined,
Expand All @@ -374,7 +374,7 @@ GDALPansharpenOperation::Initialize(const GDALPansharpenOptions *psOptionsIn)
if (psOptions->nBitDepth == GDALGetDataTypeSizeBits(eWorkDataType))
psOptions->nBitDepth = 0;
if (psOptions->nBitDepth &&
!(eWorkDataType == GDT_Byte || eWorkDataType == GDT_UInt16 ||
!(eWorkDataType == GDT_UInt8 || eWorkDataType == GDT_UInt16 ||
eWorkDataType == GDT_UInt32 || eWorkDataType == GDT_UInt64))
{
CPLError(CE_Warning, CPLE_AppDefined,
Expand Down Expand Up @@ -953,7 +953,7 @@ CPLErr GDALPansharpenOperation::WeightedBrovey(
{
switch (eBufDataType)
{
case GDT_Byte:
case GDT_UInt8:
WeightedBrovey(pPanBuffer, pUpsampledSpectralBuffer,
static_cast<GByte *>(pDataBuf), nValues, nBandValues,
nMaxValue);
Expand Down Expand Up @@ -1039,7 +1039,7 @@ CPLErr GDALPansharpenOperation::WeightedBrovey(
{
switch (eBufDataType)
{
case GDT_Byte:
case GDT_UInt8:
WeightedBrovey3<WorkDataType, GByte, FALSE>(
pPanBuffer, pUpsampledSpectralBuffer,
static_cast<GByte *>(pDataBuf), nValues, nBandValues, 0);
Expand Down Expand Up @@ -1171,7 +1171,7 @@ CPLErr GDALPansharpenOperation::ProcessRegion(int nXOff, int nYOff, int nXSize,
GDALRasterBand::FromHandle(psOptions->hPanchroBand);
GDALDataType eWorkDataType = poPanchroBand->GetRasterDataType();
#ifdef LIMIT_TYPES
if (eWorkDataType != GDT_Byte && eWorkDataType != GDT_UInt16)
if (eWorkDataType != GDT_UInt8 && eWorkDataType != GDT_UInt16)
eWorkDataType = GDT_Float64;
#endif
const int nDataTypeSize = GDALGetDataTypeSizeBytes(eWorkDataType);
Expand Down Expand Up @@ -1495,7 +1495,7 @@ CPLErr GDALPansharpenOperation::ProcessRegion(int nXOff, int nYOff, int nXSize,
nBandBitDepth = atoi(pszNBITS);
if (nBandBitDepth < nBitDepth)
{
if (eWorkDataType == GDT_Byte && nBitDepth >= 0 &&
if (eWorkDataType == GDT_UInt8 && nBitDepth >= 0 &&
nBitDepth <= 8)
{
ClampValues(
Expand Down Expand Up @@ -1535,7 +1535,7 @@ CPLErr GDALPansharpenOperation::ProcessRegion(int nXOff, int nYOff, int nXSize,
void *pDataBufOri = pDataBuf;
// CFloat64 is the query type used by gdallocationinfo...
#ifdef LIMIT_TYPES
if (eBufDataType != GDT_Byte && eBufDataType != GDT_UInt16)
if (eBufDataType != GDT_UInt8 && eBufDataType != GDT_UInt16)
#else
if (eBufDataType == GDT_CFloat64)
#endif
Expand Down Expand Up @@ -1735,7 +1735,7 @@ CPLErr GDALPansharpenOperation::PansharpenChunk(

switch (eWorkDataType)
{
case GDT_Byte:
case GDT_UInt8:
eErr = WeightedBrovey(
static_cast<const GByte *>(pPanBuffer),
static_cast<const GByte *>(pUpsampledSpectralBuffer), pDataBuf,
Expand Down
2 changes: 1 addition & 1 deletion alg/gdalproximity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ CPLErr CPL_STDCALL GDALComputeProximity(GDALRasterBandH hSrcBand,
GInt32 *panSrcScanline = nullptr;
bool bTempFileAlreadyDeleted = false;

if (eProxType == GDT_Byte || eProxType == GDT_UInt16 ||
if (eProxType == GDT_UInt8 || eProxType == GDT_UInt16 ||
eProxType == GDT_UInt32)
{
GDALDriverH hDriver = GDALGetDriverByName("GTiff");
Expand Down
8 changes: 4 additions & 4 deletions alg/gdalrasterize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ static void gvBurnScanline(GDALRasterizeInfo *psInfo, int nY, int nXStart,

switch (psInfo->eType)
{
case GDT_Byte:
case GDT_UInt8:
gvBurnScanlineBasic<GByte>(psInfo, nY, nXStart, nXEnd, dfVariant);
break;
case GDT_Int8:
Expand Down Expand Up @@ -350,7 +350,7 @@ static void gvBurnPoint(GDALRasterizeInfo *psInfo, int nY, int nX,

switch (psInfo->eType)
{
case GDT_Byte:
case GDT_UInt8:
gvBurnPointBasic<GByte>(psInfo, nY, nX, dfVariant);
break;
case GDT_Int8:
Expand Down Expand Up @@ -937,7 +937,7 @@ static CPLErr GDALRasterizeGeometriesInternal(
* int nBufXSize = 1024;
* int nBufYSize = 1024;
* int nBandCount = 1;
* GDALDataType eType = GDT_Byte;
* GDALDataType eType = GDT_UInt8;
* int nDataTypeSize = GDALGetDataTypeSizeBytes(eType);
*
* void* pData = CPLCalloc( nBufXSize*nBufYSize*nBandCount, nDataTypeSize );
Expand Down Expand Up @@ -1263,7 +1263,7 @@ static CPLErr GDALRasterizeGeometriesInternal(
const int nYBlocks = DIV_ROUND_UP(poBand->GetYSize(), nYBlockSize);

const GDALDataType eType =
poBand->GetRasterDataType() == GDT_Byte ? GDT_Byte : GDT_Float64;
poBand->GetRasterDataType() == GDT_UInt8 ? GDT_UInt8 : GDT_Float64;

const int nPixelSize = nBandCount * GDALGetDataTypeSizeBytes(eType);

Expand Down
2 changes: 1 addition & 1 deletion alg/gdalsievefilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static CPLErr GPMaskImageData(GDALRasterBandH hMaskBand, GByte *pabyMaskLine,

{
const CPLErr eErr = GDALRasterIO(hMaskBand, GF_Read, 0, iY, nXSize, 1,
pabyMaskLine, nXSize, 1, GDT_Byte, 0, 0);
pabyMaskLine, nXSize, 1, GDT_UInt8, 0, 0);
if (eErr == CE_None)
{
for (int i = 0; i < nXSize; i++)
Expand Down
6 changes: 3 additions & 3 deletions alg/gdalsimplewarp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ int CPL_STDCALL GDALSimpleImageWarp(GDALDatasetH hSrcDS, GDALDatasetH hDstDS,
if (GDALRasterIO(GDALGetRasterBand(hSrcDS, panBandList[iBand]), GF_Read,
0, 0, nSrcXSize, nSrcYSize,
apabySrcDataUniquePtr[iBand].get(), nSrcXSize,
nSrcYSize, GDT_Byte, 0, 0) != CE_None)
nSrcYSize, GDT_UInt8, 0, 0) != CE_None)
{
CPLError(CE_Failure, CPLE_FileIO,
"GDALSimpleImageWarp GDALRasterIO failure %s",
Expand Down Expand Up @@ -369,7 +369,7 @@ int CPL_STDCALL GDALSimpleImageWarp(GDALDatasetH hSrcDS, GDALDatasetH hDstDS,
if (GDALRasterIO(GDALGetRasterBand(hDstDS, iBand + 1), GF_Read,
0, iDstY, nDstXSize, 1,
apabyDstLine[iBand].get(), nDstXSize, 1,
GDT_Byte, 0, 0) != CE_None)
GDT_UInt8, 0, 0) != CE_None)
{
return FALSE;
}
Expand Down Expand Up @@ -423,7 +423,7 @@ int CPL_STDCALL GDALSimpleImageWarp(GDALDatasetH hSrcDS, GDALDatasetH hDstDS,
{
if (GDALRasterIO(GDALGetRasterBand(hDstDS, iBand + 1), GF_Write, 0,
iDstY, nDstXSize, 1, apabyDstLine[iBand].get(),
nDstXSize, 1, GDT_Byte, 0, 0) != CE_None)
nDstXSize, 1, GDT_UInt8, 0, 0) != CE_None)
{
return FALSE;
}
Expand Down
18 changes: 9 additions & 9 deletions alg/gdalwarper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ CPLErr GDALWarpNoDataMasker(void *pMaskFuncArg, int nBandCount,

switch (eType)
{
case GDT_Byte:
case GDT_UInt8:
return GDALWarpNoDataMaskerT(padfNoData, nPixels,
*ppImageData, // Already a GByte *.
panValidityMask, pbOutAllValid);
Expand Down Expand Up @@ -540,7 +540,7 @@ CPLErr GDALWarpSrcAlphaMasker(void *pMaskFuncArg, int /* nBandCount */,
GDALDataType eDT = GDALGetRasterDataType(hAlphaBand);
// Make sure that pafMask is at least 8-byte aligned, which should
// normally be always the case if being a ptr returned by malloc().
if ((eDT == GDT_Byte || eDT == GDT_UInt16) && CPL_IS_ALIGNED(pafMask, 8))
if ((eDT == GDT_UInt8 || eDT == GDT_UInt16) && CPL_IS_ALIGNED(pafMask, 8))
{
// Read data.
eErr = GDALRasterIOEx(
Expand All @@ -554,7 +554,7 @@ CPLErr GDALWarpSrcAlphaMasker(void *pMaskFuncArg, int /* nBandCount */,
// Make sure we have the correct alignment before doing SSE
// On Linux x86_64, the alignment should be always correct due
// the alignment of malloc() being 16 byte.
const GUInt32 mask = (eDT == GDT_Byte) ? 0xff : 0xffff;
const GUInt32 mask = (eDT == GDT_UInt8) ? 0xff : 0xffff;
if (!CPL_IS_ALIGNED(pafMask, 16))
{
pafMask[iPixel] =
Expand Down Expand Up @@ -752,7 +752,7 @@ CPLErr GDALWarpSrcMaskMasker(void *pMaskFuncArg, int /* nBandCount */,
/* Read the mask band. */
/* -------------------------------------------------------------------- */
CPLErr eErr = GDALRasterIO(hMaskBand, GF_Read, nXOff, nYOff, nXSize, nYSize,
pabySrcMask, nXSize, nYSize, GDT_Byte, 0, 0);
pabySrcMask, nXSize, nYSize, GDT_UInt8, 0, 0);

if (eErr != CE_None)
{
Expand Down Expand Up @@ -840,7 +840,7 @@ CPLErr GDALWarpDstAlphaMasker(void *pMaskFuncArg, int nBandCount,
const GDALDataType eDT = GDALGetRasterDataType(hAlphaBand);
// Make sure that pafMask is at least 8-byte aligned, which should
// normally be always the case if being a ptr returned by malloc().
if ((eDT == GDT_Byte || eDT == GDT_UInt16) &&
if ((eDT == GDT_UInt8 || eDT == GDT_UInt16) &&
CPL_IS_ALIGNED(pafMask, 8))
{
// Read data.
Expand All @@ -855,7 +855,7 @@ CPLErr GDALWarpDstAlphaMasker(void *pMaskFuncArg, int nBandCount,
// Make sure we have the correct alignment before doing SSE
// On Linux x86_64, the alignment should be always correct due
// the alignment of malloc() being 16 byte.
const GUInt32 mask = (eDT == GDT_Byte) ? 0xff : 0xffff;
const GUInt32 mask = (eDT == GDT_UInt8) ? 0xff : 0xffff;
if (!CPL_IS_ALIGNED(pafMask, 16))
{
pafMask[iPixel] =
Expand Down Expand Up @@ -958,7 +958,7 @@ CPLErr GDALWarpDstAlphaMasker(void *pMaskFuncArg, int nBandCount,
const float cst_alpha_max =
static_cast<float>(CPLAtof(CSLFetchNameValueDef(
psWO->papszWarpOptions, "DST_ALPHA_MAX", "255"))) +
((eDT == GDT_Byte || eDT == GDT_Int16 || eDT == GDT_UInt16 ||
((eDT == GDT_UInt8 || eDT == GDT_Int16 || eDT == GDT_UInt16 ||
eDT == GDT_Int32 || eDT == GDT_UInt32)
? 0.1f
: 0.0f);
Expand All @@ -968,7 +968,7 @@ CPLErr GDALWarpDstAlphaMasker(void *pMaskFuncArg, int nBandCount,
#if (defined(__x86_64) || defined(_M_X64))
// Make sure that pafMask is at least 8-byte aligned, which should
// normally be always the case if being a ptr returned by malloc()
if ((eDT == GDT_Byte || eDT == GDT_Int16 || eDT == GDT_UInt16) &&
if ((eDT == GDT_UInt8 || eDT == GDT_Int16 || eDT == GDT_UInt16) &&
CPL_IS_ALIGNED(pafMask, 8))
{
// Make sure we have the correct alignment before doing SSE
Expand Down Expand Up @@ -1756,7 +1756,7 @@ void CPL_STDCALL GDALWarpResolveWorkingDataType(GDALWarpOptions *psOptions)
return;
}

psOptions->eWorkingDataType = GDT_Byte;
psOptions->eWorkingDataType = GDT_UInt8;

// If none of the provided input nodata values can be represented in the
// data type of the corresponding source band, ignore them.
Expand Down
Loading
Loading