Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
dtschump committed Sep 15, 2023
2 parents b075947 + 5bf68d7 commit 126590b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
35 changes: 18 additions & 17 deletions CImg.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

// Set version number of the library.
#ifndef cimg_version
#define cimg_version 330
#define cimg_version 331

/*-----------------------------------------------------------
#
Expand Down Expand Up @@ -50715,23 +50715,24 @@ namespace cimg_library {
x+=lw;
} break;
default : if (ch<font._width) {
CImg<T> letter = font[ch];
if (letter) {
if (font[ch]) {
CImg<T> letter = font[ch];
const CImg<t> &mask = ch + 256U<font._width?font[ch + 256]:empty;
const int posx = x + left_paddings[i] + padding_x;
if (is_native_font && _spectrum>letter._spectrum)
letter.assign(letter.get_resize(-100,-100,1,_spectrum,0,2),false);
const unsigned int cmin = std::min(_spectrum,letter._spectrum);
if (foreground_color)
for (unsigned int c = 0; c<cmin; ++c)
if (foreground_color[c]!=255) letter.get_shared_channel(c)*=foreground_color[c]/255.0f;
if (mask) { // Letter has mask
if (background_color)
for (unsigned int c = 0; c<cmin; ++c)
draw_rectangle(x,y,0,c,posx + letter._width - 1,y + letter._height - 1,0,c,
background_color[c],opacity);
draw_image(posx,y,letter,font[ch + 256],opacity,255.f);
} else draw_image(posx,y,letter,opacity); // Letter has no mask

for (unsigned int c = 0; c<_spectrum; c+=letter._spectrum) {
const unsigned int cmin = std::min(_spectrum - c,letter._spectrum);
if (foreground_color[c]!=255)
for (unsigned int d = 0; d<cmin; ++d) letter.get_shared_channel(d)*=foreground_color[c + d]/255.0f;
if (mask) { // Letter with alpha
if (background_color)
for (unsigned int d = 0; d<cmin; ++d)
draw_rectangle(x,y,0,c + d,posx + letter._width - 1,y + letter._height - 1,0,c + d,
background_color[c + d],opacity);
draw_image(posx,y,0,c,letter,mask,opacity,255.f);
} else // Letter without alpha
draw_image(posx,y,0,c,letter,opacity);
}
x = posx + letter._width;
}
}
Expand Down Expand Up @@ -66232,7 +66233,7 @@ namespace cimg_library {
if (' ' + 256<font.size()) font[' ' + 256].resize(font[(int)'f']._width,-100,-100,-100,0);
}
font.insert(256,0);
cimglist_for_in(font,0,255,l) font[l].assign(font[l + 256]._width,font[l + 256]._height,1,3,255);
cimglist_for_in(font,0,255,l) font[l].assign(font[l + 256]._width,font[l + 256]._height,1,1,255);
}
cimg::mutex(11,0);
return font;
Expand Down
6 changes: 3 additions & 3 deletions html/download.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
</p>

<table class="table_content">
<tr><td><a href="http://cimg.eu/files/CImg_latest.zip">
<tr><td><a href="https://cimg.eu/files/CImg_latest.zip">
<img src="img/item_standard_package.jpg" alt="Standard Package"
onmouseover="this.src='img/item_standard_package2.jpg';"
onmouseout="this.src='img/item_standard_package.jpg';" /></a></td>
<td><hr/>
The <span class="gmd_cimg"></span> Library is mainly provided as
<a href="http://cimg.eu/files/CImg_latest.zip">
<a href="https://cimg.eu/files/CImg_latest.zip">
<i>.zip</i> package</a>
which is <b>platform-independent</b>.
It contains all the required files, as well as various examples (which must be compiled),
Expand All @@ -45,7 +45,7 @@
onmouseover="this.src='img/item_sources2.jpg';"
onmouseout="this.src='img/item_sources.jpg';" /></a></td>
<td><hr/>
You may be also more adventurous and try the current development version with <a href="http://git-scm.com/"><b>git</b></a>.
You may be also more adventurous and try the current development version with <a href="https://git-scm.com/"><b>git</b></a>.
This ensures you will get the latest code available, and will ease the
updates as well. To do this, just
type the command :
Expand Down

0 comments on commit 126590b

Please sign in to comment.