Commit f2690b34 authored by Claes Sjofors's avatar Claes Sjofors

Imlib removed for motif

parent 00d68f10
......@@ -1687,17 +1687,26 @@ void FlowDrawXLib::set_white_background( FlowCtx *ctx)
int FlowDrawXLib::image_get_width( flow_tImImage image)
{
#if defined IMLIB
return ((ImlibImage *)image)->rgb_width;
#else
return 0;
#endif
}
int FlowDrawXLib::image_get_height( flow_tImImage image)
{
#if defined IMLIB
return ((ImlibImage *)image)->rgb_height;
#else
return 0;
#endif
}
void FlowDrawXLib::image_scale( float scale, flow_tImImage *im, flow_tPixmap *im_pixmap,
flow_tPixmap *im_mask)
{
#if defined IMLIB
int current_width = int( ((ImlibImage *)*im)->rgb_width * scale);
int current_height = int( ((ImlibImage *)*im)->rgb_height * scale);
......@@ -1707,6 +1716,7 @@ void FlowDrawXLib::image_scale( float scale, flow_tImImage *im, flow_tPixmap *im
Imlib_free_pixmap( (ImlibData *)imlib, (Pixmap)*im_pixmap);
*im_pixmap = (flow_tPixmap) Imlib_move_image( (ImlibData *)imlib, (ImlibImage *)*im);
*im_mask = (flow_tPixmap) Imlib_move_mask( (ImlibData *)imlib, (ImlibImage *)*im);
#endif
}
int FlowDrawXLib::image_load( const char *imagefile, float scale, float nav_scale,
......
......@@ -31,7 +31,7 @@
#include <X11/Xutil.h>
#if defined OS_LINUX
#define IMLIB 1
// #define IMLIB 1
#endif
#if defined IMLIB
......
......@@ -22,10 +22,6 @@
#include <stdlib.h>
#if defined OS_LINUX
#define IMLIB 1
#endif
class FlowCtx;
class FlowDraw {
......
......@@ -2813,26 +2813,43 @@ x/scalex/width << " " << (y - height*scaley)/scaley/height << " translate" << en
// Image functions
int GlowDrawXLib::image_get_width( glow_tImImage image)
{
#if defined IMLIB
return ((ImlibImage *)image)->rgb_width;
#else
return 0;
#endif
}
int GlowDrawXLib::image_get_height( glow_tImImage image)
{
#if defined IMLIB
return ((ImlibImage *)image)->rgb_height;
#else
return 0;
#endif
}
int GlowDrawXLib::image_get_rowstride( glow_tImImage image)
{
#if defined IMLIB
return ((ImlibImage *)image)->rgb_width;
#else
return 0;
#endif
}
unsigned char *GlowDrawXLib::image_get_data( glow_tImImage image)
{
#if defined IMLIB
return ((ImlibImage *)image)->rgb_data;
#else
return 0;
#endif
}
void GlowDrawXLib::image_rotate( glow_tImImage *image, int to_rotation, int from_rotation)
{
#if defined IMLIB
int drot = to_rotation - from_rotation;
drot = int( (float(drot) / 360 - floor( float(drot) / 360)) * 360);
printf( "Drot: %d\n", drot);
......@@ -2845,16 +2862,21 @@ void GlowDrawXLib::image_rotate( glow_tImImage *image, int to_rotation, int from
if ( drot == 90 || drot == 180)
Imlib_flip_image_horizontal( (ImlibData *)imlib, (ImlibImage *)*image);
}
#endif
}
void GlowDrawXLib::image_flip_vertical( glow_tImImage *image)
{
#if defined IMLIB
Imlib_flip_image_horizontal( (ImlibData *)imlib, (ImlibImage *)*image);
#endif
}
void GlowDrawXLib::image_flip_horizontal( glow_tImImage *image)
{
#if defined IMLIB
Imlib_flip_image_vertical( (ImlibData *)imlib, (ImlibImage *)*image);
#endif
}
void GlowDrawXLib::image_scale( int width, int height, glow_tImImage orig_im, glow_tImImage *im,
......@@ -2918,17 +2940,22 @@ int GlowDrawXLib::image_render( int width, int height,
void GlowDrawXLib::image_free( glow_tImImage image)
{
#if defined IMLIB
Imlib_destroy_image( (ImlibData *)imlib, (ImlibImage *)image);
#endif
}
void GlowDrawXLib::pixmap_free( glow_tPixmap pixmap)
{
#if defined IMLIB
Imlib_free_pixmap( (ImlibData *)imlib, (Pixmap)pixmap);
#endif
}
void GlowDrawXLib::image_pixel_iter( glow_tImImage orig_image, glow_tImImage *image,
void (* pixel_cb)(void *, unsigned char *), void *userdata)
{
#if defined IMLIB
unsigned char *rgb;
int rgb_height;
int rgb_width;
......@@ -2957,4 +2984,5 @@ void GlowDrawXLib::image_pixel_iter( glow_tImImage orig_image, glow_tImImage *im
}
Imlib_changed_image( (ImlibData *)imlib, (ImlibImage *)*image);
#endif
}
......@@ -32,7 +32,7 @@
#include <X11/Xutil.h>
#if defined OS_LINUX
#define IMLIB 1
// #define IMLIB 1
#endif
#if defined IMLIB
......
......@@ -22,10 +22,6 @@
#include <stdlib.h>
#if defined OS_LINUX
#define IMLIB 1
#endif
#define DRAW_CLIP_SIZE 10
class GlowCtx;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment