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

C++ GetBits函数代码示例

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

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



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

示例1: DecodeFillElement

/**************************************************************************************
 * Function:    DecodeFillElement
 *
 * Description: decode one fill element
 *
 * Inputs:      BitStreamInfo struct pointing to start of fill element
 *                (14496-3, table 4.4.11) 
 *
 * Outputs:     updated element instance tag
 *              unpacked extension payload
 *
 * Return:      0 if successful, -1 if error
 **************************************************************************************/
static int DecodeFillElement(AACDecInfo *aacDecInfo, BitStreamInfo *bsi)
{
	unsigned int fillCount;
	unsigned char *fillBuf;
	PSInfoBase *psi;

	/* validate pointers */
	if (!aacDecInfo || !aacDecInfo->psInfoBase)
		return -1;
	psi = (PSInfoBase *)(aacDecInfo->psInfoBase);

	fillCount = GetBits(bsi, 4);
	if (fillCount == 15)
		fillCount += (GetBits(bsi, 8) - 1);

	psi->fillCount = fillCount;
	fillBuf = psi->fillBuf;
	while (fillCount--)
		*fillBuf++ = GetBits(bsi, 8);

	aacDecInfo->currInstTag = -1;	/* fill elements don't have instance tag */
	aacDecInfo->fillExtType = 0;

#ifdef AAC_ENABLE_SBR
	/* check for SBR 
	 * aacDecInfo->sbrEnabled is sticky (reset each raw_data_block), so for multichannel 
	 *    need to verify that all SCE/CPE/ICCE have valid SBR fill element following, and 
	 *    must upsample by 2 for LFE
	 */
	if (psi->fillCount > 0) {
		aacDecInfo->fillExtType = (int)((psi->fillBuf[0] >> 4) & 0x0f);
		if (aacDecInfo->fillExtType == EXT_SBR_DATA || aacDecInfo->fillExtType == EXT_SBR_DATA_CRC)
			aacDecInfo->sbrEnabled = 1;
	}
开发者ID:carlocaione,项目名称:buildroot-ved-2014-05-27,代码行数:47,代码来源:decelmnt.c


示例2: QVariant

void AVRStudioXMLParser::Parse(QString configDirPath, Part *pPart)
{
    QXmlQuery query;
    QString result;
    query.bindVariable("partName", QVariant(configDirPath));
    query.setQuery(GetXQuery());
    query.evaluateTo(&result);

    // for future use
    QString errorMsg;
    int line;
    int col;

    QDomDocument doc;
    if(!doc.setContent(result, &errorMsg, &line, &col))
        return;

    QDomNode root = doc.firstChild();
    QDomNode fuses = root.firstChild();
    QDomNode locks = fuses.nextSibling();
    QDomNode interfaces = locks.nextSibling();

    pPart->SetFuseBits(GetBits(fuses.firstChild()));
    pPart->SetLockBits(GetBits(locks.firstChild()));
    pPart->SetProgrammingInterfaces(GetInterfaces(interfaces.firstChild()));
}
开发者ID:ttomek32,项目名称:tmfavrcalculator,代码行数:26,代码来源:AVRStudioXMLParser.cpp


示例3: CPulseData_Read

/*
  The function reads the elements for pulse data from
  the bitstream.
*/
void CPulseData_Read(HANDLE_BIT_BUF bs,     /*!< pointer to bitstream */
                     CPulseData *PulseData) /*!< pointer to pulse data side info */
{
  int i;

  FLC_sub_start("CPulseData_Read");

  FUNC(2); INDIRECT(1); STORE(1); BRANCH(1);
  if ((PulseData->PulseDataPresent = (char) GetBits(bs,1)))
  {
    FUNC(2); INDIRECT(2); STORE(1);
    PulseData->NumberPulse = (char) GetBits(bs,2);

    FUNC(2); INDIRECT(2); STORE(1);
    PulseData->PulseStartBand = (char) GetBits(bs,6);

    PTR_INIT(2); /* PulseData->PulseOffset[i]
                    PulseData->PulseAmp[i]
                 */
    LOOP(1);
    for (i=0; i<=PulseData->NumberPulse; i++)
    {
      FUNC(2); STORE(1);
      PulseData->PulseOffset[i] = (char) GetBits(bs,5);

      FUNC(2); STORE(1);
      PulseData->PulseAmp[i] = (char) GetBits(bs,4);
    }
  }

  FLC_sub_end();
}
开发者ID:wonktnodi,项目名称:webrtc_port,代码行数:36,代码来源:pulsedata.cpp


示例4: DecodeDataStreamElement

/**************************************************************************************
 * Function:    DecodeDataStreamElement
 *
 * Description: decode one DSE
 *
 * Inputs:      BitStreamInfo struct pointing to start of DSE (14496-3, table 4.4.10) 
 *
 * Outputs:     updated element instance tag
 *              filled in data stream buffer
 *
 * Return:      0 if successful, -1 if error
 **************************************************************************************/
static int DecodeDataStreamElement(AACDecInfo *aacDecInfo, BitStreamInfo *bsi)
{
	unsigned int byteAlign, dataCount;
	unsigned char *dataBuf;
	PSInfoBase *psi;

	/* validate pointers */
	if (!aacDecInfo || !aacDecInfo->psInfoBase)
		return -1;
	psi = (PSInfoBase *)(aacDecInfo->psInfoBase);

	aacDecInfo->currInstTag = GetBits(bsi, NUM_INST_TAG_BITS);
	byteAlign = GetBits(bsi, 1);
	dataCount = GetBits(bsi, 8);
	if (dataCount == 255)
		dataCount += GetBits(bsi, 8);

	if (byteAlign)
		ByteAlignBitstream(bsi);

	psi->dataCount = dataCount;
	dataBuf = psi->dataBuf;
	while (dataCount--)
		*dataBuf++ = GetBits(bsi, 8);

	return 0;
}
开发者ID:carlocaione,项目名称:buildroot-ved-2014-05-27,代码行数:39,代码来源:decelmnt.c


示例5: rfx_rlgr_get_gr_code

static uint32
rfx_rlgr_get_gr_code(RFX_BITSTREAM * bs, int * krp, int * kr)
{
	int vk;
	uint32 mag;

	/* chew up/count leading 1s and escape 0 */
	for (vk = 0; GetBits(1) == 1;)
		vk++;

	/* get next *kr bits, and combine with leading 1s */
	mag = (vk << *kr) | GetBits(*kr);

	/* adjust krp and kr based on vk */
	if (!vk)
	{
		UpdateParam(*krp, -2, *kr);
	}
	else if (vk != 1)
	{
		/* at 1, no change! */
		UpdateParam(*krp, vk, *kr);
	}

	return mag;
}
开发者ID:mfleisz,项目名称:FreeRDP-old,代码行数:26,代码来源:rfx_rlgr.c


示例6: CodeToFile

//把出现过的字符编码表经过压缩写进文件
short CodeToFile(FILE *fp,char **hc,short n,SeqQueue *Q,MyType *length)
{
    int i;
    char *p;
    MyType j,bits;
    short count=0;

    for(i = 0;i < n;i++)// 将n个叶子压缩并写入文件
    {
        for(p = hc[i]; '\0' != *p; p++)
            In_seqQueue( Q,*p );

        while(Q->length > 8)
        {
            bits = GetBits(Q);//出队8个元素
            fputc(bits,fp);
            count++;
        }
    }

    *length = Q->length;
    i = 8 - *length;
    bits = GetBits(Q);//取8个如果队不空
    for(j = 0;j < i;j++)
        bits = bits << 1;
    fputc(bits,fp);
    count++;

    InitQueue(Q);
    return count;
}
开发者ID:Gaoyuan0710,项目名称:Huffman,代码行数:32,代码来源:Huffman.c


示例7: ntohs

bool CxImageSKA::Decode(CxFile *hFile)
{
	if (hFile==NULL)
		return false;

	// read the  header
	SKAHEADER ska_header;
	hFile->Read(&ska_header,sizeof(SKAHEADER),1);

    ska_header.Width = ntohs(ska_header.Width);
    ska_header.Height = ntohs(ska_header.Height);
    ska_header.dwUnknown = ntohl(ska_header.dwUnknown);

	// check header
	if (ska_header.dwUnknown != 0x01000000 ||
		ska_header.Width > 0x7FFF || ska_header.Height > 0x7FFF ||
		ska_header.BppExp != 3)
		return false;

	if (info.nEscape == -1){
		head.biWidth = ska_header.Width ;
		head.biHeight= ska_header.Height;
		info.dwType = CXIMAGE_FORMAT_SKA;
		return true;
	}

	int bpp = 1<<ska_header.BppExp;

	Create(ska_header.Width,ska_header.Height,bpp,CXIMAGE_FORMAT_SKA);
	if (!IsValid())
		return false;

	// read the palette
	int nColors = 1<<bpp;
	rgb_color* ppal = (rgb_color*)malloc(nColors*sizeof(rgb_color));
	if (!ppal) return false;
	hFile->Read(ppal,nColors*sizeof(rgb_color),1);
	SetPalette(ppal,nColors);
	free(ppal);

	//read the image
	hFile->Read(GetBits(),ska_header.Width*ska_header.Height,1);

	//reorder rows
	if (GetEffWidth() != ska_header.Width){
		BYTE *src,*dst;
		src = GetBits() + ska_header.Width*(ska_header.Height-1);
		dst = GetBits(ska_header.Height-1);
		for(int y=0;y<ska_header.Height;y++){
			memcpy(dst,src,ska_header.Width);
			src -= ska_header.Width;
			dst -= GetEffWidth();
		}
	}

	Flip();

	return true;
}
开发者ID:Aliceljm1,项目名称:CxImageVS2010,代码行数:59,代码来源:ximaska.cpp


示例8: UninstDbgBreakfromThrd

DWORD
UninstDbgBreakfromThrd( DWORD dwThreadId, DWORD dwLineAddr,  DWORD dwAccessType)
{
	HANDLE hThread;
	hThread = OpenThread( THREAD_SET_CONTEXT|THREAD_GET_CONTEXT|THREAD_SUSPEND_RESUME, 
		FALSE, dwThreadId );
	if ( hThread == NULL )
		return GetLastError();

	if ( -1 == SuspendThread( hThread ))
		return GetLastError();

	CONTEXT cxt = {0};
	cxt.ContextFlags = CONTEXT_DEBUG_REGISTERS|CONTEXT_FULL;
	if (!GetThreadContext( hThread, &cxt ))
		return GetLastError();

	if (cxt.Dr0 == dwLineAddr)
	{
		if (dwAccessType == GetBits(cxt.Dr7, 16, 2))
		{
			SetBits(cxt.Dr7, DR7_L0, 1, 0);
		}
	}
	if (cxt.Dr1 == dwLineAddr)
	{
		if (dwAccessType == GetBits(cxt.Dr7, 20, 2))
		{
			SetBits(cxt.Dr7, DR7_L1, 1, 0);
		}
	}
	if (cxt.Dr2 == dwLineAddr)
	{
		if (dwAccessType == GetBits(cxt.Dr7, 24, 2))
		{
			SetBits(cxt.Dr7, DR7_L2, 1, 0);
		}
	}
	if (cxt.Dr3 == dwLineAddr)
	{
		if (dwAccessType == GetBits(cxt.Dr7, 28, 2))
		{
			SetBits(cxt.Dr7, DR7_L3, 1, 0);
		}
	}
	
	cxt.ContextFlags = CONTEXT_DEBUG_REGISTERS;
	if(!SetThreadContext( hThread, &cxt ))
		return GetLastError();
	if(-1 == ResumeThread( hThread ))
		return GetLastError();
	return 0;
}
开发者ID:danieljiang0415,项目名称:gh,代码行数:53,代码来源:dbghook.cpp


示例9: GetDCFCounter

/*  
 *  GetDCFCounter
 *
 *  Description:
 *      This function will read a counter from a specified 
 *      position in a dynamic count filter.
 *
 *  Parameters:
 *      dcf: [in]
 *          The dynamic count filter whose counter is to be read.
 *      index: [in]
 *          The index of the counter to be read.
 *
 *  Returns:
 *      The counter in the specified position.
 *
 *  Comments:
 *
 */
unsigned GetDCFCounter(DynamicCountFilter *dcf, unsigned index)
{
	unsigned ofvCounter;
	unsigned cbfvCounter = GetBits((unsigned *)dcf->CBFV, 
			                       index * dcf->CBFV_Counter_Size, 
			                       dcf->CBFV_Counter_Size);
	if (dcf->OFV == NULL)
		return cbfvCounter;

	ofvCounter = GetBits((unsigned *)dcf->OFV, 
			             index * dcf->OFV_Counter_Size, 
			             dcf->OFV_Counter_Size);
	return (ofvCounter << dcf->CBFV_Counter_Size) | cbfvCounter;
}
开发者ID:axxapp,项目名称:winxgui,代码行数:33,代码来源:DynamicCountFilter.c


示例10: DecodeChannelPairElement

/**************************************************************************************
 * Function:    DecodeChannelPairElement
 *
 * Description: decode one CPE
 *
 * Inputs:      BitStreamInfo struct pointing to start of CPE (14496-3, table 4.4.5) 
 *
 * Outputs:     updated element instance tag
 *              updated commonWin
 *              updated ICS info, if commonWin == 1
 *              updated mid-side stereo info, if commonWin == 1
 *
 * Return:      0 if successful, -1 if error
 *
 * Notes:       doesn't decode individual channel stream (part of DecodeNoiselessData)
 **************************************************************************************/
static int DecodeChannelPairElement(AACDecInfo *aacDecInfo, BitStreamInfo *bsi)
{
	int sfb, gp, maskOffset;
	unsigned char currBit, *maskPtr;
	PSInfoBase *psi;
	ICSInfo *icsInfo;

	/* validate pointers */
	if (!aacDecInfo || !aacDecInfo->psInfoBase)
		return -1;
	psi = (PSInfoBase *)(aacDecInfo->psInfoBase);
	icsInfo = psi->icsInfo;

	/* read instance tag */
	aacDecInfo->currInstTag = GetBits(bsi, NUM_INST_TAG_BITS);

	/* read common window flag and mid-side info (if present) 
	 * store msMask bits in psi->msMaskBits[] as follows:
	 *  long blocks -  pack bits for each SFB in range [0, maxSFB) starting with lsb of msMaskBits[0]
	 *  short blocks - pack bits for each SFB in range [0, maxSFB), for each group [0, 7]
	 * msMaskPresent = 0 means no M/S coding
	 *               = 1 means psi->msMaskBits contains 1 bit per SFB to toggle M/S coding
	 *               = 2 means all SFB's are M/S coded (so psi->msMaskBits is not needed)
	 */
	psi->commonWin = GetBits(bsi, 1);
	if (psi->commonWin) {
		DecodeICSInfo(bsi, icsInfo, psi->sampRateIdx);
		psi->msMaskPresent = GetBits(bsi, 2);
		if (psi->msMaskPresent == 1) {
			maskPtr = psi->msMaskBits;
			*maskPtr = 0;
			maskOffset = 0;
			for (gp = 0; gp < icsInfo->numWinGroup; gp++) {
				for (sfb = 0; sfb < icsInfo->maxSFB; sfb++) {
					currBit = (unsigned char)GetBits(bsi, 1);
					*maskPtr |= currBit << maskOffset;
					if (++maskOffset == 8) {
						maskPtr++;
						*maskPtr = 0;
						maskOffset = 0;
					}
				}		
			}
		}
	}

	return 0;
}
开发者ID:carlocaione,项目名称:buildroot-ved-2014-05-27,代码行数:64,代码来源:decelmnt.c


示例11: GetWidth

bool CImageEx::SetGray()
{
	int nWidth = GetWidth();
	int nHeight = GetHeight();

	BYTE* pArray = (BYTE*)GetBits();
	int nPitch = GetPitch();
	int nBitCount = GetBPP() / 8;

	for (int i = 0; i < nHeight; i++) 
	{
		for (int j = 0; j < nWidth; j++) 
		{
			int grayVal = (BYTE)(((*(pArray + nPitch * i + j * nBitCount) * 306)
				+ (*(pArray + nPitch * i + j * nBitCount + 1) * 601)
				+ (*(pArray + nPitch * i + j * nBitCount + 2) * 117) + 512 ) >> 10);	// ¼ÆËã»Ò¶ÈÖµ

			*(pArray + nPitch * i + j * nBitCount) = grayVal;							// ¸³»Ò¶ÈÖµ
			*(pArray + nPitch * i + j * nBitCount + 1) = grayVal;
			*(pArray + nPitch * i + j * nBitCount + 2) = grayVal;
		}
	}

	return true;
}
开发者ID:9crk,项目名称:EasyClient,代码行数:25,代码来源:ImageEx.cpp


示例12: GetImageSize

oexINT CImage::GetBits( oexPVOID x_buf, oexINT x_nSize )
{
#if !defined( OEX_ENABLE_XIMAGE )
	return 0;
#else

	// Sanity checks
	if ( !x_buf || !x_nSize )
		return 0;

	// Get image size
	oexINT nSize = GetImageSize();
	if ( nSize > x_nSize )
		nSize = x_nSize;

	// Get destination buffer
	oexPVOID pBits = GetBits();
	if ( !pBits )
		return 0;

	// Copy the data
	memcpy( x_buf, pBits, nSize );

	return nSize;
#endif
}
开发者ID:MangoCats,项目名称:winglib,代码行数:26,代码来源:image.cpp


示例13: GetBits

BYTE CxDib::GetPixelIndex(long x,long y)
{
	if ((hDib==NULL)||(m_nColors==0)||
		(x<0)||(y<0)||(x>=m_bi.biWidth)||(y>=m_bi.biHeight)) return 0;
	BYTE* iDst = GetBits();
	return iDst[(m_bi.biHeight - y)*m_LineWidth + x];
}
开发者ID:F5000,项目名称:spree,代码行数:7,代码来源:xShadeButton.cpp


示例14: DecodeEnvelope

/**************************************************************************************
 * Function:    DecodeEnvelope
 *
 * Description: decode the power envelope
 *
 * Inputs:      pointer to initialized Gecko2Info struct
 *              number of bits remaining in bitstream for this frame
 *              index of current channel
 *
 * Outputs:     rmsIndex[0, ..., cregsions-1] has power index for each region
 *              updated rmsMax with largest value of rmsImdex for this channel
 *
 * Return:      number of bits remaining in bitstream, -1 if out-of-bits
 **************************************************************************************/
int DecodeEnvelope(Gecko2Info *gi, int availbits, int ch)
{
	int r, code, nbits, rprime, cache, rmsMax;
	int *rmsIndex = gi->db.rmsIndex;
	BitStreamInfo *bsi = &(gi->bsi);

	if (availbits < RMS0BITS)
		return -1;

	/* unpack first index */
	code = GetBits(bsi, RMS0BITS, 1); 
	availbits -= RMS0BITS;
	rmsIndex[0] = CODE2RMS(code);

	/* check for escape code */
	/* ASSERT(rmsIndex[0] != 0); */

	rmsMax = rmsIndex[0];
	for (r = 1; r < gi->cRegions; r++) {

		/* for interleaved regions, choose a reasonable table */
		if (r < 2 * gi->cplStart) {
			rprime = r >> 1;
			if (rprime < 1) 
				rprime = 1;
		} else {
开发者ID:knone1,项目名称:hardware-ingenic-xb4780,代码行数:40,代码来源:envelope.c


示例15: GetWidth

void
Dib::Render (/*[in]*/ HDC	hdc,
	     /*[in]*/ int	x,
	     /*[in]*/ int	y,
	     /*[in]*/ int	cx,
	     /*[in]*/ int	cy)
{
  if (cx < 0)
  {
    cx = GetWidth();
  }
  if (cy < 0)
  {
    cy = GetHeight();
  }
  SetStretchBltMode (hdc, COLORONCOLOR);
  if (StretchDIBits(hdc,
    x,
    y,
    cx,
    cy,
    0,
    0,
    GetWidth(),
    GetHeight(),
    GetBits(),
    GetBitmapInfo(),
    DIB_RGB_COLORS,
    SRCCOPY)
      == GDI_ERROR)
  {
    FATAL_WINDOWS_ERROR ("StretchDIBits", 0);
  }
}
开发者ID:bngabonziza,项目名称:miktex,代码行数:34,代码来源:Dib.cpp


示例16: RebuildOFV

/*  
 *  RebuildOFV
 *
 *  Description:
 *      This function will rebuild the overflow vector of the 
 *      specified dynamic count filter with a new counter size.
 *
 *  Parameters:
 *      dcf: [in/out]
 *          The dynamic count filter whose overflow vector is 
 *          to be rebuilt.
 *      counterSize: [in]
 *          The new counter size of the overflow vector.
 *
 *  Returns:
 *      Nothing.
 *
 *  Comments:
 *
 */
void RebuildOFV(DynamicCountFilter *dcf, unsigned counterSize)
{
	if (counterSize == 0)  /* delete OFV */
	{
		free(dcf->OFV);
		dcf->OFV = NULL;
	}
	else if (counterSize == 1 && dcf->OFV_Counter_Size == 0)  /* create OFV */
	{
		dcf->OFV = (char *)calloc(dcf->Length / 8, 1);
	}
	else  /* rebuild OFV */
	{
		unsigned i, counter;
		char *newOFV = (char *)calloc(dcf->Length / 8 * counterSize, 1);
		for (i = 0; i < dcf->Length; i++)
		{
			counter = GetBits((unsigned *)dcf->OFV, 
				              i * dcf->OFV_Counter_Size, 
							  dcf->OFV_Counter_Size);
			if (counter > 0)
				SetBits((unsigned *)newOFV, i * counterSize, 
				        counterSize, counter);
		}
		free(dcf->OFV);
		dcf->OFV = newOFV;
	}

	dcf->OFV_Counter_Size = counterSize;
}
开发者ID:axxapp,项目名称:winxgui,代码行数:50,代码来源:DynamicCountFilter.c


示例17: BFMembershipQuery

/*  
 *  BFMembershipQuery
 *
 *  Description:
 *      This function will query whether a specified element 
 *      is a member of the set represented by the specified 
 *      bloom filter.
 *
 *  Parameters:
 *      bf: [in]
 *          The bloom filter on which the query is done.
 *      element: [in]
 *          The element to be checked.
 *      length: [in]
 *          The bytes of the element.
 *
 *  Returns:
 *      1 if the element is a member of the set, otherwise 0.
 *
 *  Comments:
 *
 */
int BFMembershipQuery(BloomFilter *bf, const unsigned char *element, unsigned length)
{
	int result = 1, i;

	/*
	 * generate k hash addresses
	 */
	unsigned *hashAddress = (unsigned *)malloc(sizeof(unsigned) * bf->Hash_Num);
	if (!GenerateHashAddress(element, length, bf->Length, bf->Hash_Num, hashAddress))
	{
		free(hashAddress);
		return 0;
	}

	/*
	 * check the bit in each hash address
	 */
	for (i = 0; i < bf->Hash_Num; i++)
	{
		if (!GetBits((unsigned *)bf->Bit_Array, hashAddress[i], 1))
		{
			result = 0;
			break;
		}
	}

	free(hashAddress);
	return result;
}
开发者ID:axxapp,项目名称:winxgui,代码行数:51,代码来源:BloomFilter.c


示例18: CreateDIBSection

void CCeXDib::Draw(HDC hDC, DWORD dwX, DWORD dwY)
{
	HBITMAP	hBitmap = NULL;
	HBITMAP	hOldBitmap = NULL;
	HDC		hMemDC = NULL;

	if (m_hBitmap == NULL)
	{
		m_hBitmap = CreateDIBSection(hDC, (BITMAPINFO*)m_hDib, DIB_RGB_COLORS, &m_lpBits, NULL, 0);
		if (m_hBitmap == NULL)	return;
		if (m_lpBits == NULL)
		{
			::DeleteObject(m_hBitmap);
			m_hBitmap = NULL;
			return;
		} // if
	} // if

    memcpy(m_lpBits, GetBits(), m_bi.biSizeImage);

	if (m_hMemDC == NULL)
	{
		m_hMemDC = CreateCompatibleDC(hDC);
		if (m_hMemDC == NULL)	return;
	} // if

	hOldBitmap = (HBITMAP)SelectObject(m_hMemDC, m_hBitmap);

	BitBlt(hDC, dwX, dwY, m_bi.biWidth, m_bi.biHeight, m_hMemDC, 0, 0, SRCCOPY);

	SelectObject(m_hMemDC, hOldBitmap);
} // End of Draw
开发者ID:Codiscope-Research,项目名称:ykt4sungard,代码行数:32,代码来源:CeXDib.cpp


示例19: g4expand

/* Expand group-4 data */
void
g4expand(struct pagenode *pn, drawfunc df)
{
    int RunLength;		/* Length of current run */
    int a0;			/* reference element */
    int b1;			/* next change on previous line */
    int lastx = pn->size.width();/* copy line width to register */
    pixnum *run0, *run1;	/* run length arrays */
    pixnum *thisrun, *pa, *pb;	/* pointers into runs */
    t16bits *sp;		/* pointer into compressed data */
    t32bits BitAcc;		/* bit accumulator */
    int BitsAvail;		/* # valid bits in BitAcc */
    int	LineNum;		/* line number */
    int EOLcnt;
    struct tabent *TabEnt;

    sp = pn->data;
    BitAcc = 0;
    BitsAvail = 0;
    /* allocate space for 2 runlength arrays */
    run0 = (pixnum *) malloc(2 * ((lastx+5)&~1) * sizeof(pixnum));
    run1 = run0 + ((lastx+5)&~1);
    run1[0] = lastx;		/* initial reference line */
    run1[1] = 0;

    for (LineNum = 0; LineNum < pn->rowsperstrip; ) {
#ifdef DEBUG_FAX
	printf("\nBitAcc=%08lX, BitsAvail = %d\n", BitAcc, BitsAvail);
	printf("-------------------- %d\n", LineNum);
	fflush(stdout);
#endif
	RunLength = 0;
	if (LineNum & 1) {
	    pa = run1;
	    pb = run0;
	}
	else {
	    pa = run0;
	    pb = run1;
	}
	thisrun = pa;
	a0 = 0;
	b1 = *pb++;
	expand2d(EOFB);
	if (a0 < lastx) {
	    if ((pa - run0) & 1)
		SETVAL(0);
	    SETVAL(lastx - a0);
	}
	SETVAL(0);	/* imaginary change at end of line for reference */
	(*df)(thisrun, LineNum++, pn);
	continue;
    EOFB:
	NeedBits(13);
	if (GetBits(13) != 0x1001 && verbose)
            kError() << "Bad RTC\n";
	break;
    }
    free(run0);
}
开发者ID:Axure,项目名称:okular,代码行数:61,代码来源:faxexpand.cpp


示例20: while

wxSoundStream& wxSoundStreamG72X::Write(const void *buffer, wxUint32 len)
{
    wxUint16 *old_linear;
    register wxUint16 *linear_buffer;
    register wxUint32 countdown = len;
    register wxUint32 real_len;
    
    // Compute the real length (PCM format) to sendt to the sound card
    real_len = (len * m_n_bits / 8);
    
    // Allocate a temporary buffer
    old_linear = linear_buffer = new wxUint16[real_len];
    
    // Bad, we override the const
    m_io_buffer = (wxUint8 *)buffer;
    m_current_b_pos = 0;
    
    // Decode the datas
    while (countdown != 0) {
        *linear_buffer++ = m_decoder(GetBits(), AUDIO_ENCODING_LINEAR, m_state);
        countdown--;
    }
    m_lastcount = len;
    
    // Send them to the sound card
    m_router->Write(old_linear, real_len);
    
    // Destroy the temporary buffer
    delete[] old_linear;
    
    return *m_router;
}
开发者ID:nealey,项目名称:vera,代码行数:32,代码来源:sndg72x.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GetBlobSize函数代码示例发布时间:2022-05-30
下一篇:
C++ GetBitmap函数代码示例发布时间: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