From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Evgeny Zajcev Newsgroups: gmane.emacs.devel Subject: image spec as :mask property for the image Date: Sun, 15 Jul 2018 00:06:02 +0300 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="000000000000c7f8fb0570fbf6b1" X-Trace: blaine.gmane.org 1531602285 18230 195.159.176.226 (14 Jul 2018 21:04:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 14 Jul 2018 21:04:45 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 14 23:04:41 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1feRib-0004fn-0o for ged-emacs-devel@m.gmane.org; Sat, 14 Jul 2018 23:04:41 +0200 Original-Received: from localhost ([::1]:42786 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1feRki-0000xr-2E for ged-emacs-devel@m.gmane.org; Sat, 14 Jul 2018 17:06:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1feRjx-0000xl-Rd for emacs-devel@gnu.org; Sat, 14 Jul 2018 17:06:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1feRjw-00040R-H6 for emacs-devel@gnu.org; Sat, 14 Jul 2018 17:06:05 -0400 Original-Received: from mail-io0-x22d.google.com ([2607:f8b0:4001:c06::22d]:33879) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1feRjw-0003zT-1J for emacs-devel@gnu.org; Sat, 14 Jul 2018 17:06:04 -0400 Original-Received: by mail-io0-x22d.google.com with SMTP id l7-v6so34335237ioj.1 for ; Sat, 14 Jul 2018 14:06:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=SukkapHJo1CmdZgtlyK6RMDGZKZndA422YJkvP5l0z8=; b=rS3zUy6D8mPW12kLhrZaIlNb5zH74Ec2jEGgQ2NkpovrvxttgKgEJ29u0QaAVErLlE ntM9uRymRaeEQdxxCudCONBXDtG8w5hhqGoNpdyb+xPta5ydvScrqGZU4/AqvBmT05wj Syv7d5HrH5ySSyrtsLYyxBNcDzmZHouyL6ty6DHwsF1blCAs+h8HfaDFWcUfjh/CetGS vR1TyTEixYLa6NeSnpHmnSjgujNbYtqpBsP0u+6UdFhA+iDi8VgmBib55zedMIGZXvBl dCcOKS5wHFOcvBngegMR0Q/ehRhmxt3Jxg+sXBYl9PEM3vmfJasA+z5XYuaXy4hR2ikH QS5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=SukkapHJo1CmdZgtlyK6RMDGZKZndA422YJkvP5l0z8=; b=DMkl99J+XjdKBEbnQycmbJFlyOL78L6iUf4VSUWNFwr0GCQ9V0wjFFvecGT4I2O2AL nTXidS7+yneZtANw+JfJ30gytxxW2Gl3xKpgEzDlc6/UwdVbRy+xYBme0iAu130E76kU +9Y6qPSlJEfSt3o0D6XvXGG9CqUWk/xAW8oqQ8tvc6nDyGI852DojP42SoKcviP2YKQ4 KrCVVliXzkdvGhEfRyXYSAN75ZELIhmZD8H7uW9qZIjBcqEJ+k3rJzszCRIs0YV2QwGj rfwuaQHW9Q9PT+SuFM7pzeoZ0TGsZzZLKCHpVvIata2Y4V4JcM7KOzjrnXdOozc6bW1F KsiQ== X-Gm-Message-State: AOUpUlFNMiBUZaecH0UfGBtUXY4/Piw+PBF5vB450s+t4sZms1c55avt l5iyqml3WfdwAcOVODEArGH9S9YghdXZBo2PGlpj8A== X-Google-Smtp-Source: AAOMgpdwYCkCVQXobI3EIjes0iOplP7/C4oNokjEfxp501zCCs6foEoisD8ijQgs1hQbKcsX+HgDlOa3Tj7rGmlSLxg= X-Received: by 2002:a6b:e15:: with SMTP id 21-v6mr13558890ioo.149.1531602362948; Sat, 14 Jul 2018 14:06:02 -0700 (PDT) Original-Received: by 2002:a6b:3709:0:0:0:0:0 with HTTP; Sat, 14 Jul 2018 14:06:02 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c06::22d X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:227415 Archived-At: --000000000000c7f8fb0570fbf6b1 Content-Type: multipart/alternative; boundary="000000000000c7f8f80570fbf6af" --000000000000c7f8f80570fbf6af Content-Type: text/plain; charset="UTF-8" Hello, I've implemented nice feature making possible to use image spec as :mask property for the image. This allows making simple image/mask composition in Emacs. I need this feature to implement avatars in circles for https://github.com/zevlg/telega.el/ project directly in Emacs without executing external programs. I have done it only for X Window System, I have no experience with coding for Windows. Any help to implement it for Windows as well is very helpful What do think about the feature? See the patch in the attachment or on github - https://github.com/zevlg/emacs/commit/c856324968e6f4955b1206e774abfdf36adc61f5 Thanks PS: Please CC me, I'm not in list -- lg --000000000000c7f8f80570fbf6af Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

I've implemented nice featur= e making possible to use image spec as :mask property for the image.=C2=A0 = This allows making simple image/mask composition in Emacs.

I need this feature to implement avatars in circles for=C2=A0https://github.com/zevlg/telega.= el/ project directly in Emacs without executing external programs.

I have done it only for X Window System, I have no exp= erience with coding for Windows.=C2=A0 Any help to implement it for Windows= as well is very helpful

What do think about the f= eature?

See the patch in the attachment or on gith= ub -=C2=A0 https://github.com/zevlg/emacs/commit/c856324968= e6f4955b1206e774abfdf36adc61f5

Thanks

PS: Please CC me, I'm not in list

--
lg
--000000000000c7f8f80570fbf6af-- --000000000000c7f8fb0570fbf6b1 Content-Type: text/x-patch; charset="US-ASCII"; name="image_spec_as_mask.diff" Content-Disposition: attachment; filename="image_spec_as_mask.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_jjlwg03e0 ZGlmZiAtLWdpdCBhL3NyYy9pbWFnZS5jIGIvc3JjL2ltYWdlLmMKaW5kZXggOTkyYjIyNS4uNDQ2 NTlhNiAxMDA2NDQKLS0tIGEvc3JjL2ltYWdlLmMKKysrIGIvc3JjL2ltYWdlLmMKQEAgLTUzNiw2 ICs1MzYsOCBAQCBzdGF0aWMgdm9pZCB4X2xhcGxhY2UgKHN0cnVjdCBmcmFtZSAqLCBzdHJ1Y3Qg aW1hZ2UgKik7CiBzdGF0aWMgdm9pZCB4X2VtYm9zcyAoc3RydWN0IGZyYW1lICosIHN0cnVjdCBp bWFnZSAqKTsKIHN0YXRpYyB2b2lkIHhfYnVpbGRfaGV1cmlzdGljX21hc2sgKHN0cnVjdCBmcmFt ZSAqLCBzdHJ1Y3QgaW1hZ2UgKiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IExpc3BfT2JqZWN0KTsKK3N0YXRpYyB2b2lkIHhfY29weV9pbWFnZV9tYXNrIChzdHJ1Y3QgZnJh bWUgKiwgc3RydWN0IGltYWdlICosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGlz cF9PYmplY3QpOwogI2lmZGVmIFdJTkRPV1NOVAogI2RlZmluZSBDQUNIRV9JTUFHRV9UWVBFKHR5 cGUsIHN0YXR1cykgXAogICBkbyB7IFZsaWJyYXJ5X2NhY2hlID0gRmNvbnMgKEZjb25zICh0eXBl LCBzdGF0dXM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GltZy0+bWFz aykKKyAgICB4X2NsZWFyX2ltYWdlXzEgKGYsIGltZywgQ0xFQVJfSU1BR0VfTUFTSyk7CisKKyAg LyogQ3JlYXRlIGFuIGltYWdlIGFuZCBwaXhtYXAgc2VydmluZyBhcyBtYXNrLiAgKi8KKyAgaWYg KCEgaW1hZ2VfY3JlYXRlX3hfaW1hZ2VfYW5kX3BpeG1hcCAoZiwgaW1nLCBpbWctPndpZHRoLCBp bWctPmhlaWdodCwgMSwKKwkJCQkJICZtYXNrX3hpbWcsIDEpKQorICAgIHJldHVybjsKKworICBz cmNfbWFza194aW1nID0gaW1hZ2VfZ2V0X3hfaW1hZ2UgKGYsIG1hc2ssIDEpOworCisgIGZvciAo eSA9IDA7IHkgPCBpbWctPmhlaWdodDsgKyt5KQorICAgIGZvciAoeCA9IDA7IHggPCBpbWctPndp ZHRoOyArK3gpCisgICAgICBYUHV0UGl4ZWwgKG1hc2tfeGltZywgeCwgeSwgWEdldFBpeGVsIChz cmNfbWFza194aW1nLCB4LCB5KSk7CisKKyAgaW1hZ2VfdW5nZXRfeF9pbWFnZSAobWFzaywgMSwg c3JjX21hc2tfeGltZyk7CisKKyAgLyogRmlsbCBpbiB0aGUgYmFja2dyb3VuZF90cmFuc3BhcmVu dCBmaWVsZCB3aGlsZSB3ZSBoYXZlIHRoZSBtYXNrIGhhbmR5LiAqLworICBpbWFnZV9iYWNrZ3Jv dW5kX3RyYW5zcGFyZW50IChpbWcsIGYsIG1hc2tfeGltZyk7CisKKyAgLyogRmluYWxseSBwdXQg bWFza194aW1nIGludG8gdGhlIGltYWdlLiAgKi8KKyAgaW1hZ2VfcHV0X3hfaW1hZ2UgKGYsIGlt ZywgbWFza194aW1nLCAxKTsKK30KKwogDAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAJCSAgICAgICBQQk0g KG1vbm8sIGdyYXksIGNvbG9yKQo= --000000000000c7f8fb0570fbf6b1--