FColor is the final value everything gets dumped in.
I got this from this forum, look.
Texture2DMipMap* MyMipMap = &texture->PlatformData->Mips[0];
FByteBulkData* RawImageData = &MyMipMap->BulkData;
FColor* FormatedImageData = static_cast<FColor*>( RawImageData->Lock( LOCK_READ_ONLY ) );
uint8 PixelX = 5, PixelY = 10;
uint32 TextureWidth = MyMipMap->SizeX, TextureHeight = MyMipMap->SizeY;
FColor PixelColor;
if( PixelX >= 0 && PixelX < TextureWidth && PixelY >= 0 && PixelY < TextureHeight )
{
PixelColor = FormatedImageData[ PixelY * TextureWidth + PixelX ];
}
RawImageData->Unlock();
int number = 31;
//UE_LOG(LogClass, Log, TEXT("My Int Value: %s"), *PixelColor);
//UE_LOG(LogClass, Log, TEXT("int value %d"), PixelColor );
//UE_LOG(LogClass, Log, TEXT("int value %d %d %d"), PixelColor );
//UE_LOG(LogClass, Log, TEXT("int value %d,%d,%d"), PixelColor.R, PixelColor.G,PixelColor.B );
UE_Log(LogTemp, Warning, TEXT(“Color %s”), *PixelColor.ToString());
I tried with int number and it outputs 31 in the log.
I want to see if it’s loading inside the FColor PixelColor anything.
for the loading of the texture I got:
static ConstructorHelpers::FObjectFinder<UTexture2D> Texture(TEXT("Texture2D'/Game/textures/Grainy_13_-_512x512.Grainy_13_-_512x512'"));
texture = Texture.Object;
So I want to log it to see if there is any data inside, it’s the only way to check before I go to the next step and manipulate those pixels.
Everything compiles fine, so from the constructor helper to the end I actually need to see if it’s loading the texture and texture data.
texture is loaded into the mip.
Texture2DMipMap* MyMipMap = &**texture**->PlatformData->Mips[0];
It’s then converted to 1D, from there you got some conditioning with pixelX and Y and if it passes that it will add the code data to pixelcolor, at least that is what it should do and I should get some INT color codes.
At the end you got.
PixelColor = FormatedImageData[ PixelY * TextureWidth + PixelX ];
FormatedImageData is a 1d Array as I understand ?