Page 1 sur 1
Librairie Effect de LSI ou Point() + rapide
Publié : mar. 02/sept./2014 15:06
par TazNormand
Salut
Qui aurais la dernière version de la librairie de "Le Soldat Inconnu" aka LSI ?
Ou qui aurait une procédure plus rapide que point() pour de grandes images ?
Re: Librairie Effect de LSI ou Point() + rapide
Publié : mar. 02/sept./2014 15:36
par graph100
TazNormand a écrit :Ou qui aurait une procédure plus rapide que point() pour de grandes images ?
Si tu es sur du format RGB tu peux accéder aux données en mémoire avec DrawingBuffer(), puis DrawingBufferPitch() et DrawingBufferPixelFormat()
Mais je n'ai pas de routine sous la main (pas le bon ordi)
Re: Librairie Effect de LSI ou Point() + rapide
Publié : mar. 02/sept./2014 16:06
par djes
Re: Librairie Effect de LSI ou Point() + rapide
Publié : mar. 02/sept./2014 21:45
par PAPIPP
Bonjour TazNormand
Voici le fichier EFFECT__.ZIP de LSI
Le fichier ne sera accessible qu'un mois au moins
http://dl.free.fr/q5RzW2RLf
http://dl.free.fr/q5RzW2RLf
A+
Re: Librairie Effect de LSI ou Point() + rapide
Publié : mer. 03/sept./2014 3:47
par flaith
Juste un exemple pour convertir une image en alpha suivant une couleur definie:
Code : Tout sélectionner
Procedure.i ConvertToAlpha(__ImageID.i, __TransparentColor.i)
; The '__TransparentColor' become Alpha
Protected.i _BufferImg, _PitchImg, _PixelFormatImg
Protected.i _X, _Y, _OnePixel
Protected.i *Line.CS_PIXEL
StartDrawing(ImageOutput(__ImageID))
_BufferImg = DrawingBuffer()
_PitchImg = DrawingBufferPitch()
; _PixelFormatImg = DrawingBufferPixelFormat() - #PB_PixelFormat_ReversedY
For _Y = 0 To ImageHeight(__ImageID) - 1
*Line = _BufferImg + _PitchImg * _Y
For _X = 0 To ImageWidth(__ImageID) - 1
_OnePixel = *Line\Pixel
If _OnePixel = $FF000000 | __TransparentColor ; Color to change ?
*Line\Pixel = $00FFFFFF ; Convert to AlphaChannel
EndIf
*Line + 4 ; Next Pixel
Next
Next
StopDrawing()
EndProcedure