Ejemplo n.º 1
0
def enYJ1(input):
    dll=cdll.LoadLibrary(utilcommon.getPallibPath())
    buffer=POINTER(c_byte)()
    length=c_int()
    inbuf=input
    dll.encodeyj1(inbuf,len(inbuf),byref(buffer),byref(length))
    return string_at(buffer,length)
Ejemplo n.º 2
0
def enYJ2(input):
    dll = cdll.LoadLibrary(utilcommon.getPallibPath())
    buffer = POINTER(c_byte)()
    length = c_int()
    inbuf = input
    dll.encodeyj2(inbuf, len(inbuf), byref(buffer), byref(length), c_int(1))
    return string_at(buffer, length)
Ejemplo n.º 3
0
def enRLE(indexed_buffer, width, height):
    dll = cdll.LoadLibrary(utilcommon.getPallibPath())
    length = c_int()
    buffer = POINTER(c_byte)()
    dll.encoderlet(indexed_buffer, args.transparent_palette_index, width,
                   width, height, byref(buffer), byref(length))
    return string_at(buffer, length)
Ejemplo n.º 4
0
def deRLE(input):
    dll=cdll.LoadLibrary(utilcommon.getPallibPath())
    width,height = struct.unpack("<hh",input[0:4])
    length=width*height
    ArrayType = c_int16 * length
    buffer = ArrayType()
    memset(buffer,args.transparent_palette_index,length)
    dll.decoderle(input,c_void_p(addressof(buffer)),width,width,height,0,0)
    return width,height,string_at(buffer,width*height)
Ejemplo n.º 5
0
def enRLE(indexed_buffer,width,height):
    dll=cdll.LoadLibrary(utilcommon.getPallibPath())
    length=c_int()
    buffer=POINTER(c_byte)()
    dll.encoderlet(indexed_buffer,args.transparent_palette_index,width,width,height,byref(buffer),byref(length))
    return string_at(buffer,length)
Ejemplo n.º 6
0
def deYJ1(input):
    dll=cdll.LoadLibrary(utilcommon.getPallibPath())
    buffer=POINTER(c_byte)()
    length=c_int()
    dll.decodeyj1(input,byref(buffer),byref(length))
    return string_at(buffer,length)
Ejemplo n.º 7
0
def deRNG(source, prev_frame):
    dll=cdll.LoadLibrary(utilcommon.getPallibPath())
    dll.decoderng(source,c_void_p(addressof(prev_frame)))
    return string_at(prev_frame,length)
Ejemplo n.º 8
0
def enRNG(prev_frame, cur_frame):
    dll = cdll.LoadLibrary(utilcommon.getPallibPath())
    buffer = POINTER(c_byte)()
    len = c_int()
    dll.encoderng(prev_frame, cur_frame, byref(buffer), byref(len))
    return string_at(buffer, len)