• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetFormat函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetFormat函数的典型用法代码示例。如果您正苦于以下问题:C++ GetFormat函数的具体用法?C++ GetFormat怎么用?C++ GetFormat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetFormat函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: PDxtexApp

HRESULT CDxtexDoc::Resize(DWORD dwWidthNew, DWORD dwHeightNew)
{
    HRESULT hr;
    LPDIRECT3DTEXTURE9 pmiptexNew;
    LPDIRECT3DDEVICE9 pd3ddev = PDxtexApp()->Pd3ddev();
    
    hr = pd3ddev->CreateTexture(dwWidthNew, dwHeightNew, m_numMips, 
         0, GetFormat(m_ptexOrig), D3DPOOL_MANAGED, &pmiptexNew, NULL);
    if (FAILED(hr))
        return hr;
    if (FAILED(BltAllLevels(D3DCUBEMAP_FACE_FORCE_DWORD, m_ptexOrig, pmiptexNew)))
        return hr;
    ReleasePpo(&m_ptexOrig);
    m_ptexOrig = pmiptexNew;

    if( m_ptexNew != NULL )
    {
        hr = pd3ddev->CreateTexture(dwWidthNew, dwHeightNew, m_numMips, 
             0, GetFormat(m_ptexOrig), D3DPOOL_MANAGED, &pmiptexNew, NULL);
        if (FAILED(hr))
            return hr;
        if (FAILED(BltAllLevels(D3DCUBEMAP_FACE_FORCE_DWORD, m_ptexNew, pmiptexNew)))
            return hr;
        ReleasePpo(&m_ptexNew);
        m_ptexNew = pmiptexNew;
    }

    m_dwWidth = dwWidthNew;
    m_dwHeight = dwHeightNew;
    SetModifiedFlag(TRUE);
    UpdateAllViews(NULL, 4);

    return S_OK;
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:34,代码来源:dxtexdoc.cpp


示例2: CALLED

void ESDSinkNode::GetFlavor(flavor_info * outInfo, int32 id)
{
	CALLED();

	outInfo->flavor_flags = B_FLAVOR_IS_GLOBAL;
//	outInfo->possible_count = 0;	// any number
	outInfo->possible_count = 1;	// only 1
	outInfo->in_format_count = 0; // no inputs
	outInfo->in_formats = 0;
	outInfo->out_format_count = 0; // no outputs
	outInfo->out_formats = 0;
	outInfo->internal_id = id;
	
	outInfo->name = new char[256];
		strcpy(outInfo->name, "ESounD Out");
	outInfo->info = new char[256];
		strcpy(outInfo->info, "The ESounD Sink node outputs a network Enlightenment Sound Daemon.");
	outInfo->kinds = /*B_TIME_SOURCE | *//*B_CONTROLLABLE | */ 0;

#if ENABLE_INPUT
	outInfo->kinds |= B_BUFFER_PRODUCER | B_PHYSICAL_INPUT;
	outInfo->out_format_count = 1; // 1 output
	media_format * outformats = new media_format[outInfo->out_format_count];
	GetFormat(&outformats[0]);
	outInfo->out_formats = outformats;
#endif
	
	outInfo->kinds |= B_BUFFER_CONSUMER | B_PHYSICAL_OUTPUT;
	outInfo->in_format_count = 1; // 1 input
	media_format * informats = new media_format[outInfo->in_format_count];
	GetFormat(&informats[0]);
	outInfo->in_formats = informats;
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:33,代码来源:ESDSinkNode.cpp


示例3: GetExtent

void Image::Resize(const Extent3D& extent, const ColorRGBAd& fillColor, const Offset3D& offset)
{
    if (extent != GetExtent())
    {
        /* Store ownership of current image buffer in temporary image */
        Image prevImage;

        prevImage.extent_   = GetExtent();
        prevImage.format_   = GetFormat();
        prevImage.dataType_ = GetDataType();
        prevImage.data_     = std::move(data_);

        if ( extent.width  > GetExtent().width  ||
             extent.height > GetExtent().height ||
             extent.depth  > GetExtent().depth )
        {
            /* Resize image buffer with fill color */
            extent_ = extent;
            data_   = GenerateImageBuffer(GetFormat(), GetDataType(), GetNumPixels(), fillColor);
        }
        else
        {
            /* Resize image buffer with uninitialized image buffer */
            extent_ = extent;
            data_   = GenerateEmptyByteBuffer(GetDataSize(), false);
        }

        /* Copy previous image into new image */
        Blit(offset, prevImage, { 0, 0, 0 }, prevImage.GetExtent());
    }
}
开发者ID:LukasBanana,项目名称:LLGL,代码行数:31,代码来源:Image.cpp


示例4: NS_WARNING

//-------------------------------------------------------------------------
NS_IMETHODIMP nsClipboard::HasDataMatchingFlavors(const char** aFlavorList,
                                                  PRUint32 aLength,
                                                  PRInt32 aWhichClipboard,
                                                  bool *_retval)
{
  *_retval = false;
  if (aWhichClipboard != kGlobalClipboard || !aFlavorList)
    return NS_OK;

  for (PRUint32 i = 0;i < aLength; ++i) {
#ifdef DEBUG
    if (strcmp(aFlavorList[i], kTextMime) == 0)
      NS_WARNING ( "DO NOT USE THE text/plain DATA FLAVOR ANY MORE. USE text/unicode INSTEAD" );
#endif

    UINT format = GetFormat(aFlavorList[i]);
    if (IsClipboardFormatAvailable(format)) {
      *_retval = true;
      break;
    }
    else {
      // We haven't found the exact flavor the client asked for, but maybe we can
      // still find it from something else that's on the clipboard...
      if (strcmp(aFlavorList[i], kUnicodeMime) == 0) {
        // client asked for unicode and it wasn't present, check if we have CF_TEXT.
        // We'll handle the actual data substitution in the data object.
        if (IsClipboardFormatAvailable(GetFormat(kTextMime)))
          *_retval = true;
      }
    }
  }

  return NS_OK;
}
开发者ID:FunkyVerb,项目名称:devtools-window,代码行数:35,代码来源:nsClipboard.cpp


示例5: GetTextToFile

void MapServerDlg::UpdateEnabling()
{
	GetTextToFile()->Enable(m_bToFile);
	GetDotdotdot()->Enable(m_bToFile);

	// For now, going straight to memory must be PNG
	if (!m_bToFile)
		GetFormat()->SetSelection(1);
	GetFormat()->Enable(m_bToFile);
}
开发者ID:kamalsirsa,项目名称:vtp,代码行数:10,代码来源:MapServerDlg.cpp


示例6: MOZ_ASSERT

bool
MemoryTextureClient::ToSurfaceDescriptor(SurfaceDescriptor& aDescriptor)
{
  MOZ_ASSERT(IsValid());
  if (!IsAllocated() || GetFormat() == gfx::FORMAT_UNKNOWN) {
    return false;
  }
  aDescriptor = SurfaceDescriptorMemory(reinterpret_cast<uintptr_t>(mBuffer),
                                        GetFormat());
  return true;
}
开发者ID:armikhael,项目名称:cunaguaro,代码行数:11,代码来源:TextureClient.cpp


示例7: MOZ_ASSERT

TemporaryRef<gfx::DataSourceSurface>
ImageDataSerializerBase::GetAsSurface()
{
  MOZ_ASSERT(IsValid());
  SurfaceBufferInfo* info = GetBufferInfo(mData);
  gfx::IntSize size(info->width, info->height);
  uint32_t stride = gfxASurface::BytesPerPixel(
    gfx::SurfaceFormatToImageFormat(GetFormat())) * info->width;
  RefPtr<gfx::DataSourceSurface> surf =
    gfx::Factory::CreateWrappingDataSourceSurface(GetData(), stride, size, GetFormat());
  return surf.forget();
}
开发者ID:jasager,项目名称:mozilla-central,代码行数:12,代码来源:ImageDataSerializer.cpp


示例8: MOZ_ASSERT

bool
ShmemTextureData::Serialize(SurfaceDescriptor& aOutDescriptor)
{
  MOZ_ASSERT(GetFormat() != gfx::SurfaceFormat::UNKNOWN);
  if (GetFormat() == gfx::SurfaceFormat::UNKNOWN) {
    return false;
  }

  aOutDescriptor = SurfaceDescriptorBuffer(mDescriptor, MemoryOrShmem(mShmem));

  return true;
}
开发者ID:devtools-html,项目名称:gecko-dev,代码行数:12,代码来源:BufferTexture.cpp


示例9: LoadDDSFile

bool LoadDDSFile(TCHAR* pszFile, AMD_TC_Texture& texture)
{
   FILE* pSourceFile = _tfopen(pszFile, _T("rb"));

   if (!pSourceFile) return false;

   DWORD dwFileHeader;
   fread(&dwFileHeader, sizeof(DWORD), 1, pSourceFile);
   if(dwFileHeader != DDS_HEADER)
   {
      _tprintf(_T("Source file is not a valid DDS.\n"));
      fclose(pSourceFile);
      return false;
   }

   DDSD2 ddsd;
   fread(&ddsd, sizeof(DDSD2), 1, pSourceFile);

   memset(&texture, 0, sizeof(texture));
   texture.dwSize = sizeof(texture);
   texture.dwWidth = ddsd.dwWidth;
   texture.dwHeight = ddsd.dwHeight;
   texture.dwPitch = ddsd.lPitch;

   if(ddsd.ddpfPixelFormat.dwRGBBitCount==32)
      texture.format = AMD_TC_FORMAT_ARGB_8888;
   else if(ddsd.ddpfPixelFormat.dwRGBBitCount==24)
      texture.format = AMD_TC_FORMAT_RGB_888;
   else if(GetFormat(ddsd.ddpfPixelFormat.dwPrivateFormatBitCount) != AMD_TC_FORMAT_Unknown)
      texture.format = GetFormat(ddsd.ddpfPixelFormat.dwPrivateFormatBitCount);
   else if(GetFormat(ddsd.ddpfPixelFormat.dwFourCC) != AMD_TC_FORMAT_Unknown)
      texture.format = GetFormat(ddsd.ddpfPixelFormat.dwFourCC);
   else
   {
      _tprintf(_T("Unsupported source format.\n"));
      fclose(pSourceFile);
      return false;
   }

   // Init source texture
   texture.dwDataSize = AMD_TC_CalculateBufferSize(&texture);
   texture.pData = (AMD_TC_BYTE*) malloc(texture.dwDataSize);

   fread(texture.pData, texture.dwDataSize, 1, pSourceFile);
   fclose(pSourceFile);

   return true;
}
开发者ID:basecq,项目名称:magic-txd,代码行数:48,代码来源:AMD_Compress_Test_Helpers.cpp


示例10: doClose

int SUBTITLESOURCE::doClose()
{
	int i,j;

	if (GetFormat()==SUBFORMAT_SSA)
	{
		for (i=0;i<(int)dwNbrOfStyles;i++)
		{
			for (j=0;j<18;j++)	
			{
				if (lplpSSAStyles[i]->lpcArray[j]) delete lplpSSAStyles[i]->lpcArray[j];
			}
			delete lplpSSAStyles[i];
		}

		for (j=0;j<14;j++)
		{
			if (lpSSAHeader->lpcArray && lpSSAHeader->lpcArray[j]) delete lpSSAHeader->lpcArray[j];
		}
	}
	if (lplpSSAStyles) delete lplpSSAStyles;
	if (lpSSAHeader) delete lpSSAHeader;
	lplpSSAStyles=NULL;
	lpSSAHeader=NULL;

	return 0;
}
开发者ID:BrunoReX,项目名称:avimuxgui,代码行数:27,代码来源:SubTitles.cpp


示例11: FindUnicodeFromPlainText

//
// FindUnicodeFromPlainText
//
// we are looking for text/unicode and we failed to find it on the clipboard first,
// try again with text/plain. If that is present, convert it to unicode.
//
bool
nsClipboard :: FindUnicodeFromPlainText ( IDataObject* inDataObject, UINT inIndex, void** outData, PRUint32* outDataLen )
{
  bool dataFound = false;

  // we are looking for text/unicode and we failed to find it on the clipboard first,
  // try again with text/plain. If that is present, convert it to unicode.
  nsresult loadResult = GetNativeDataOffClipboard(inDataObject, inIndex, GetFormat(kTextMime), nullptr, outData, outDataLen);
  if ( NS_SUCCEEDED(loadResult) && *outData ) {
    const char* castedText = reinterpret_cast<char*>(*outData);          
    PRUnichar* convertedText = nullptr;
    PRInt32 convertedTextLen = 0;
    nsPrimitiveHelpers::ConvertPlatformPlainTextToUnicode ( castedText, *outDataLen, 
                                                              &convertedText, &convertedTextLen );
    if ( convertedText ) {
      // out with the old, in with the new 
      nsMemory::Free(*outData);
      *outData = convertedText;
      *outDataLen = convertedTextLen * sizeof(PRUnichar);
      dataFound = true;
    }
  } // if plain text data on clipboard

  return dataFound;

} // FindUnicodeFromPlainText
开发者ID:FunkyVerb,项目名称:devtools-window,代码行数:32,代码来源:nsClipboard.cpp


示例12: GetWorld

FTextureResource* UTextureRenderTarget2D::CreateResource()
{
	UWorld* World = GetWorld();
	ERHIFeatureLevel::Type FeatureLevel = World != nullptr ? World->FeatureLevel : GMaxRHIFeatureLevel;
	if (FeatureLevel <= ERHIFeatureLevel::ES2)
	{
		EPixelFormat Format = GetFormat();
		if ((!GSupportsRenderTargetFormat_PF_FloatRGBA && (Format == PF_FloatRGBA || Format == PF_FloatRGB))
			|| Format == PF_A16B16G16R16)
		{
			OverrideFormat = PF_B8G8R8A8;
		}
	}

	if (bAutoGenerateMips)
	{
		NumMips = FGenericPlatformMath::CeilToInt(FGenericPlatformMath::Log2(FGenericPlatformMath::Max(SizeX, SizeY)));
	}
	else
	{
		NumMips = 1;
	}
 
	FTextureRenderTarget2DResource* Result = new FTextureRenderTarget2DResource(this);
	return Result;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:26,代码来源:TextureRenderTarget2D.cpp


示例13: WriteBitmap

 void ImageWriter::WriteBitmap(Bitmap* bmp, ProgressCallback* callback)
 {
     if (bmp->GetWidth() != GetWidth()) XLI_THROW_INVALID_ARGUMENT("Bitmap must have same width as ImageWriter");
     if (bmp->GetHeight() != GetHeight()) XLI_THROW_INVALID_ARGUMENT("Bitmap must have same height as ImageWriter");
     if (bmp->GetFormat() != GetFormat()) XLI_THROW_INVALID_ARGUMENT("Bitmap must have same format as ImageWriter");
     Write(bmp->GetPtr(), bmp->GetPitch(), callback);
 }
开发者ID:drakh,项目名称:Xli,代码行数:7,代码来源:ImageWriter.cpp


示例14: BMediaNode

MediaReader::MediaReader(
				size_t defaultChunkSize,
				float defaultBitRate,
				const flavor_info * info,
				BMessage * config,
				BMediaAddOn * addOn)
	: BMediaNode("MediaReader"),
	  BBufferProducer(B_MEDIA_MULTISTREAM),
	  AbstractFileInterfaceNode(defaultChunkSize, defaultBitRate, info, config, addOn)
{
	CALLED();

	// null some fields
	fBufferGroup = 0;	
	// start enabled
	fOutputEnabled = true;
	// don't overwrite available space, and be sure to terminate
	strncpy(output.name,"MediaReader Output",B_MEDIA_NAME_LENGTH-1);
	output.name[B_MEDIA_NAME_LENGTH-1] = '\0';
	// initialize the output
	output.node = media_node::null;     // until registration
	output.source = media_source::null; // until registration
	output.destination = media_destination::null;
	GetFormat(&output.format);
}
开发者ID:jiangxilong,项目名称:haiku,代码行数:25,代码来源:MediaReader.cpp


示例15: GetFormat

/// <summary>
/// Calculates the Julian date from the epoch parameter. The format of
/// the epoch can be JulianDate, Date or Packed date format.
/// </summary>
/// <param name="epoch">The time instance in JulianDate, Date or Packed date format</param>
/// <returns>The time instance in double</returns>
int Ephemeris::GetJulianDate(std::string epoch, double &julianDate)
{
	DateTime dateTime;

	std::string data = epoch.substr(2, epoch.length() - 2);
	EpochFormat epochFormat = GetFormat(epoch);
	switch (epochFormat)
	{
		case JulianDate:
			julianDate = atof(data.c_str());
			break;
		case Date:
			DateFormat(epoch, dateTime);
			ToJulianDate(dateTime, julianDate);
			break;
		case PackedDate:
			PackedDateFormat(epoch, dateTime);
			ToJulianDate(dateTime, julianDate);
			break;
		case UndefinedFormat:
			Error::_errMsg = "Undefined format for epoch!";
			Error::PushLocation(__FILE__, __FUNCTION__, __LINE__);
			return 1;
		default:
			Error::_errMsg = "Invalid value for epoch!";
			Error::PushLocation(__FILE__, __FUNCTION__, __LINE__);
			return 1;
	}

	return 0;
}
开发者ID:suliaron,项目名称:solaris.cpu,代码行数:37,代码来源:Ephemeris.cpp


示例16: assert

//--------------------------------------------------------------------------------------
// Name: GetLoopRegionBytes()
// Desc: Gets the loop region, in terms of bytes
//--------------------------------------------------------------------------------------
HRESULT WaveFile::GetLoopRegionBytes( DWORD* pdwStart, DWORD* pdwLength ) const
{
    assert( pdwStart != NULL );
    assert( pdwLength != NULL );

    // If no loop region is explicitly specified, loop the entire file
    *pdwStart = 0;
    GetDuration( pdwLength );

    // We'll need the wave format to convert from samples to bytes
    WAVEFORMATEXTENSIBLE wfx;
    if( FAILED( GetFormat( &wfx ) ) )
        return E_FAIL;

    // See if the file contains an embedded loop region
    DWORD dwLoopStartSamples;
    DWORD dwLoopLengthSamples;
    if( FAILED( GetLoopRegion( &dwLoopStartSamples, &dwLoopLengthSamples ) ) )
        return S_FALSE;

    // For PCM, multiply by bytes per sample
    DWORD cbBytesPerSample = wfx.Format.nChannels * wfx.Format.wBitsPerSample / 8;
    *pdwStart = dwLoopStartSamples * cbBytesPerSample;
    *pdwLength = dwLoopLengthSamples * cbBytesPerSample;

    return S_OK;
}
开发者ID:AlexSincennes,项目名称:CSCI522A6,代码行数:31,代码来源:AtgAudio.cpp


示例17: CALLED

// They made an offer to us.  We should make sure that the offer is
// acceptable, and then we can add any requirements we have on top of
// that.  We leave wildcards for anything that we don't care about.
status_t MediaReader::FormatProposal(
				const media_source & output_source,
				media_format * format)
{
	CALLED();

	if (output.source != output_source) {
		PRINT("\t<- B_MEDIA_BAD_SOURCE\n");
		return B_MEDIA_BAD_SOURCE; // we only have one output so that better be it
	}
	/*	media_format * myFormat = GetFormat();
	fprintf(stderr,"proposed format: ");
	print_media_format(format);
	fprintf(stderr,"\n");
	fprintf(stderr,"my format: ");
	print_media_format(myFormat);
	fprintf(stderr,"\n"); */
	// Be's format_is_compatible doesn't work.
	//	if (!format_is_compatible(*format,*myFormat)) {
	media_format myFormat;
	GetFormat(&myFormat);
	if (!format_is_acceptible(*format,myFormat)) {
		PRINT("\t<- B_MEDIA_BAD_FORMAT\n");
		return B_MEDIA_BAD_FORMAT;
	}
	AddRequirements(format);
	return B_OK;
}
开发者ID:jiangxilong,项目名称:haiku,代码行数:31,代码来源:MediaReader.cpp


示例18: if

BOOL CGridCell::Edit(int nRow, int nCol, CRect rect, CPoint /* point */, UINT nID, UINT nChar)
{
    DWORD dwStyle = ES_LEFT;
    if (GetFormat() & DT_RIGHT) 
        dwStyle = ES_RIGHT;
    else if (GetFormat() & DT_CENTER) 
        dwStyle = ES_CENTER;

    m_bEditing = TRUE;
    
    // InPlaceEdit auto-deletes itself
    CGridCtrl* pGrid = GetGrid();
    m_pEditWnd = new CInPlaceEdit(pGrid, rect, dwStyle, nID, nRow, nCol, GetText(), nChar);
    
    return TRUE;
}
开发者ID:uesoft,项目名称:AutoPHS,代码行数:16,代码来源:gridcell.cpp


示例19: m_SoundCallbacks

Sound::Sound(const std::wstring& waveResourceName, bool loopForever, bool hasReverb) :
	m_SoundCallbacks(this),
	m_SubmixVoice(nullptr)
{
	auto waveFile = RiffFile::Create(waveResourceName);
	Assert(waveFile.GetFormat() == RiffFourCC::WAVE);

	ZeroMemory(&m_WaveFormat, sizeof(m_WaveFormat));
	ZeroMemory(&m_AudioBuffer, sizeof(m_AudioBuffer));

	const auto& formatChunk = waveFile.GetChunk(RiffFourCC::FMT);
	Assert(sizeof(m_WaveFormat) >= formatChunk.GetSize());
	memcpy(&m_WaveFormat, formatChunk.GetData(), formatChunk.GetSize());

	auto& dataChunk = waveFile.GetChunk(RiffFourCC::DATA);
	m_SoundDataBuffer = std::move(dataChunk.GetDataBuffer());

	m_AudioBuffer.AudioBytes = dataChunk.GetSize();
	m_AudioBuffer.pAudioData = m_SoundDataBuffer.get();
	m_AudioBuffer.Flags = XAUDIO2_END_OF_STREAM;
	m_AudioBuffer.LoopCount = loopForever ? XAUDIO2_LOOP_INFINITE : 0;

	if (hasReverb)
	{
		m_SubmixVoice = AudioManager::GetInstance().CreateSubmixVoice(m_WaveFormat);
	}
}
开发者ID:William500,项目名称:Speecher,代码行数:27,代码来源:Sound.cpp


示例20: GetSize

bool
BufferTextureData::BorrowMappedData(MappedTextureData& aData)
{
  if (GetFormat() == gfx::SurfaceFormat::YUV) {
    return false;
  }

  gfx::IntSize size = GetSize();

  aData.data = GetBuffer();
  aData.size = size;
  aData.format = GetFormat();
  aData.stride = ImageDataSerializer::ComputeRGBStride(aData.format, size.width);

  return true;
}
开发者ID:devtools-html,项目名称:gecko-dev,代码行数:16,代码来源:BufferTexture.cpp



注:本文中的GetFormat函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetForwarder函数代码示例发布时间:2022-05-30
下一篇:
C++ GetFormFiller函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap