Code: Alles auswählen
Debug *image\format\RGBAshift
Code: Alles auswählen
Debug *image\format\RGBAshift
Code: Alles auswählen
typedef struct SDL_Surface {
Uint32 flags; /* Read-only */
SDL_PixelFormat *format; /* Read-only */
int w, h; /* Read-only */
Uint16 pitch; /* Read-only */
void *pixels; /* Read-write */
SDL_Rect clip_rect; /* Read-only */
int refcount; /* Read-mostly */
/* This structure also contains private fields not shown here */
} SDL_Surface;
Code: Alles auswählen
Structure My_SDL_Surface
flags.i
*format.My_SDL_PixelFormat
h.i
w.i
pitch.w
EndStructure
Ich weiß zwar nicht was ein Heap ist aber es scheint zu funktionieren und außerdem:wenn du ne struct zurückgeben läßt, auf nen strukturierten pointer mit ner kürzeren struktur, ruinierst du dir doch den Heap...
soll ich etwa noch 10 Dummys hinzufügen?/* This structure also contains private fields not shown here */
Code: Alles auswählen
Image$ = "sample.gif"
Structure My_SDL_Surface
flags.i
*format.SDL_PixelFormat
h.i
w.i
pitch.w
*pixels ;; <-- !!
EndStructure
If OpenLibrary(0,"/usr/lib/libSDL_image-1.2.so.0.1.5") And ExamineLibraryFunctions(0)
Define *image.My_SDL_Surface
*image=CallFunction(0,"IMG_LoadTyped_RW",SDL_RWFromFile_(Image$, "rb"), 1, "GIF")
Debug *image\h
Debug *image\w
SDL_LockSurface_(*image)
Debug *image\pixels ;; <-- ??
EndIf
Das hab ich schon verstanden aber so:> Ok was mach ich jetzt mit dem *pixels pointer?
der zeigt auf den speicherbereich wo deine Bilddaten drinstehen.
Code: Alles auswählen
CatchImage(0,@*image\pixels)
Kurz gesagt ich will so viel wie mögliche Bildformate mit meinem FotoEditor öffnen können.TGA
TrueVision Targa (MUST have .tga)
BMP
Windows Bitmap(.bmp)
PNM
Portable Anymap (.pnm)
.pbm = Portable BitMap (mono)
.pgm = Portable GreyMap (256 greys)
.ppm = Portable PixMap (full color)
XPM
X11 Pixmap (.xpm) can be #included directly in code
This is NOT the same as XBM(X11 Bitmap) format, which is for monocolor images.
XCF
GIMP native (.xcf) (XCF = eXperimental Computing Facility?)
This format is always changing, and since there's no library supplied by the GIMP project to load XCF, the loader may frequently fail to load much of any image from an XCF file. It's better to load this in GIMP and convert to a better supported image format.
PCX
ZSoft IBM PC Paintbrush (.pcx)
GIF
CompuServe Graphics Interchange Format (.gif)
JPG
Joint Photographic Experts Group JFIF format (.jpg or .jpeg)
TIF
Tagged Image File Format (.tif or .tiff)
LBM
Interleaved Bitmap (.lbm or .iff) FORM : ILBM or PBM(packed bitmap)
HAM6, HAM8, and 24bit types are not supported.
PNG
Portable Network Graphics (.png)