Lines Matching refs:pState

212 			       struct ScannerState *pState);
215 static int ProcessTcpResponse (struct ScannerState *pState,
219 static int ProcessPageData (struct ScannerState *pState);
1345 struct ScannerState *pState)
1397 if (!(pState->m_tcpFd = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP)))
1402 if (connect (pState->m_tcpFd,
1403 (struct sockaddr *) &pState->m_sockAddr,
1404 sizeof (pState->m_sockAddr)))
1420 nread = read (pState->m_tcpFd, sockBuf, sizeof (sockBuf));
1441 if (ProcessTcpResponse (pState, &tcpBuf))
1452 close (pState->m_tcpFd);
1456 pState->m_bFinish = 1;
1467 close (pState->m_tcpFd);
1476 ProcessTcpResponse (struct ScannerState *pState, struct ComBuf *pTcpBuf)
1541 send (pState->m_tcpFd, buf.m_pBuf, buf.m_used, 0);
1564 &pState->m_xres, sizeof (pState->m_xres));
1568 &pState->m_yres, sizeof (pState->m_yres));
1572 0x06, &pState->m_composition,
1573 sizeof (pState->m_composition));
1577 &pState->m_brightness,
1578 sizeof (pState->m_brightness));
1582 0x06, &pState->m_compression,
1583 sizeof (pState->m_compression));
1587 &pState->m_fileType,
1588 sizeof (pState->m_fileType));
1598 send (pState->m_tcpFd, buf.m_pBuf, buf.m_used, 0);
1610 send (pState->m_tcpFd, buf.m_pBuf, buf.m_used, 0);
1614 memcpy (&pState->m_fileType, pValue, sizeof (pState->m_fileType));
1615 DBG (5, "File type: %x\n", ntohl (pState->m_fileType));
1620 memcpy (&pState->m_compression, pValue,
1621 sizeof (pState->m_compression));
1622 DBG (5, "Compression: %x\n", ntohl (pState->m_compression));
1627 memcpy (&pState->m_xres, pValue, sizeof (pState->m_xres));
1628 DBG (5, "X resolution: %d\n", ntohs (pState->m_xres));
1632 memcpy (&pState->m_yres, pValue, sizeof (pState->m_yres));
1633 DBG (5, "Y resolution: %d\n", ntohs (pState->m_yres));
1637 if (1 || !pState->m_pixelWidth)
1639 memcpy (&pState->m_pixelWidth, pValue,
1640 sizeof (pState->m_pixelWidth));
1641 DBG (5, "Width: %d\n", ntohl (pState->m_pixelWidth));
1650 if (1 || !pState->m_pixelHeight)
1652 memcpy (&pState->m_pixelHeight, pValue,
1653 sizeof (pState->m_pixelHeight));
1654 DBG (5, "Height: %d\n", ntohl (pState->m_pixelHeight));
1669 send (pState->m_tcpFd, buf.m_pBuf, buf.m_used, 0);
1672 pState->m_buf.m_used = 0;
1675 pState->m_currentPageBytes = 0;
1677 pState->m_pixelWidth = 0;
1678 pState->m_pixelHeight = 0;
1690 send (pState->m_tcpFd, buf.m_pBuf, buf.m_used, 0);
1701 send (pState->m_tcpFd, buf.m_pBuf, buf.m_used, 0);
1704 pState->m_buf.m_used = 0;
1715 send (pState->m_tcpFd, buf.m_pBuf, buf.m_used, 0);
1718 shutdown (pState->m_tcpFd, SHUT_RDWR);
1730 errorCheck |= AppendToComBuf (&pState->m_buf, pItem, dataChunkSize);
1735 (unsigned long)pState->m_buf.m_used);
1740 if ( bProcessImage ) errorCheck |= ProcessPageData (pState);
1789 ProcessPageData (struct ScannerState *pState)
1809 if (!pState->m_buf.m_used)
1813 ntohl (pState->m_compression));
1815 switch (ntohl (pState->m_compression))
1831 jpegCinfo.m_bytesRemaining = pState->m_buf.m_used;
1832 jpegCinfo.m_pData = pState->m_buf.m_pBuf;
1853 pState->m_pixelWidth = htonl (jpegCinfo.m_cinfo.output_width);
1854 pState->m_pixelHeight = htonl (jpegCinfo.m_cinfo.output_height);
1868 ret |= AppendToComBuf (&pState->m_imageData,
1880 pState->m_numPages, pageInfo.m_width, pageInfo.m_height, pageInfo.m_totalSize );
1882 ret |= AppendToComBuf( & pState->m_pageInfo, (unsigned char*)& pageInfo, sizeof( pageInfo ) );
1883 ++( pState->m_numPages );
1913 width = ntohl (pState->m_pixelWidth);
1914 height = ntohl (pState->m_pixelHeight);
1922 TIFFWriteRawStrip (pTiff, 0, pState->m_buf.m_pBuf,
1923 pState->m_buf.m_used);
1943 ret |= AppendToComBuf (&pState->m_imageData, NULL, imageBytes);
1948 pOut = pState->m_imageData.m_pBuf
1949 + pState->m_imageData.m_used - imageBytes;
1977 pState->m_numPages, width, height, pageInfo.m_totalSize );
1979 ret |= AppendToComBuf( & pState->m_pageInfo, (unsigned char*)& pageInfo, sizeof( pageInfo ) );
1980 ++( pState->m_numPages );
1995 DBG (1, "ProcessPageData: Unexpected compression flag %d\n", ntohl (pState->m_compression));
2019 struct JpegDataDecompState *pState = (struct JpegDataDecompState *) cinfo;
2025 pState->m_bytesRemaining);
2027 if (!pState->m_bytesRemaining)
2039 cinfo->src->bytes_in_buffer = pState->m_bytesRemaining;
2040 cinfo->src->next_input_byte = (const JOCTET *) pState->m_pData;
2043 pState->m_bytesRemaining = 0;