montageh_grey8 Tcl_Obj* imageLeftObj Tcl_Obj* imageRightObj /* * Place the two images adjacent to each other in the result, from left to * right. The images have to have the same height. */ crimp_image* result; crimp_image* imageLeft; crimp_image* imageRight; int x, y; crimp_input (imageLeftObj, imageLeft, grey8); crimp_input (imageRightObj, imageRight, grey8); if (!crimp_eq_height (imageLeft, imageRight)) { Tcl_SetResult(interp, "image heights do not match", TCL_STATIC); return TCL_ERROR; } result = crimp_new_grey8 (imageLeft->w + imageRight->w, imageLeft->h); for (y = 0; y < result->h; y++) { for (x = 0; x < imageLeft->w; x++) { GREY8 (result, x, y) = GREY8 (imageLeft, x, y); } } for (y = 0; y < result->h; y++) { for (x = 0; x < imageRight->w; x++) { GREY8 (result, imageLeft->w + x, y) = GREY8 (imageRight, x, y); } } Tcl_SetObjResult(interp, crimp_new_image_obj (result)); return TCL_OK; /* vim: set sts=4 sw=4 tw=80 et ft=c: */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */