%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/share/hplip/base/__pycache__/
Upload File :
Create Path :
Current File : //usr/share/hplip/base/__pycache__/mfpdtf.cpython-312.pyc

�

=	faE��>�ddlZddlZddl�ddl�dZdZdZdZdZdZ	d	Z
d
ZdZdZ
dZdZdZdZd
ZdZdZdZdZdZdZdZdZdZd
ZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)dZ*dZ+d
Z,dZ-dZ.dZ/dZ0dZ1dZ2dZ3dZ4dZ5dZ6dZ7dZ8dZ9d
Z:dZ;dZ<dZ=dZ>dZ?dZ@d�ZAd�ZBd�ZCdd�ZDd d�ZEy)!�N�)�*����� �@������	�
���
����J�$�3c�X�d}tj||dd�\}}}}|dz}||||fS)Nz<IHBBr�)�struct�unpack)�buffer�fmt�	block_len�
header_len�	data_type�
page_flagss      �/usr/share/hplip/base/mfpdtf.py�parseFixedHeaderr&ps?��
�C�39�=�=��f�R�a�j�3Q�0�I�z�9�j��d�"�J��j�)�Z�7�7�c�~�|tk(r*d}tj||dd�\}}}}}}||||||fS|tk(ryy)Nz<BBHHHHr)�DT_SCANNED_IMAGESrr�
DT_FAX_IMAGES)	rr#r �	major_ver�	minor_ver�	src_pages�copies_per_page�zoom�
jpeg_q_factors	         r%�parseImageVariantHeaderr1vs]���%�%���PV�P]�P]�^a�ci�jm�km�cn�Po�M�	�9�i��$�
��)�Y���}�T�T�	�m�	#��
$r'c
��tjd|d�d}|tk(rDd}tj||dt�\
}}}}}}}	}
}}}
}}||k(sJ�|||||||	|
|||
||ffS|tk(r0d}tj||dt
�\}}}||k(sJ�|||ffS|tk(r6d}tj||dt�\}}}}}}||k(sJ�||||||ffStjd|z�tt��)N�<Brz<BBHHHIIIHHIIIz<BBHz<BBBBIIzError: Invalid record type: %d)rr�
RT_START_PAGE�SOP_RECORD_SIZE�	RT_RASTER�RASTER_RECORD_SIZE�RT_END_PAGE�EOP_RECORD_SIZE�log�error�Error�ERROR_INTERNAL)r�record_typer �id�encoding�page_num�	black_ppr�	black_bpp�	black_rpp�black_hort_dpi�black_vert_dpi�cmy_ppr�cmy_bpp�cmy_rpp�cmy_hort_dpi�cmy_vert_dpi�unused�	data_size�unused1�unused2�unused3�
black_rows�cmy_rowss                       r%�parseRecordrS~sy���-�-��f�Q�i�0��3�K��m�#����M�M�#�v�&6��7�8�	W��H�h�	�9�i��Q_�ah�jq�sz�}I�KW��[� � � ��H�h�	�9�i��Yg�ip�ry�|C�EQ�S_�`�`�	`�	�	�	!��� &�
�
�c�6�:M�;M�3N� O���F�I��[� � � ��F�I�&�&�&�	��	#���>D�m�m�C�QW�Xh�Yh�Qi�>j�;��G�W�g�z�8��[� � � ��G�W�g�z�8�D�D�D��I�I�.��<�=�
��
�r'c�	�ttd��\}}}}d\}	}
}}}
d}|	|k7�r�tjd|	z�|	|k(r�|r|}	�ne|
dk(r(|j	|�\}}t|�}
|�|�}t
�\}}}}|tz
|tz
}}tjdt|�t|�||||||fz�|
tz}
|td}|}	tjd|
||fz�|tzr|}	�n�|dkD�r�|}	�n�|	|k(r�tk(rVt|�\}}}}}}tjd||||||fz�|td}|tz}|tz}|
tz}
n4|tk(rtjd	�ntjd	�tjd|
||fz�|dkDrtjd
�|}	���|}	|dk(r|}	���|	|k(�r�t�\}}|tk(r�|\}}}} }!}"}#}$}%}&}'}(tjd||fz�|t d}|t z}|
t z}
|dk7rtjd�|}	��K|r|}	n|}	tjd|
||fz���o|t"k(�rz|\})}*tjd
|*|*fz�|t$d}|t$z}|
t$z}
tjd|
||fz�|dkDr{|
dkDrvtjd�t|�}+tjd|+|+fz�|j'|d|�||+z}|
|+z}
|
dk7rtjd�|}	��N|dkDr~|rn{tjd�|j	|�\}}|�|�}t|�}+tjd|+|+fz�|j'|d|�|
|+z
}
||+z}|dkDr�~|dk7rtjd�|}	���|}	���|t(k(r�|\},}-}.}/}0tjd|/|0fz�|t*d}|t*z}|
t*z}
|dk7rtjd�tjd|
||fz�t,zs	|tzr|}	n|}	���|	|k7r���tjd|
z�|S)Nr)rrrrrFz**** State %d ****rzbFixed header: (datalen=%d(0x%x),blocklen=%d(0x%x),headerlen=%d(0x%x),datatype=0x%x,pageflags=0x%x)z Data: data=%d,block=%d,header=%dz[Variant header: (major/minor=%d/%d,src_pages=%d,copies_per_page=%d,zoom=%d,jpeg_q_factor=%dzUnsupported data typezHeader size error.z+Start page record: (encoding=0x%x, page=%d)zBlock size error.z#Raster record: (data size=%d(0x%x))zWriting remainder of data...zData len=%d(0x%x)zData size errorz Reading more data from device...z,End page record: (black_rows=%d,cmy_rows=%d)z
Read %d bytes)�list�ranger:�debug�readChannel�lenr&�FIXED_HEADER_SIZE�PAGE_FLAG_END_STREAMr)r1�IMAGE_VARIANT_HEADER_SIZEr*r;rSr4r5r6r7�writer8r9�PAGE_FLAG_END_DOC)1�device�
channel_id�stream�single_read�callback�	STATE_END�STATE_FIXED_HEADER�STATE_VARIANT_HEADER�STATE_RECORD�state�total_bytes�block_remaining�header_remaining�data_remaining�endScan�fields�datar!r"r#r$r+r,r-r.r/r0r>�recordr@rArBrCrDrErFrGrHrIrJrKrLrM�data_lenrNrOrPrQrRs1                                                 r%�readChannelToStreamrr�sb��HL�U�ST�X��E�I�!�#7��LY�I�E�;��)9�>��G�
�9�
��	�	�&��.�/��&�&��!�����"�%�1�1�*�=����!$�T����'�&�j�G�;K�D�;Q�8�I�z�9�j�09�:K�0K�Z�Xi�Mi�-�O��I�I�z��T��C��I�y�)�Z��U^�`j�k�l�
m��/�/�N��)�*�+�D� �E��I�I�8�N�O�]m�;n�n�o��0�0�!����!�#�,���*�
*��-�-�Xo�pt�v�YA�U�	�9�i��$�
��	�	�w��	�9�o�t�]�[�\�]��5�6�7���#<�<�� �$=�=� ��";�;���m�+��	�	�1�2��	�	�1�2��I�I�8�N�O�]m�;n�n�o��!�#��	�	�.�/�!��� �E��!�#�*���
�l�
"�"-�d�"3��K���m�+�LR�J��(�I�y�)�^�Uc��W�g�|�\��	�	�G�8�U]�J^�^�_��O�,�-���?�2���/�1��"�a�'��I�I�1�2�%�E���%�E�.�E��I�I�@�N�Tc�eu�Cv�v�w���	�)�$*�!��	��	�	�?�9�i�BX�X�Y��.�/�0���#5�5���"4�4���	�	�<��P_�aq�?r�r�s�"�Q�&�>�A�+=��I�I�<�=�"�4�y�H��I�I�1�X�h�4G�G�H��L�L��&6��!7�8�#�x�/�O�"�h�.�N�%��*��	�	�"3�4� )�� �%��)����I�I�@�A�#)�#5�#5�j�#A�L�F�D��+�"*�*��"�4�y�H��I�I�1�X�h�4G�G�H��L�L��&6��!7�8��8�+�K�#�x�/�O�&��)�"#�a�'��I�I�1�2�%�E��*�����+�BH�?���'�:�x��	�	�H�J�X`�Ka�a�b��O�,�-���?�2���/�1��"�a�'��I�I�1�2��	�	�<��P_�aq�?r�r�s�� 1�1�� 4�4�%�E�.�E��]�9�
�`�I�I�o��+�,��Nr'c��tj�}|jtjdd��t
}|r%|tk(r
|tz
}n|tk(r	|tz
}|jtjd|��|jtjd|��|jtjd|��|�r�|tk(rz|jtjdtt��|jtjdd��|jtjdd���n|tk(�r|jtjdtt��|jtjdt��|jtjdd��|jtjdt��|jtjdd��|jd�|jd	�|jd	�|jdd�|tk(r:|�7|d
}|j|�|jddt|�z
z�yy|tk(ryy)Nz<Irz<Hr3z<BBrrzz                    zdial-string�)�io�StringIOr]r�packrZ�DT_DIAL_STRINGS� DIAL_STRINGS_VARIANT_HEADER_SIZEr*�FAX_IMAGE_VARIANT_HEADER_SIZE�	MAJOR_VER�	MINOR_VER�SRC_HOST�TTI_NONErY)r#r$�send_variantro�blockr"�dial_strings       r%�buildMFPDTFBlockr�2s���

�K�K�M�E�	�K�K����D�!�$�%�"�J����'��:�:�J�
�-�
'��7�7�J�	�K�K����D�*�-�.�	�K�K����D�)�,�-�	�K�K����D�*�-�.����'��K�K����E�9�i�@�A��K�K����D�!�,�-��K�K����D�"�-�.�
�-�
'��K�K����E�9�i�@�A��K�K����D�(�3�4��K�K����D�!�,�-��K�K����D�(�3�4��K�K����D�!�,�-��K�K�	�"��K�K�	�"��K�K�	�"��K�K��a� ��O�#����}�-�K��K�K��$��K�K���3�{�#3� 3�4�5��

�m�	#��
$r')TN)rFN)Frru�g�codes�NEW_PAGE�END_PAGE�NEW_DOCUMENT�END_DOCUMENT�
END_STREAM�RESERVED_20�RESERVED_40�RESERVED_80�MFPDTF_RASTER_BITMAP�MFPDTF_RASTER_GRAYMAP�MFPDTF_RASTER_MH�MFPDTF_RASTER_MR�MFPDTF_RASTER_MMR�MFPDTF_RASTER_RGB�MFPDTF_RASTER_YCC411�MFPDTF_RASTER_JPEG�MFPDTF_RASTER_PCL�MFPDTF_RASTER_NOT�
DT_UNKNOWNr*r)rx�
DT_DEMO_PAGES�DT_SPEED_DIALS�DT_FAX_LOGS�DT_CFG_PARMS�DT_LANG_STRS�DT_JUNK_FAX_CSIDS�DT_REPORT_STRS�DT_FONTS�
DT_TTI_BITMAP�DT_COUNTERS�DT_DEF_PARMS�DT_SCAN_OPTIONS�DT_FW_JOB_TABLEr4r6r8rZr\ryrzr5r7r9�DIAL_STRING_RECORD_SIZE�PAGE_FLAG_NEW_PAGE�PAGE_FLAG_END_PAGE�PAGE_FLAG_NEW_DOCr^r[�SRC_UNKNOWNr}�SRC_SCANNER�SRC_HOST_THEN_SCANNER�SRC_SCANNER_THEN_HOSTr~�TTI_PREPENDED_TO_IMAGE�TTI_OVERLAYED_ON_IMAGEr{r|r&r1rSrrr��r'r%�<module>r�s���.�	������������
����������������������������
��
������
����������������
����������
�
�	�������#$� � "������������������������������
������
�	�
�	�8�
� �6U�r,
r'

Zerion Mini Shell 1.0