hkResult hkvTextureTransformationRule::transferSourceProperties(Context& context) const
{
  if (!context.m_input.m_pAsset)
  {
    return HK_FAILURE;
  }

  hkvPropertyList sourceProperties;
  context.m_input.m_pAsset->getProperties(sourceProperties, hkvProperty::PURPOSE_SERIALIZATION);

  size_t numSourceProperties = sourceProperties.size();
  for (size_t sourcePropertyIdx = 0; sourcePropertyIdx < numSourceProperties; ++sourcePropertyIdx)
  {
    hkvProperty& prop = sourceProperties[sourcePropertyIdx];
    if (hkvStringHelper::safeCompare(prop.getName(), "FileFormat") == 0)
    {
      hkUint32 format = HKV_IMAGE_FILE_FORMAT_INVALID;
      if (getImageFileFormatDefinition().stringToId(prop.getString(), format) == HK_SUCCESS)
      {
        context.m_sourceFormat = (hkvImageFileFormat)format;
      }
    }
    else if (hkvStringHelper::safeCompare(prop.getName(), "HasAlpha") == 0)
    {
      context.m_sourceHasAlpha = prop.getBool();
    }
    else if (hkvStringHelper::safeCompare(prop.getName(), "Width") == 0)
    {
      context.m_sourceWidth = prop.getUint();
    }
    else if (hkvStringHelper::safeCompare(prop.getName(), "Height") == 0)
    {
      context.m_sourceHeight = prop.getUint();
    }
    else if (hkvStringHelper::safeCompare(prop.getName(), "sRGB") == 0)
    {
      context.m_sourceSrgb = prop.getBool();
    }
  }

  return HK_SUCCESS;
}
hkvImageFileProperties::hkvImageFileProperties(const hkvImageFileProperties& rhs)
: m_imageFormatInstance(getImageFileFormatDefinition())
{
  *this = rhs;
}
hkvImageFileProperties::hkvImageFileProperties()
: m_imageFormatInstance(getImageFileFormatDefinition())
{
  clear();
}