1 / 25

TWAIN

TWAIN. Open industry standard interface for the input devices to capture multimedia objects More and more sophisticated devies are developed to cater to the needs of various applications. HOW THESE DEVICES ARE USED?. Applications were initially written for a single device

tait
Télécharger la présentation

TWAIN

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. TWAIN • Open industry standard interface for the input devices to capture multimedia objects • More and more sophisticated devies are developed to cater to the needs of various applications

  2. HOW THESE DEVICES ARE USED? • Applications were initially written for a single device • Eg. OCR reads a text and imports the file as ASCII file to the application. • Less flexible and so used different appl. Program for different devices. • Time consuming

  3. Contd. • Later, device drivers were provided with all devices to provide an interface between program and the devices • Appl. program became more complex. • Complicated code for supporting multiple interfaces.

  4. USAGE OF TWAIN • TWAIN working group created an open industry standard interface for input devices • Single TWAIN interface can be used to interface different devices.

  5. BENEFITS OF TWAIN • Application developers can code a single TWAIN interface • Device manufacturers can write device drivers with TWAIN spec. • Multiple devices can be used in appl. Using “Acquire” & “Select Source”

  6. OBJECTIVES • Supports multiple platform • Supports multiple devices • Widespread acceptance with std. interface • Extendibility & backward compatibility • Multidata format • Easy to use

  7. TWAIN ARCHITECTURE

  8. APPLICATION LAYER • Sets up a logical connection with device • No rules on the design • User interface guideline to select sources • Select source helps to select multiple sources • Acquire helps to import data from the selected device.

  9. PROTOCOL LAYER • Provides interface for appl. Layer • Comm. between appl. and acquisition layer • Specifies services provided by a source • Does not specify physical connection, control & devices info. • Source Manager – heart of protocol layer

  10. SOURCE MANAGER • Provide std. API for all sources • Selection of sources • Establish logical sessions b/w appl. and sources. • Regulates traffic and validate transactions • Load or unload sources • Maintain default source • Keep track of sessions and session identities

  11. ACQUISTION LAYER • Contains virtual device driver • Acts directly with device driver Local SOURCE Remote

  12. Functions of source • Control of device • Acquisition of data from device • Transfer of data in agreed format • Control of devices by user DEVICE LAYER Receives the s/w commands and controls the device hardware accordingly

  13. New WAVE RIFF file format • Two mandatory subchunks fmt data Four optional subchunks fact cue points playlist associated data list RIFF STRUCTURE RIFF( ‘WAVE’ <‘fmt’-ck> [<fact-ck>] [<cue-ck>] [<playlist-ck>] [<assoc-data-list>] <wave-data> )

  14. FACT ,CUE POINT & Playlist • Fact chunk <fact-ck>->fact(<dwSampleLength:DWORD> ) Cue–point chunk struct { DWORD dwName; DWORD dwposition; FOURCC fccChunk; DWORD dwChunkStart; DWORD dwBlockStart; DWORD dwSampleOffset; Playlist chunk Struct { DWORD dwName; DWORD dwLength; DWORD dwLoops; }

  15. Associated &Inst Chunk Associated data chunk: <assoc-data-list> ->LIST( ‘adtl’ <label-ck> <note-ck> <ltxt-ck> ) Inst chunk: <instrument-ck> -> inst( <bUnshiftedNote:BYTE> <chFineTune:CHAR> <chGain:CHAR> <bLowNote:BYTE> <bHighNote:BYTE> <bLowVelocity:BYTE> <bHighVelocity:BYTE> )

  16. Setting up new WAVE types • Mandatory chunks fact fmt Extended waveform structure typedef struct waveformat_extended_tag { WORD wFormatTag; WORD wChannels; DWORD nSamplesPerSec; DWORD nAvgBytesPerSec; WORD nBlockAlign; WORD wBitsPerSample; WORD cbSize; }

  17. Table

  18. Microsoft ADPCM WAVE file • Typedef struct adpcmoef_tag { int iCoef1; int iCoef2; } typedef struct adpcmwaveformat_tag { EXTWAVEFORMATEXT ewf; WORD nSamplesPerBlock; WORD nNumberCoef; ADPCMCOEFSET aCoeff[nNumCoef]; }ADPCMWAVEFORMAT;

  19. WAVEFORMATEXT • wFormatTag WAVE_FORMAT_ADPCM • nChannels No. of channels in wave • nSamplesPerSec Frequency of the sample rate • nAvgBytesPerSec Avg. data rate • nBlockAlign block alignment of data in<data-ck> • wbitsPerSample No. of bits per sample of ADPCM • cbExtraSize size in bytes of WAVE format chunk • nSamplesPerBlock no. of samples per block • nNumCoef No. of coefficient sets in aCoef • aCoef coefficients used by wave

  20. BLOCK • It has 3 parts Header, data & padding typedef struct adpcmblockheader_tag { BYTE bpredictor[nChannels]; Int iDelta[nChannels]; Int iSamp1[nChannels]; Int iSamp2[nChannels]; }ADPBLOKHEADER; CCITT Standard Companded WAVE types Stores file-dependent info about the contents of Wave data Two types OF wFormatTag WAVE_FORMAT_ALAM (0X0006) USED IN U.S WAVE_FORMAT_MULAW(OX0007) USED IN EUROPE Note: Rest as in previous slide

  21. DVI ADPCM WAVE • DEFINED AS WAVE_FORMAT_DVI_ADPCM(OXOO11) • STRUCTURE typedef struct dvi_adpcmwaveformat_tag{ WAVEFORMATEXT ewf; WORD wSamplesPerBlock; }DVIADPCMWAVEFORMAT; • wFormatTag is WAVE_FORMAT_DVI_ADPCM.

  22. BLOCK • Block has 2 parts • Header • Data Header Typedef struct dvi_adpcmblockheader_tag { Int iSamp0; BYTE bStepTableIndex; BYTE bReserved; }.DVI_ADPCMBLOCKHEADER;

  23. Creative Labs ADPCM • Supports compression & decompression in real time • Fact Chunk : wFormatTag is WAVE_FORMAT_CREATIVE_ADPCM(0X0200) Typedef struct creative_adpcmwaveformat_tag { WAVEFORMATEXT ewf; WORD wRevision; }CREATIVEHEADPCMWAVEFORMAT; wRevision - Revision of the algorithm

  24. Dolby Labs AC-2 Wave Type • Primarily used for music compression • The wFormatType of the fact chunk is WAVE_FORMAT_DOLBY_AC2(0X0030) WAVEFORMATEXT STRUCTURE: nAuxBitsCode – Auxillary bits code indicating no. of aux bits per block code no. of bits/block 0 0 1 8 2 16 3 32

  25. THANK YOU

More Related