

pf_size != pf_size : raise DDSException ( 'Invalid pixelformat size ( %d instead of %d )' % ( meta. size != fmt_size : raise DDSException ( 'Invalid header size ( %d instead of %d )' % ( meta. fields : meta = header # check header validity if meta. read () # ensure magic if data != 'DDS ' : raise DDSException ( 'Invalid magic header' ) # read header fmt = 'I' * 31 fmt_size = calcsize ( fmt ) pf_size = calcsize ( 'I' * 8 ) header, data = data, data if len ( header ) != fmt_size : raise DDSException ( 'Truncated header in' ) # depack header = unpack ( fmt, header ) meta = self. filename = filename with open ( filename, 'rb' ) as fd : data = fd. load ( filename ) def load ( self, filename ): self. images_size = for field, index in DDSFile.

''' from struct import pack, unpack, calcsize # DDSURFACEDESC2 dwFlags DDSD_CAPS = 0x00000001 DDSD_HEIGHT = 0x00000002 DDSD_WIDTH = 0x00000004 DDSD_PITCH = 0x00000008 DDSD_PIXELFORMAT = 0x00001000 DDSD_MIPMAPCOUNT = 0x00020000 DDSD_LINEARSIZE = 0x00080000 DDSD_DEPTH = 0x00800000 # DDPIXELFORMAT dwFlags DDPF_ALPHAPIXELS = 0x00000001 DDPF_FOURCC = 0x00000004 DDPF_RGB = 0x00000040 DDPF_LUMINANCE = 0x00020000 # DDSCAPS2 dwCaps1 DDSCAPS_COMPLEX = 0x00000008 DDSCAPS_TEXTURE = 0x00001000 DDSCAPS_MIPMAP = 0x00400000 # DDSCAPS2 dwCaps2 DDSCAPS2_CUBEMAP = 0x00000200 DDSCAPS2_CUBEMAP_POSITIVEX = 0x00000400 DDSCAPS2_CUBEMAP_NEGATIVEX = 0x00000800 DDSCAPS2_CUBEMAP_POSITIVEY = 0x00001000 DDSCAPS2_CUBEMAP_NEGATIVEY = 0x00002000 DDSCAPS2_CUBEMAP_POSITIVEZ = 0x00004000 DDSCAPS2_CUBEMAP_NEGATIVEZ = 0x00008000 DDSCAPS2_VOLUME = 0x00200000 # Common FOURCC codes DDS_DXTN = 0x00545844 DDS_DXT1 = 0x31545844 DDS_DXT2 = 0x32545844 DDS_DXT3 = 0x33545844 DDS_DXT4 = 0x34545844 DDS_DXT5 = 0x35545844 def dxt_to_str ( dxt ): if dxt = DDS_DXT1 : return 's3tc_dxt1' elif dxt = DDS_DXT2 : return 's3tc_dxt2' elif dxt = DDS_DXT3 : return 's3tc_dxt3' elif dxt = DDS_DXT4 : return 's3tc_dxt4' elif dxt = DDS_DXT5 : return 's3tc_dxt5' elif dxt = 0 : return 'rgba' elif dxt = 1 : return 'alpha' elif dxt = 2 : return 'luminance' elif dxt = 3 : return 'luminance_alpha' def str_to_dxt ( dxt ): if dxt = 's3tc_dxt1' : return DDS_DXT1 if dxt = 's3tc_dxt2' : return DDS_DXT2 if dxt = 's3tc_dxt3' : return DDS_DXT3 if dxt = 's3tc_dxt4' : return DDS_DXT4 if dxt = 's3tc_dxt5' : return DDS_DXT5 if dxt = 'rgba' : return 0 if dxt = 'alpha' : return 1 if dxt = 'luminance' : return 2 if dxt = 'luminance_alpha' : return 3 def align_value ( val, b ): return val + ( - val % b ) def check_flags ( val, fl ): return ( val & fl ) = fl def dxt_size ( w, h, dxt ): w = max ( 1, w // 4 ) h = max ( 1, h // 4 ) if dxt = DDS_DXT1 : return w * h * 8 elif dxt in ( DDS_DXT2, DDS_DXT3, DDS_DXT4, DDS_DXT5 ): return w * h * 16 return - 1 It might change in the future and we advise you don't rely on it in your code. warning:: This is an external library and Kivy does not provide any support for it. DDS Format - :: :: (everything is uint32) Size Flags Height Width PitchOrLinearSize Depth MipmapCount Reserved1 * 11 :: Size Flags FourCC RGBBitCount RBitMask GBitMask BBitMask ABitMask :: Caps1 Caps2 Reserved1 * 2 Reserverd2. The initial version was written by:: Alexey Borzenkov All the initial work credits go to him! Thank you :) This version uses structs instead of ctypes. ''' DDS File library = This library can be used to parse and save DDS (`DirectDraw Surface `) files.
Txd workshop unsupported fourcc code windows#
Common definitions for a Windows provider.Auto Create Input Provider Config Entry for Available MT Hardware (linux only).Native support for Multitouch devices on Linux, using libmtdev.Native support of MultitouchSupport framework for MacBook (MaxOSX platform).
Txd workshop unsupported fourcc code driver#
Native support of Wacom tablet from linuxwacom driver.Native support for HID input from the linux kernel.

Compatibility module for Python 2.7 and > 3.3.Touch Tracer Line Drawing Demonstration.Multistroke Recognition Database Demonstration.Texture Wrapping and Coordinates Example.Application example using build() + return.
