- Main Page
- Data Structures
- Files

- File List

# E:/DevIL/src-ILU/src/ilu_utilities.c

    00001 //-----------------------------------------------------------------------------
    00002 //
    00003 // ImageLib Utility Sources
    00004 // Copyright (C) 2000-2002 by Denton Woods
    00005 // Last modified: 05/25/2001 <--Y2K Compliant! =]
    00006 //
    00007 // Filename: src-ILU/src/ilu_utilities.c
    00008 //
    00009 // Description: Utility functions
    00010 //
    00011 //-----------------------------------------------------------------------------
    00012
    00013
    00014 #include "ilu_internal.h"
    00015
    00016
    00017 void ILAPIENTRY iluDeleteImage(ILuint Id)
    00018 {
    00019         ilDeleteImages(1, &Id);
    00020         return;
    00021 }
    00022
    00023
    00024 ILuint ILAPIENTRY iluGenImage()
    00025 {
    00026         ILuint Id;
    00027         ilGenImages(1, &Id);
    00028         ilBindImage(Id);
    00029         return Id;
    00030 }
    00031
    00032
    00034 void ILAPIENTRY iluGetImageInfo(ILinfo *Info)
    00035 {
    00036         iluCurImage = ilGetCurImage();
    00037         if (iluCurImage == NULL || Info == NULL) {
    00038                 ilSetError(ILU_ILLEGAL_OPERATION);
    00039                 return;
    00040         }
    00041
    00042         Info->Id                        = ilGetCurName();
    00043         Info->Data                      = ilGetData();
    00044         Info->Width                     = iluCurImage->Width;
    00045         Info->Height            = iluCurImage->Height;
    00046         Info->Depth                     = iluCurImage->Depth;
    00047         Info->Bpp                       = iluCurImage->Bpp;
    00048         Info->SizeOfData        = iluCurImage->SizeOfData;
    00049         Info->Format            = iluCurImage->Format;
    00050         Info->Type                      = iluCurImage->Type;
    00051         Info->Origin            = iluCurImage->Origin;
    00052         Info->Palette           = iluCurImage->Pal.Palette;
    00053         Info->PalType           = iluCurImage->Pal.PalType;
    00054         Info->PalSize           = iluCurImage->Pal.PalSize;
    00055         iGetIntegervImage(iluCurImage, IL_NUM_IMAGES,
    00056                                 (ILint*)&Info->NumNext);
    00057         iGetIntegervImage(iluCurImage, IL_NUM_MIPMAPS,
    00058                                 (ILint*)&Info->NumMips);
    00059         iGetIntegervImage(iluCurImage, IL_NUM_LAYERS,
    00060                                 (ILint*)&Info->NumLayers);
    00061
    00062         return;
    00063 }