python/urlimport_myevan 모듈 목록

Posted at 2010/01/22 15:49// Posted in python/py-urlimport
urlimport urlimport
url 모듈 임포트를 지원합니다.

urlimport_myevan myevan.net 모듈 지원
myevan.net python  모듈을 지원합니다..

ctypes_utils ctypes 도구
DLL URL 로딩을 지원합니다.

os_utils os 모듈을 사용하는 확장 도구 함수들
- os_walkf 지원

xml_utils xml 을 다룰 때 사용하는 확장 도구 함수들
- xml 인코딩 처리
- xml Element 추가, 삭제, 찾기 함수

devil 이미지 라이브러리
각종 이미지 로딩과 저장을지원합니다.
- DevIL-1.7.8.dll (win32)

ilu DevIL 이미지 라이브러리
이미지 도구입니다. 확대, 축소, 회전등 다양한 이미지 변환 작업을 지원합니다.
- DevILU-1.7.8.dll (win32)

minilzo minilzo
minilzo-1.08 버전입니다
- minilzo.pyd (python-2.6 win32)

p4 p4python-2009.02
퍼포스 API 파이썬 바인딩
- 도움말 http://perforce.com/perforce/doc.092/manuals/p4script/03_python.html
- P4API.pyd (python-2.6 win32)

P4_utils p4 sync 예제
퍼포스 폴더를 최신으로 업데이트한다.

hello hello 예제
urlimport 작동을 체크하기 위한 예제입니다.


이올린에 북마크하기(0) 이올린에 추천하기(0)
2010/01/22 15:49 2010/01/22 15:49

python/urlimport_myevan 모듈 사용 방법

Posted at 2010/01/22 15:42// Posted in python/py-urlimport
준비작업

1. urlimport
urlimport 를 가능하게 해주는 모듈입니다.
다운로드 후 python/Lib/site-packages 에 복사해야합니다.

2. urlimport_myevan
myevan.net 에 있는 모듈을 사용할 수 있게 등록해줍니다.
다운로드 후 python/Lib/site-package 나 작업 폴더에 넣어주면 됩니다.


따라하기

DevIL 모듈을 urlimport 를 사용해서 사용하는 예제입니다.


import urlimport_myevan
import devil


위의 스크립트를 실행하면

pycache 폴더에 devil.py 과 ctypes_utils.py
작업 폴더에 최신 버전의 DevIL-1.7.8.dll 이 다운로드됩니다.


주의!
새로운 모듈을 다운받기 위해서는 pycache 폴더를 삭제해야합니다
이올린에 북마크하기(0) 이올린에 추천하기(0)
2010/01/22 15:42 2010/01/22 15:42

DevIL 윈도우에서 빌드하기

Posted at 2009/05/18 11:27// Posted in msvc
게임에서 잡다구리 이미지 포멧을 읽을때 DevIL 을 사용하고 있습니다.
몇년간 대규모 업데이트가 없어서 잊고 살다가...
쓰레드 모델 문제 때문에 소스를 다시 받아보려고 찾아가보니~
http://openil.sourceforge.net/

엄청 활발하게 활동하고 있는 것 같내요 -ㅁ-)/
윈도우 사용자를 위한 LibCompiled.zip 도 다시 지원하고 말이죠 햐햐 -ㅂ-

하지만 다운로드 소스는 윈도우 프로젝트 파일이 빠져있더군요 -_-;
요즘은 다들 SVN 저장소로 직접 다운로드 받기 때문인지 잘 관리가 안되는걸까요..

그래서 저도 SVN 저장소로 다운 받았습니다.
https://openil.svn.sourceforge.net/svnroot/openil/trunk/DevIL

윈도우는 의존성을 알아서 찾아야 하는데-_-;
매우 귀찮은 작업이므로 그냥 컴파일된 것도 받아서
http://downloads.sourceforge.net/openil/LibCompiled-vc8.zip

압축을 푼다음 src-IL/include 와 src-IL/lib 폴더에 복사해둡니다.

vc2005 솔류션은 projects/msvc8/ImageLib.sln 입니다.
src-IL 프로젝트 라이브러리 설정에 src-IL/lib 연결이 없으므로 연결해주시고요~

컴파일전에 include/config.h.win 을 include/config.h 로 이름을 변경하고 설정작업을
해줘야 합니다. 그냥 빌드하면 각종 라이브러리가 없다고 에러를 냅니다-_-


#define IL_NO_BLP
// #define IL_NO_BMP
#define IL_NO_CUT
#define IL_NO_CHEAD
#define IL_NO_DCX
// #define IL_NO_DDS
#define IL_NO_DICOM
#define IL_NO_DOOM
#define IL_NO_EXR
#define IL_NO_FITS
#define IL_NO_FTX
// #define IL_NO_GIF
// #define IL_NO_HDR
// #define IL_NO_ICO
#define IL_NO_ICNS
#define IL_NO_IWI
#define IL_NO_JP2
// #define IL_NO_JPG
#define IL_NO_LCMS
#define IL_NO_LIF
#define IL_NO_MDL
#define IL_NO_MNG
#define IL_NO_PCD
// #define IL_NO_PCX
#define IL_NO_PIC
#define IL_NO_PIX
// #define IL_NO_PNG
#define IL_NO_PNM
// #define IL_NO_PSD
// #define IL_NO_PSP
#define IL_NO_PXR
// #define IL_NO_RAW
#define IL_NO_ROT
#define IL_NO_SGI
#define IL_NO_SUN
// #define IL_NO_TGA
// #define IL_NO_TIF
#define IL_NO_TPL
#define IL_NO_WAL
#define IL_NO_WDP
#define IL_NO_XPM

// 중간 생략

//#undef ILUT_USE_DIRECTX8
#define ILUT_USE_DIRECTX9
//#define ILUT_USE_DIRECTX10
#define ILUT_USE_OPENGL
//#define ILUT_USE_SDL
#define ILUT_USE_WIN32


그냥 유명한 확장자 빼고는 전부 IL_NO_* 주석을 풀어주세요~
ILUT 플랫폼도 사용하고자하는 플랫폼만 남기고 주석처리합니다

컴파일하다보면 ilu_error.c 에서 다국어 에러 메시지 처리 때문에 에러를 내는데

#include "ilu_internal.h"
+#include "ilu_error/ilu_err-english.h"
+/*
#include "ilu_error/ilu_err-arabic.h"
#include "ilu_error/ilu_err-dutch.h"
-#include "ilu_error/ilu_err-english.h"
#include "ilu_error/ilu_err-french.h"
#include "ilu_error/ilu_err-german.h"
#include "ilu_error/ilu_err-italian.h"
#include "ilu_error/ilu_err-japanese.h"
#include "ilu_error/ilu_err-spanish.h"
+*/

-
ILconst_string *iluErrors;
ILconst_string *iluLibErrors;
ILconst_string *iluMiscErrors;
-#define ILU_NUM_LANGUAGES 8
+#define ILU_NUM_LANGUAGES 1

ILconst_string *iluErrorStrings[ILU_NUM_LANGUAGES] = {
iluErrorStringsEnglish,
+ /*
iluErrorStringsArabic,
iluErrorStringsDutch,
iluErrorStringsFrench,
@@ -36,10 +38,12 @@
iluErrorStringsSpanish,
iluErrorStringsGerman,
iluErrorStringsItalian
+ */
};

ILconst_string *iluLibErrorStrings[ILU_NUM_LANGUAGES] = {
iluLibErrorStringsEnglish,
+ /*
iluLibErrorStringsArabic,
iluLibErrorStringsDutch,
iluLibErrorStringsFrench,
@@ -47,10 +51,12 @@
iluLibErrorStringsSpanish,
iluLibErrorStringsGerman,
iluLibErrorStringsItalian
+ */
};

ILconst_string *iluMiscErrorStrings[ILU_NUM_LANGUAGES] = {
iluMiscErrorStringsEnglish,
+ /*
iluMiscErrorStringsArabic,
iluMiscErrorStringsDutch,
iluMiscErrorStringsFrench,
@@ -58,6 +64,7 @@
iluMiscErrorStringsSpanish,
iluMiscErrorStringsGerman,
iluMiscErrorStringsItalian
+ */

한글도 없고 귀찮으니 영어만 남기고 제거합니다.

~(-_-)~ 이제 사용하기만 하면 됩니다~ 짜잔~
이올린에 북마크하기(0) 이올린에 추천하기(0)
2009/05/18 11:27 2009/05/18 11:27

pygame devil 사용해서 이미지 출력하기

Posted at 2008/01/21 11:54// Posted in python/pygame
import pygame
from ctypes import *
from devil import *

def Main():
    if not ilLoad(IL_DDS, "test.dds"):
        return

    ilConvertImage(IL_BGR, IL_UNSIGNED_BYTE)

    imgWidth = ilGetInteger(IL_IMAGE_WIDTH)
    imgHeight = ilGetInteger(IL_IMAGE_HEIGHT)
    imgSize = imgWidth * imgHeight * 3

    print imgWidth, imgHeight

    pygame.init()
    screen = pygame.display.set_mode((320, 240))
    image = pygame.image.frombuffer(string_at(ilGetData(), imgSize), (imgWidth, imgHeight), "RGB")
    while True:
        for event in pygame.event.get():
            if pygame.KEYDOWN == event.type:
                if pygame.K_ESCAPE == event.key:
                    return

            if pygame.QUIT == event.type:
                return

        screen.fill((0, 0, 0))
        screen.blit(image, image.get_rect())
        pygame.display.flip()


Main()
이올린에 북마크하기(0) 이올린에 추천하기(0)
2008/01/21 11:54 2008/01/21 11:54
Tag ,

파이썬 devil ilu 모듈 (ilu.py)

Posted at 2007/06/05 13:54// Posted in python
import ctypes
mod = ctypes.windll.ilu

from ctypes import pointer, POINTER, c_int, c_byte, c_short, c_long, c_float, c_double, c_uint, c_ubyte, c_ushort, c_ulong, c_char_p

ILenum = c_uint
ILbitfield = c_uint
ILboolean = c_ubyte
ILbyte = c_byte
ILubyte = c_ubyte
ILshort = c_short
ILushort = c_ushort
ILint = c_int
ILuint = c_uint
ILsizei = c_int
ILfloat = c_float
ILclampf = c_float
ILdouble = c_double
ILclampd = c_double
ILstring = c_char_p
ILvoid = c_int

from ctypes import Structure
class ILinfo(Structure):
    _fields_ = [
        ("Id", ILuint),
        ("Data", POINTER(ILubyte)),
        ("Width", ILuint),
        ("Height", ILuint),
        ("Depth", ILuint),
        ("Bpp", ILubyte),
        ("SizeOfData", ILuint),
        ("Format", ILenum),
        ("Type", ILenum),
        ("Origin", ILenum),
        ("Palette", POINTER(ILubyte)),
        ("PalType", ILenum),
        ("PalSize", ILuint),
        ("CubeFlags", ILenum),
        ("NumNext", ILuint),
        ("NumMips", ILuint),
        ("NumLayers", ILuint),
    ]

class ILpointf(Structure):
    _fields_ = [
        ("x", ILfloat),
        ("y", ILfloat),
    ]

class ILpointi(Structure):
    _fields_ = [
        ("x", ILint),
        ("y", ILint),
    ]

iluAlienify = mod.iluAlienify
iluAlienify.restype = ILboolean
iluBlurAvg = mod.iluBlurAvg
iluBlurAvg.restype = ILboolean
iluBlurGaussian = mod.iluBlurGaussian
iluBlurGaussian.restype = ILboolean
iluBuildMipmaps = mod.iluBuildMipmaps
iluBuildMipmaps.restype = ILboolean
iluColoursUsed = mod.iluColoursUsed
iluCompareImage = mod.iluCompareImage
iluCompareImage.restype = ILboolean
iluContrast = mod.iluContrast
iluContrast.restype = ILboolean
iluCrop = mod.iluCrop
iluCrop.restype = ILboolean
iluDeleteImage = mod.iluDeleteImage
iluEdgeDetectE = mod.iluEdgeDetectE
iluEdgeDetectE.restype = ILboolean
iluEdgeDetectP = mod.iluEdgeDetectP
iluEdgeDetectP.restype = ILboolean
iluEdgeDetectS = mod.iluEdgeDetectS
iluEdgeDetectS.restype = ILboolean
iluEmboss = mod.iluEmboss
iluEmboss.restype = ILboolean
iluEnlargeCanvas = mod.iluEnlargeCanvas
iluEnlargeCanvas.restype = ILboolean
iluEnlargeImage = mod.iluEnlargeImage
iluEnlargeImage.restype = ILboolean
iluEqualize = mod.iluEqualize
iluEqualize.restype = ILboolean
iluErrorString = mod.iluErrorString
iluErrorString.restype = ILstring
iluFlipImage = mod.iluFlipImage
iluFlipImage.restype = ILboolean
iluGammaCorrect = mod.iluGammaCorrect
iluGammaCorrect.restype = ILboolean
iluGenImage = mod.iluGenImage
iluGetImageInfo = mod.iluGetImageInfo
iluGetInteger = mod.iluGetInteger
iluGetIntegerv = mod.iluGetIntegerv
iluGetString = mod.iluGetString
iluGetString.restype = ILstring
iluImageParameter = mod.iluImageParameter
iluInit = mod.iluInit
iluInvertAlpha = mod.iluInvertAlpha
iluInvertAlpha.restype = ILboolean
iluLoadImage = mod.iluLoadImage
iluMirror = mod.iluMirror
iluMirror.restype = ILboolean
iluNegative = mod.iluNegative
iluNegative.restype = ILboolean
iluNoisify = mod.iluNoisify
iluNoisify.restype = ILboolean
iluPixelize = mod.iluPixelize
iluPixelize.restype = ILboolean
iluRegionfv = mod.iluRegionfv
iluRegioniv = mod.iluRegioniv
iluReplaceColour = mod.iluReplaceColour
iluReplaceColour.restype = ILboolean
iluRotate = mod.iluRotate
iluRotate.restype = ILboolean
iluRotate3D = mod.iluRotate3D
iluRotate3D.restype = ILboolean
iluSaturate1f = mod.iluSaturate1f
iluSaturate1f.restype = ILboolean
iluSaturate4f = mod.iluSaturate4f
iluSaturate4f.restype = ILboolean
iluScale = mod.iluScale
iluScale.restype = ILboolean
iluScaleColours = mod.iluScaleColours
iluScaleColours.restype = ILboolean
iluSharpen = mod.iluSharpen
iluSharpen.restype = ILboolean
iluSwapColours = mod.iluSwapColours
iluSwapColours.restype = ILboolean
iluWave = mod.iluWave
iluWave.restype = ILboolean

ILU_FILTER_GAUSSIAN_3x3 = 2052
ILU_FILTER = 9728
ILU_NEAREST = 9729
ILU_SCALE_LANCZOS3 = 9736
ILU_VERSION = 161
ILU_VERSION_NUM = 3554
ILU_FILTER_LAPLACIAN1 = 2058
ILU_FILTER_LAPLACIAN2 = 2059
ILU_FILTER_LAPLACIAN3 = 2060
ILU_FILTER_EMBOSS1 = 2055
ILU_FILTER_EMBOSS2 = 2056
ILU_SCALE_BOX = 9732
ILU_UPPER_RIGHT = 1796
ILU_CENTER = 1797
ILU_BILINEAR = 9731
ILU_PLACEMENT = 1792
ILU_SCALE_BSPLINE = 9735
ILU_SCALE_BELL = 9734
ILU_INVALID_ENUM = 1281
ILU_LINEAR = 9730
ILU_LOWER_LEFT = 1793
ILU_FILTER_BLUR = 2051
ILU_FILTER_GAUSSIAN_5X5 = 2053
ILU_SCALE_MITCHELL = 9737
ILU_LOWER_RIGHT = 1794
ILU_ILLEGAL_OPERATION = 1286
ILU_INVALID_PARAM = 1289
ILU_INTERNAL_ERROR = 1284
ILU_SCALE_TRIANGLE = 9733
ILU_OUT_OF_MEMORY = 1282
ILU_INVALID_VALUE = 1285
ILU_FILTER_SHARPEN1 = 2062
ILU_FILTER_SHARPEN2 = 2063
ILU_FILTER_SHARPEN3 = 2064
ILU_UPPER_LEFT = 1795
ILU_CONVOLUTION_MATRIX = 1808
ILU_VERSION_1_6_1 = 1
ILU_FILTER_LAPLACIAN4 = 2061

iluInit()
이올린에 북마크하기(0) 이올린에 추천하기(0)
2007/06/05 13:54 2007/06/05 13:54
Tag ,
# devil  http://www.myevan.net/entry/%ED%8C%8C%EC%9D%B4%EC%8D%AC-devil-%EB%AA%A8%EB%93%88
import
wx

from devil import *
from ctypes import c_ubyte, string_at

class DDSHandler(wx.PyImageHandler):
    def __init__(self, *args, **kwargs):
        wx.PyImageHandler.__init__(self)

        self.SetName("DDS Image")
        self.SetExtension("dds")
        self.SetType(wx.BITMAP_TYPE_ANI + 1)
        self.SetMimeType("image/x-dds")

    def GetImageCount(self):
        return 1

    def LoadFile(self, image, stream, verbose, index):
        data = stream.read()

        if not ilLoadL(IL_TYPE_UNKNOWN, data, len(data)):
            return False

        ilConvertImage(IL_BGR, IL_UNSIGNED_BYTE)

        image_width = ilGetInteger(IL_IMAGE_WIDTH)
        image_height = ilGetInteger(IL_IMAGE_HEIGHT)
        image_data = string_at(ilGetData(), image_width * image_height * 3)

        image.Destroy()
        image.Create(image_width, image_height)
        image.SetData(image_data)

        return True

    def SaveFile(self, image, stream, verbose):
        raise NotImplementedError

    def DoCanRead(self, stream):
        return True

wx.Image.AddHandler(DDSHandler())

class TestFrame(wx.Frame):
    def __init__(self, parent, title):
        wx.Frame.__init__(self, parent, -1, title, pos=(0, 0), size=(320, 240))
        self.CentreOnScreen(wx.BOTH)

        self.bmp = wx.BitmapFromImage(wx.Image("test.dds"))
        self.Bind(wx.EVT_PAINT, self.__OnPaint)

    def __OnPaint(self, event):
        dc = wx.PaintDC(self)
        dc.DrawBitmap(self.bmp, 10, 10, True)

class TestApp(wx.App):
    def OnInit(self):
        "OnInit"
        frame = TestFrame(None, "TestApp")
        frame.Show()
        self.SetTopWindow(frame)
        return True

    def OnExit(self):
        "OnExit"
        pass

TestApp(redirect=False).MainLoop()

참고자료:
http://www.bitpim.org/pyxr/c/projects/bitpim/src/brewcompressedimage.py.html

이올린에 북마크하기(0) 이올린에 추천하기(0)
2007/05/14 19:32 2007/05/14 19:32

파이썬 devil 모듈 (devil.py)

Posted at 2007/05/14 12:40// Posted in python
import ctypes
mod = ctypes.windll.devil

from ctypes import pointer, POINTER, c_int, c_byte, c_short, c_long, c_float, c_double, c_uint, c_ubyte, c_ushort, c_ulong, c_char_p

ILenum = c_uint
ILbitfield = c_uint
ILboolean = c_ubyte
ILbyte = c_byte
ILubyte = c_ubyte
ILshort = c_short
ILushort = c_ushort
ILint = c_int
ILuint = c_uint
ILsizei = c_int
ILfloat = c_float
ILclampf = c_float
ILdouble = c_double
ILclampd = c_double
ILstring = c_char_p
ILvoid = c_int

def ilGenImage():
    n_img = c_int()
    ilGenImages(1, pointer(n_img))
    return n_img

def ilDeleteImage(img):
    ilDeleteImages(1, pointer(img))

ilActiveImage = mod.ilActiveImage
ilActiveImage.restype = ILboolean
ilActiveLayer = mod.ilActiveLayer
ilActiveLayer.restype = ILboolean
ilActiveMipmap = mod.ilActiveMipmap
ilActiveMipmap.restype = ILboolean
ilApplyPal = mod.ilApplyPal
ilApplyPal.restype = ILboolean
ilApplyProfile = mod.ilApplyProfile
ilApplyProfile.restype = ILboolean
ilBindImage = mod.ilBindImage
ilBlit = mod.ilBlit
ilBlit.restype = ILboolean
ilClearColour = mod.ilClearColour
ilClearImage = mod.ilClearImage
ilClearImage.restype = ILboolean
ilCloneCurImage = mod.ilCloneCurImage
ilCloneCurImage.restype = ILuint
ilCompressFunc = mod.ilCompressFunc
ilCompressFunc.restype = ILboolean
ilConvertImage = mod.ilConvertImage
ilConvertImage.restype = ILboolean
ilConvertPal = mod.ilConvertPal
ilConvertPal.restype = ILboolean
ilCopyImage = mod.ilCopyImage
ilCopyImage.restype = ILboolean
ilCopyPixels = mod.ilCopyPixels
ilCopyPixels.restype = ILuint
ilCreateSubImage = mod.ilCreateSubImage
ilCreateSubImage.restype = ILuint
ilDefaultImage = mod.ilDefaultImage
ilDefaultImage.restype = ILboolean
ilDeleteImages = mod.ilDeleteImages
ilDisable = mod.ilDisable
ilDisable.restype = ILboolean
ilEnable = mod.ilEnable
ilEnable.restype = ILboolean
ilFormatFunc = mod.ilFormatFunc
ilFormatFunc.restype = ILboolean
ilGenImages = mod.ilGenImages
ilGetAlpha = mod.ilGetAlpha
ilGetAlpha.restype = POINTER(ILubyte)
ilGetBoolean = mod.ilGetBoolean
ilGetBoolean.restype = ILboolean
ilGetBooleanv = mod.ilGetBooleanv
ilGetData = mod.ilGetData
ilGetData.restype = POINTER(ILubyte)
ilGetDXTCData = mod.ilGetDXTCData
ilGetDXTCData.restype = ILuint
ilGetError = mod.ilGetError
ilGetError.restype = ILenum
ilGetInteger = mod.ilGetInteger
ilGetIntegerv = mod.ilGetIntegerv
ilGetLumpPos = mod.ilGetLumpPos
ilGetLumpPos.restype = ILuint
ilGetPalette = mod.ilGetPalette
ilGetPalette.restype = POINTER(ILubyte)
ilGetString = mod.ilGetString
ilGetString.restype = ILstring
ilHint = mod.ilHint
ilInit = mod.ilInit
ilIsDisabled = mod.ilIsDisabled
ilIsDisabled.restype = ILboolean
ilIsEnabled = mod.ilIsEnabled
ilIsEnabled.restype = ILboolean
ilIsImage = mod.ilIsImage
ilIsImage.restype = ILboolean
ilIsValid = mod.ilIsValid
ilIsValid.restype = ILboolean
ilIsValidF = mod.ilIsValidF
ilIsValidF.restype = ILboolean
ilIsValidL = mod.ilIsValidL
ilIsValidL.restype = ILboolean
ilKeyColour = mod.ilKeyColour
ilLoad = mod.ilLoad
ilLoad.restype = ILboolean
ilLoadF = mod.ilLoadF
ilLoadF.restype = ILboolean
ilLoadImage = mod.ilLoadImage
ilLoadImage.restype = ILboolean
ilLoadL = mod.ilLoadL
ilLoadL.restype = ILboolean
ilLoadPal = mod.ilLoadPal
ilLoadPal.restype = ILboolean
ilOriginFunc = mod.ilOriginFunc
ilOriginFunc.restype = ILboolean
ilOverlayImage = mod.ilOverlayImage
ilOverlayImage.restype = ILboolean
ilPopAttrib = mod.ilPopAttrib
ilPushAttrib = mod.ilPushAttrib
ilRegisterFormat = mod.ilRegisterFormat
ilRegisterLoad = mod.ilRegisterLoad
ilRegisterLoad.restype = ILboolean
ilRegisterMipNum = mod.ilRegisterMipNum
ilRegisterMipNum.restype = ILboolean
ilRegisterNumImages = mod.ilRegisterNumImages
ilRegisterNumImages.restype = ILboolean
ilRegisterOrigin = mod.ilRegisterOrigin
ilRegisterPal = mod.ilRegisterPal
ilRegisterSave = mod.ilRegisterSave
ilRegisterSave.restype = ILboolean
ilRegisterType = mod.ilRegisterType
ilRemoveLoad = mod.ilRemoveLoad
ilRemoveLoad.restype = ILboolean
ilRemoveSave = mod.ilRemoveSave
ilRemoveSave.restype = ILboolean
ilResetMemory = mod.ilResetMemory
ilResetRead = mod.ilResetRead
ilResetWrite = mod.ilResetWrite
ilSave = mod.ilSave
ilSave.restype = ILboolean
ilSaveF = mod.ilSaveF
ilSaveF.restype = ILuint
ilSaveImage = mod.ilSaveImage
ilSaveImage.restype = ILboolean
ilSaveL = mod.ilSaveL
ilSaveL.restype = ILuint
ilSavePal = mod.ilSavePal
ilSavePal.restype = ILboolean
ilSetData = mod.ilSetData
ilSetData.restype = ILboolean
ilSetDuration = mod.ilSetDuration
ilSetDuration.restype = ILboolean
ilSetInteger = mod.ilSetInteger
ilSetMemory = mod.ilSetMemory
ilSetPixels = mod.ilSetPixels
ilSetRead = mod.ilSetRead
ilSetString = mod.ilSetString
ilSetWrite = mod.ilSetWrite
ilShutDown = mod.ilShutDown
ilTexImage = mod.ilTexImage
ilTexImage.restype = ILboolean
ilTypeFunc = mod.ilTypeFunc
ilTypeFunc.restype = ILboolean
ilLoadData = mod.ilLoadData
ilLoadData.restype = ILboolean
ilLoadDataF = mod.ilLoadDataF
ilLoadDataF.restype = ILboolean
ilLoadDataL = mod.ilLoadDataL
ilLoadDataL.restype = ILboolean
ilSaveData = mod.ilSaveData
ilSaveData.restype = ILboolean
ilLoadFromJpegStruct = mod.ilLoadFromJpegStruct
ilLoadFromJpegStruct.restype = ILboolean
ilSaveFromJpegStruct = mod.ilSaveFromJpegStruct
ilSaveFromJpegStruct.restype = ILboolean

IL_TRUE = 1
IL_TGA_CREATE_STAMP = 1808
IL_PAL_BGR24 = 1028
IL_IMAGE_FORMAT = 3562
IL_LIB_JPEG_ERROR = 1506
IL_LOAD_EXT = 7937
IL_TIF_AUTHNAME_STRING = 1824
IL_PSP = 1083
IL_PALETTE_BASE_TYPE = 3568
IL_PAL_RGB24 = 1025
IL_FLOAT = 5126
IL_ACTIVE_MIPMAP = 3573
IL_PSD = 1081
IL_VERSION = 161
IL_NUM_IMAGES = 3569
IL_PNG_DESCRIPTION_STRING = 1820
IL_INTERNAL_ERROR = 1284
IL_OUT_OF_MEMORY = 1282
IL_MDL = 1073
IL_IMAGE_DEPTH = 3558
IL_TGA_ID_STRING = 1815
IL_IMAGE_SIZE_OF_DATA = 3559
IL_RGBA = 6408
IL_PALETTE_TYPE = 3564
IL_BGR = 32992
IL_DOOM = 1058
IL_COMPRESS_RLE = 1794
IL_ACTIVE_IMAGE = 3572
IL_VERSION_1_6_1 = 1
IL_PAL_BIT = 4
IL_TGA_AUTHCOMMENT_STRING = 1817
IL_TYPE_SET = 1554
IL_PNG_INTERLACE = 1810
IL_DXTC_FORMAT = 1797
IL_VERSION_NUM = 3554
IL_FORMAT_NOT_SUPPORTED = 1283
IL_SUB_LAYER = 1666
IL_NUM_MIPMAPS = 3570
IL_IMAGE_BYTES_PER_PIXEL = 3560
IL_IMAGE_CUBEFLAGS = 3581
IL_STACK_UNDERFLOW = 1295
IL_ORIGIN_LOWER_LEFT = 1537
IL_USE_KEY_COLOR = 1589
IL_ACTIVE_LAYER = 3574
IL_SHORT = 5122
IL_UNSIGNED_INT = 5125
IL_DXTC_DATA_FORMAT = 1805
IL_FASTEST = 1632
IL_GIF = 1078
IL_WAL = 1074
IL_LIB_GIF_ERROR = 1505
IL_FILE_WRITE_ERROR = 1298
IL_IMAGE_WIDTH = 3556
IL_DEFAULT_ON_FAIL = 1586
IL_LBM = 1062
IL_ORIGIN_MODE = 1539
IL_NEU_QUANT = 1602
IL_VENDOR = 7936
IL_SEEK_END = 2
IL_MNG = 1077
IL_TIF = 1070
IL_DOUBLE = 5130
IL_CONV_PAL = 1584
IL_TIF_DESCRIPTION_STRING = 1821
IL_PALETTE_BPP = 3566
IL_DXT5 = 1802
IL_PNG_AUTHNAME_STRING = 1818
IL_DXT1 = 1798
IL_PAL_RGB32 = 1026
IL_DXT3 = 1800
IL_LUMINANCE_ALPHA = 6410
IL_LESS_MEM = 1633
IL_LIB_PNG_ERROR = 1507
IL_NUM_LAYERS = 3571
IL_BYTE = 5120
IL_PAL_RGBA32 = 1027
IL_CUBEMAP_POSITIVEY = 4096
IL_CUBEMAP_POSITIVEX = 1024
IL_PAL_NONE = 1024
IL_IMAGE_TYPE = 3563
IL_PIC = 1065
IL_SGI = 1068
IL_UNSIGNED_SHORT = 5123
IL_JFIF = 1061
IL_IMAGE_DURATION = 3576
IL_LOADFAIL_BIT = 64
IL_PAL_BGRA32 = 1030
IL_PCD = 1063
IL_FILE_OVERWRITE = 1568
IL_COLOUR_INDEX = 6400
IL_ILLEGAL_FILE_VALUE = 1287
IL_OUT_FORMAT_SAME = 1293
IL_UNSIGNED_BYTE = 5121
IL_JPG = 1061
IL_STACK_OVERFLOW = 1294
IL_DDS = 1079
IL_SUB_MIPMAP = 1665
IL_FALSE = 0
IL_FORMAT_MODE = 1553
IL_KEEP_DXTC_DATA = 1804
IL_USE_COMPRESSION = 1638
IL_PXR = 1085
IL_SEEK_CUR = 1
IL_QUANTIZATION_MODE = 1600
IL_SEEK_SET = 0
IL_COMPRESSION_HINT = 1640
IL_XPM = 1086
IL_FILE_ALREADY_EXISTS = 1292
IL_PCX = 1064
IL_CUBEMAP_NEGATIVEZ = 32768
IL_CUBEMAP_NEGATIVEY = 8192
IL_CUBEMAP_NEGATIVEX = 2048
IL_DCX = 1080
IL_ORIGIN_SET = 1536
IL_DOOM_FLAT = 1059
IL_BAD_DIMENSIONS = 1297
IL_IMAGE_BITS_PER_PIXEL = 3561
IL_USE_KEY_COLOUR = 1589
IL_SUB_NEXT = 1664
IL_TGA = 1069
IL_MEM_SPEED_HINT = 1637
IL_JPG_QUALITY = 1809
IL_COLOR_INDEX = 6400
IL_EXIF = 1082
IL_JNG = 1077
IL_IMAGE_HEIGHT = 3557
IL_BGRA = 32993
IL_RGB = 6407
IL_INVALID_EXTENSION = 1291
IL_TGA_RLE = 1811
IL_INT = 5124
IL_IMAGE_BPC = 3578
IL_EOF = -1
IL_UNKNOWN_ERROR = 1535
IL_COMPRESS_MODE = 1792
IL_COMPRESS_BIT = 32
IL_ORIGIN_BIT = 1
IL_NEU_QUANT_SAMPLE = 1603
IL_INVALID_FILE_HEADER = 1288
IL_IMAGE_BPP = 3560
IL_TYPE_UNKNOWN = 0
IL_COMPRESS_NONE = 1793
IL_PALETTE_SIZE = 3565
IL_FILE_MODE = 1569
IL_DXT2 = 1799
IL_COMPRESS_ZLIB = 1796
IL_SGI_RLE = 1813
IL_TYPE_BIT = 16
IL_JPG_SAVE_FORMAT = 1825
IL_COULD_NOT_OPEN_FILE = 1290
IL_PNM = 1067
IL_LIB_MNG_ERROR = 1509
IL_FORMAT_SPECIFIC_BIT = 128
IL_PNG = 1066
IL_SAVE_INTERLACED = 1593
IL_CUR_IMAGE = 3575
IL_CHEAD = 1071
IL_LUMINANCE = 6409
IL_ICO = 1060
IL_IMAGE_OFFX = 3579
IL_IMAGE_OFFY = 3580
IL_JASC_PAL = 1141
IL_IMAGE_PLANESIZE = 3577
IL_INVALID_ENUM = 1281
IL_FORMAT_BIT = 8
IL_ORIGIN_UPPER_LEFT = 1538
IL_NO_COMPRESSION = 1639
IL_TIF_HOSTCOMPUTER_STRING = 1822
IL_PCD_PICNUM = 1827
IL_SAVE_EXT = 7938
IL_FILE_BIT = 2
IL_BMP = 1056
IL_RAW = 1072
IL_BMP_RLE = 1812
IL_TGA_AUTHNAME_STRING = 1816
IL_TIF_DOCUMENTNAME_STRING = 1823
IL_FORMAT_SET = 1552
IL_TYPE_MODE = 1555
IL_FILE_READ_ERROR = 1298
IL_ILLEGAL_OPERATION = 1286
IL_CUT = 1057
IL_PAL_BGR32 = 1029
IL_DXT4 = 1801
IL_INTERLACE_MODE = 1594
IL_CUBEMAP_POSITIVEZ = 16384
IL_CHEAD_HEADER_STRING = 1826
IL_PNG_TITLE_STRING = 1819
IL_COMPRESS_LZO = 1795
IL_LIB_TIFF_ERROR = 1508
IL_PALETTE_NUM_COLS = 3567
IL_INVALID_PARAM = 1289
IL_ALL_ATTRIB_BITS = 1048575
IL_DXT_NO_COMP = 1803
IL_PIX = 1084
IL_LIF = 1076
IL_WU_QUANT = 1601
IL_INVALID_VALUE = 1285
IL_INVALID_CONVERSION = 1296
IL_NO_ERROR = 0
IL_DONT_CARE = 1634

ilInit()

if __name__ == "__main__":
    img = ilGenImage()
    ilBindImage(img)
    if ilLoad(IL_TYPE_UNKNOWN, "test.dds"):
        print "ilLoad.ok"
    else:
        print "ilLoad.error"

    ilDeleteImage(img)
이올린에 북마크하기(0) 이올린에 추천하기(0)
2007/05/14 12:40 2007/05/14 12:40