Back to index

plt-scheme  4.2.1
Public Member Functions | Public Attributes | Private Attributes
wxImage Class Reference

#include <wx_image.h>

Inheritance diagram for wxImage:
Inheritance graph
[legend]
Collaboration diagram for wxImage:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 wxImage (void)
 ~wxImage (void)
Bool Load (char *file)
Bool Destroy (void)
void Draw (wxCanvas *canvas, int x=0, int y=0, int width=-1, int height=-1)
void Resize (int, int)
void GetSize (int *width, int *height)
int GetType (void)
wxColourMapGetColourMap (void)
void install_cleanup ()
voidoperator new (size_t size)
voidoperator new (size_t size, GCPlacement gcp)
voidoperator new (size_t size, void *p)
voidoperator new (size_t size)
voidoperator new (size_t size, GCPlacement gcp)
void operator delete (void *obj)
void operator delete (void *, void *)
void operator delete (void *obj)
voidoperator new[] (size_t size)
voidoperator new[] (size_t size, GCPlacement gcp)
voidoperator new[] (size_t size, void *p)
void operator delete[] (void *obj)
void operator delete[] (void *, void *)

Public Attributes

WXTYPE __type
void__gc_external

Private Attributes

int filetype
wxColourMapcMap

Detailed Description

Definition at line 54 of file wx_image.h.


Constructor & Destructor Documentation


Member Function Documentation

void wxImage::Draw ( wxCanvas canvas,
int  x = 0,
int  y = 0,
int  width = -1,
int  height = -1 
)
void wxImage::GetSize ( int width,
int height 
)
int wxImage::GetType ( void  ) [inline]

Definition at line 72 of file wx_image.h.

{ return filetype; }

Definition at line 99 of file wxGC.cxx.

{
  GC_finalization_proc old_fn;
  void *old_data;

# ifdef MZ_PRECISE_GC
#  define ALLOW_NON_BASE 0
#  define CHECK_BASE 0
# else
#  ifdef wx_xt
#   define ALLOW_NON_BASE 0
#   define CHECK_BASE 0
#  else
#   ifdef WIN32
#    define ALLOW_NON_BASE 0
#    define CHECK_BASE 1
#    define CRASH_ON_NONBASE 1
#   else
#    define ALLOW_NON_BASE 1
#    define CHECK_BASE 0
#   endif
#  endif
# endif

# if CHECK_BASE || ALLOW_NON_BASE
  if (GC_base(this) != (void *)this) {
#  if ALLOW_NON_BASE
    return;
#  else
#   ifdef CRASH_ON_NONBASE
    *(long *)0x0 = 1;
#   else
    printf("Clean-up object is not the base object\n");
    abort();
#   endif
#  endif
  }
# endif

  GC_register_finalizer_ignore_self(gcOBJ_TO_PTR(this), 
                                CAST_GCP GC_cleanup, NULL, 
                                CAST_GCPP &old_fn, &old_data);

# if CHECK_BASE
  if (old_fn) {
#  ifdef CRASH_ON_NONBASE
       *(long *)0x0 = 1;
#  else
    printf("Object already has a clean-up\n");
    abort();
#  endif
  }
# endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool wxImage::Load ( char *  file)
void gc::operator delete ( void obj) [inline, inherited]
void gc::operator delete ( void obj) [inline, inherited]

Definition at line 287 of file gc_cpp.h.

                                           {
    GC_FREE( obj );}

Here is the caller graph for this function:

void gc::operator delete ( void ,
void  
) [inline, inherited]

Definition at line 291 of file gc_cpp.h.

{}
void gc::operator delete[] ( void obj) [inline, inherited]

Definition at line 305 of file gc_cpp.h.

                                             {
    gc::operator delete( obj );}

Here is the call graph for this function:

void gc::operator delete[] ( void ,
void  
) [inline, inherited]

Definition at line 309 of file gc_cpp.h.

{}
void* gc::operator new ( size_t  size) [inline, inherited]
void* gc::operator new ( size_t  size,
GCPlacement  gcp 
) [inline, inherited]
void * gc::operator new ( size_t  size) [inline, inherited]

Definition at line 273 of file gc_cpp.h.

                                           {
    return GC_MALLOC( size );}

Here is the caller graph for this function:

void * gc::operator new ( size_t  size,
GCPlacement  gcp 
) [inline, inherited]

Definition at line 276 of file gc_cpp.h.

                                                            {
    if (gcp == UseGC) 
        return GC_MALLOC( size );
    else if (gcp == PointerFreeGC)
       return GC_MALLOC_ATOMIC( size );
    else
        return GC_MALLOC_UNCOLLECTABLE( size );}
void * gc::operator new ( size_t  size,
void p 
) [inline, inherited]

Definition at line 284 of file gc_cpp.h.

                                                    {
    return p;}
void * gc::operator new[] ( size_t  size) [inline, inherited]

Definition at line 296 of file gc_cpp.h.

                                             {
    return gc::operator new( size );}

Here is the call graph for this function:

void * gc::operator new[] ( size_t  size,
GCPlacement  gcp 
) [inline, inherited]

Definition at line 299 of file gc_cpp.h.

                                                              {
    return gc::operator new( size, gcp );}

Here is the call graph for this function:

void * gc::operator new[] ( size_t  size,
void p 
) [inline, inherited]

Definition at line 302 of file gc_cpp.h.

                                                      {
    return p;}
void wxImage::Resize ( int  w,
int  h 
)

Definition at line 51 of file wx_img.cc.

{
  int          cy,ex,ey,*cxarr, *cxarrp;
  byte        *clptr,*elptr,*epptr;

  clptr = NULL;  cxarrp = NULL;  cy = 0;  /* shut up compiler */
#if 0
  /* force w,h into valid ranges */
  RANGE(w,1,(int)dispWIDE);  RANGE(h,1,(int)dispHIGH);
#endif

  /* if same size, and Ximage created, do nothing */
  if (w == (int)eWIDE && h == (int)eHIGH && theImage!=NULL) return;

  if (imgDEBUG) fprintf(stderr,"wxImage: Resize(%d,%d)  eSIZE=%d,%d  cSIZE=%d,%d\n",
                   w,h,eWIDE,eHIGH,cWIDE,cHIGH);

  if (w == (int)cWIDE && h == (int)cHIGH) {  /* 1:1 expansion.  point epic at cpic */
    if (epic != cpic && epic!=NULL) free(epic);
    epic = cpic;  eWIDE = cWIDE;  eHIGH = cHIGH;
  }

  else {  /* have to actually SCALE THE PIC.  Drats! */

    /* first, kill the old epic, if one exists */
    if (epic!=NULL && epic!=cpic) {
      free(epic);  epic = NULL;
    }

    /* create a new epic of the appropriate size */
    eWIDE = w;  eHIGH = h;
    {
      byte *ba;
      ba = (byte *)malloc(w*h);
      epic = ba;
    }
    if (epic==NULL) {
      sprintf(wxBuffer,"unable to malloc a %dx%d image\n",w,h);
      FatalError(wxBuffer);
    }

    /* the scaling routine.  not really all that scary after all... */

    /* OPTIMIZATON IDEA.  Malloc an eWIDE array of ints which will hold the
       values of the equation px = (pWIDE * ex) / eWIDE.  Faster than doing 
       a mul and a div for every point in picture */

    cxarr = (int *) malloc(eWIDE * sizeof(int));
    if (!cxarr) FatalError("unable to allocate cxarr");
    for (ex=0; ex < (int)eWIDE; ex++) {
      cxarr[ex] = (cWIDE * ex) / eWIDE;
    }

    elptr = epptr = epic;
    for (ey=0;  ey < (int)eHIGH;  ey++, elptr+=eWIDE) {
      cy = (cHIGH * ey) / eHIGH;
      epptr = elptr;
      clptr = cpic + (cy * cWIDE);
      for (ex=0, cxarrp = cxarr;  ex < (int)eWIDE;  ex++, epptr++) {
       *epptr = clptr[*cxarrp++];
      }
    }
    free(cxarr);
  }

  /* now make something displayable out of epic */
  CreateXImage();
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 146 of file wxGC.h.

WXTYPE wxObject::__type [inherited]

Definition at line 77 of file Object.h.

Definition at line 57 of file wx_image.h.

Definition at line 56 of file wx_image.h.


The documentation for this class was generated from the following files: