summaryrefslogtreecommitdiff
path: root/src/Fl_Shared_Image.cxx
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2020-07-01 18:03:10 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2020-07-06 20:28:20 +0200
commitf09e17c3c564e8310125a10c03397cbf473ff643 (patch)
tree8d0fd4a28e3686c33aaa140d07ddba26ab28bdc2 /src/Fl_Shared_Image.cxx
parentb0e0c355edaa2e23148cb0260ada907aec930f05 (diff)
Remove $Id$ tags, update URL's, and more
- remove obsolete svn '$Id$' tags from all source files - update .fl files and generated files accordingly - replace 'http://www.fltk.org' URL's with 'https://...' - replace bug report URL 'str.php' with 'bugs.php' - remove trailing whitespace - fix other whitespace errors flagged by Git - add and/or fix missing or wrong standard headers - convert tabs to spaces in all source files The only relevant code changes are in the fluid/ folder where some .fl files and other source files were used to generate the '$Id' headers and footers.
Diffstat (limited to 'src/Fl_Shared_Image.cxx')
-rw-r--r--src/Fl_Shared_Image.cxx85
1 files changed, 39 insertions, 46 deletions
diff --git a/src/Fl_Shared_Image.cxx b/src/Fl_Shared_Image.cxx
index e8cfb3fb9..4ea778d6a 100644
--- a/src/Fl_Shared_Image.cxx
+++ b/src/Fl_Shared_Image.cxx
@@ -1,6 +1,4 @@
//
-// "$Id$"
-//
// Shared image code for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2017 by Bill Spitzak and others.
@@ -9,11 +7,11 @@
// the file "COPYING" which should have been included with this file. If this
// file is missing or damaged, see the license at:
//
-// http://www.fltk.org/COPYING.php
+// https://www.fltk.org/COPYING.php
//
-// Please report all bugs and problems on the following page:
+// Please see the following page on how to report bugs and issues:
//
-// http://www.fltk.org/str.php
+// https://www.fltk.org/bugs.php
//
#include <stdio.h>
@@ -32,13 +30,13 @@
// Global class vars...
//
-Fl_Shared_Image **Fl_Shared_Image::images_ = 0; // Shared images
-int Fl_Shared_Image::num_images_ = 0; // Number of shared images
-int Fl_Shared_Image::alloc_images_ = 0; // Allocated shared images
+Fl_Shared_Image **Fl_Shared_Image::images_ = 0; // Shared images
+int Fl_Shared_Image::num_images_ = 0; // Number of shared images
+int Fl_Shared_Image::alloc_images_ = 0; // Allocated shared images
Fl_Shared_Handler *Fl_Shared_Image::handlers_ = 0;// Additional format handlers
-int Fl_Shared_Image::num_handlers_ = 0; // Number of format handlers
-int Fl_Shared_Image::alloc_handlers_ = 0; // Allocated format handlers
+int Fl_Shared_Image::num_handlers_ = 0; // Number of format handlers
+int Fl_Shared_Image::alloc_handlers_ = 0; // Allocated format handlers
//
@@ -91,15 +89,15 @@ int Fl_Shared_Image::num_images() {
same width and height. The second step will match if there is an image
marked \p original with the same name, regardless of width and height.
- \returns Whether the images match or their relative sort order (see text).
+ \returns Whether the images match or their relative sort order (see text).
- \retval 0 the images match
- \retval <0 Image \p i0 is \e less than image \p i1
- \retval >0 Image \p i0 is \e greater than image \p i1
+ \retval 0 the images match
+ \retval <0 Image \p i0 is \e less than image \p i1
+ \retval >0 Image \p i0 is \e greater than image \p i1
*/
int
-Fl_Shared_Image::compare(Fl_Shared_Image **i0, // I - First image
- Fl_Shared_Image **i1) { // I - Second image
+Fl_Shared_Image::compare(Fl_Shared_Image **i0, // I - First image
+ Fl_Shared_Image **i1) { // I - Second image
int i = strcmp((*i0)->name(), (*i1)->name());
if (i) return i;
@@ -133,8 +131,8 @@ Fl_Shared_Image::Fl_Shared_Image() : Fl_Image(0,0,0) {
The constructors are protected and cannot be used directly
from a program. Use the get() method instead.
*/
-Fl_Shared_Image::Fl_Shared_Image(const char *n, // I - Filename
- Fl_Image *img) // I - Image
+Fl_Shared_Image::Fl_Shared_Image(const char *n, // I - Filename
+ Fl_Image *img) // I - Image
: Fl_Image(0,0,0) {
name_ = new char[strlen(n) + 1];
strcpy((char *)name_, n);
@@ -159,7 +157,7 @@ Fl_Shared_Image::Fl_Shared_Image(const char *n, // I - Filename
*/
void
Fl_Shared_Image::add() {
- Fl_Shared_Image **temp; // New image pointer array...
+ Fl_Shared_Image **temp; // New image pointer array...
if (num_images_ >= alloc_images_) {
// Allocate more memory...
@@ -219,7 +217,7 @@ Fl_Shared_Image::~Fl_Shared_Image() {
so that no hole will occur.
*/
void Fl_Shared_Image::release() {
- int i; // Looping var...
+ int i; // Looping var...
refcount_ --;
if (refcount_ > 0) return;
@@ -250,10 +248,10 @@ void Fl_Shared_Image::release() {
/** Reloads the shared image from disk. */
void Fl_Shared_Image::reload() {
// Load image from disk...
- int i; // Looping var
- FILE *fp; // File pointer
- uchar header[64]; // Buffer for auto-detecting files
- Fl_Image *img; // New image
+ int i; // Looping var
+ FILE *fp; // File pointer
+ uchar header[64]; // Buffer for auto-detecting files
+ Fl_Image *img; // New image
if (!name_) return;
@@ -305,8 +303,8 @@ void Fl_Shared_Image::reload() {
Fl_Image *
Fl_Shared_Image::copy(int W, int H) {
- Fl_Image *temp_image; // New image file
- Fl_Shared_Image *temp_shared; // New shared image
+ Fl_Image *temp_image; // New image file
+ Fl_Shared_Image *temp_shared; // New shared image
// Make a copy of the image we're sharing...
if (!image_) temp_image = 0;
@@ -333,8 +331,8 @@ Fl_Shared_Image::copy(int W, int H) {
//
void
-Fl_Shared_Image::color_average(Fl_Color c, // I - Color to blend with
- float i) { // I - Blend fraction
+Fl_Shared_Image::color_average(Fl_Color c, // I - Color to blend with
+ float i) { // I - Blend fraction
if (!image_) return;
image_->color_average(c, i);
@@ -398,8 +396,8 @@ void Fl_Shared_Image::uncache()
when no longer needed.
*/
Fl_Shared_Image* Fl_Shared_Image::find(const char *name, int W, int H) {
- Fl_Shared_Image *key, // Image key
- **match; // Matching image
+ Fl_Shared_Image *key, // Image key
+ **match; // Matching image
if (num_images_) {
key = new Fl_Shared_Image();
@@ -441,10 +439,10 @@ Fl_Shared_Image* Fl_Shared_Image::find(const char *name, int W, int H) {
copy with width \p W and height \p H is also added to the list of
shared images.
- \note If the sizes differ, then \e two images are created as mentioned above.
- This is intentional so the original image is cached and preserved.
- If you request the same image with another size later, then the
- \b original image will be found, copied, resized, and returned.
+ \note If the sizes differ, then \e two images are created as mentioned above.
+ This is intentional so the original image is cached and preserved.
+ If you request the same image with another size later, then the
+ \b original image will be found, copied, resized, and returned.
Shared JPEG and PNG images can also be created from memory by using their
named memory access constructor.
@@ -460,7 +458,7 @@ Fl_Shared_Image* Fl_Shared_Image::find(const char *name, int W, int H) {
\see Fl_PNG_Image::Fl_PNG_Image (const char *name_png, const unsigned char *buffer, int maxsize)
*/
Fl_Shared_Image* Fl_Shared_Image::get(const char *name, int W, int H) {
- Fl_Shared_Image *temp; // Image
+ Fl_Shared_Image *temp; // Image
if ((temp = find(name, W, H)) != NULL) return temp;
@@ -485,9 +483,9 @@ Fl_Shared_Image* Fl_Shared_Image::get(const char *name, int W, int H) {
/** Builds a shared image from a pre-existing Fl_RGB_Image.
- \param[in] rgb an Fl_RGB_Image used to build a new shared image.
- \param[in] own_it 1 if the shared image should delete \p rgb when
- it is itself deleted, 0 otherwise
+ \param[in] rgb an Fl_RGB_Image used to build a new shared image.
+ \param[in] own_it 1 if the shared image should delete \p rgb when
+ it is itself deleted, 0 otherwise
\version 1.3.4
*/
@@ -504,8 +502,8 @@ Fl_Shared_Image *Fl_Shared_Image::get(Fl_RGB_Image *rgb, int own_it)
for adding new formats.
*/
void Fl_Shared_Image::add_handler(Fl_Shared_Handler f) {
- int i; // Looping var...
- Fl_Shared_Handler *temp; // New image handler array...
+ int i; // Looping var...
+ Fl_Shared_Handler *temp; // New image handler array...
// First see if we have already added the handler...
for (i = 0; i < num_handlers_; i ++) {
@@ -533,7 +531,7 @@ void Fl_Shared_Image::add_handler(Fl_Shared_Handler f) {
/** Removes a shared image handler. */
void Fl_Shared_Image::remove_handler(Fl_Shared_Handler f) {
- int i; // Looping var...
+ int i; // Looping var...
// First see if the handler has been added...
for (i = 0; i < num_handlers_; i ++) {
@@ -551,8 +549,3 @@ void Fl_Shared_Image::remove_handler(Fl_Shared_Handler f) {
(num_handlers_ - i) * sizeof(Fl_Shared_Handler ));
}
}
-
-
-//
-// End of "$Id$".
-//