Skip to content

Commit

Permalink
add a framework in support of an image cache, a work in-progress
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Mar 14, 2021
1 parent af1f009 commit ba2deb1
Show file tree
Hide file tree
Showing 8 changed files with 168 additions and 12 deletions.
1 change: 1 addition & 0 deletions MagickCore/MagickCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ extern "C" {
#include "MagickCore/histogram.h"
#include "MagickCore/identify.h"
#include "MagickCore/image.h"
#include "MagickCore/image-cache.h"
#include "MagickCore/image-view.h"
#include "MagickCore/layer.h"
#include "MagickCore/linked-list.h"
Expand Down
3 changes: 3 additions & 0 deletions MagickCore/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ MAGICKCORE_BASE_SRCS = \
MagickCore/image.c \
MagickCore/image.h \
MagickCore/image-private.h \
MagickCore/image-cache.c \
MagickCore/image-cache.h \
MagickCore/image-cache-private.h \
MagickCore/image-view.c \
MagickCore/image-view.h \
MagickCore/layer.c \
Expand Down
29 changes: 29 additions & 0 deletions MagickCore/image-cache-private.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
Copyright 1999-2021 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
obtain a copy of the License at
https://imagemagick.org/script/license.php
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
MagickCore image cache private methods.
*/
#ifndef MAGICKCORE_IMAGE_CACHE_PRIVATE_H
#define MAGICKCORE_IMAGE_CACHE_PRIVATE_H

#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif

#if defined(__cplusplus) || defined(c_plusplus)
}
#endif

#endif
73 changes: 73 additions & 0 deletions MagickCore/image-cache.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% IIIII M M AAA GGGG EEEEE %
% I MM MM A A G E %
% I M M M AAAAA G GG EEE %
% I M M A A G G E %
% IIIII M M A A GGGG EEEEE %
% %
% CCCC AAA CCCC H H EEEEE %
% C A A C H H E %
% C AAAAA C HHHHH EEE %
% C A A C H H E %
% CCCC A A CCCC H H EEEEE %
% %
% %
% MagickCore Image Cache Methods %
% %
% Software Design %
% Cristy %
% March 2021 %
% %
% %
% Copyright 1999-2021 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
% obtain a copy of the License at %
% %
% https://imagemagick.org/script/license.php %
% %
% Unless required by applicable law or agreed to in writing, software %
% distributed under the License is distributed on an "AS IS" BASIS, %
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
% See the License for the specific language governing permissions and %
% limitations under the License. %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The image cache stores and retrieves images from disk with a minimal of
% memory that can scale to billions of images. Once an image is retrieved
% from the cache, you can dynamically access any pixel, apply image
% processing operators, or convert the image to a blob in a specific image
% format suitable for display on a web page.
%
%
*/

/*
Include declarations.
*/
#include "MagickCore/studio.h"
#include "MagickCore/MagickCore.h"
#include "MagickCore/exception-private.h"
#include "MagickCore/memory-private.h"
#include "MagickCore/monitor-private.h"
#include "MagickCore/thread-private.h"

/*
Typedef declarations.
*/
struct _ImageCache
{
char
*path;

MagickBooleanType
debug;

size_t
signature;
};
29 changes: 29 additions & 0 deletions MagickCore/image-cache.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
Copyright 1999-2021 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
obtain a copy of the License at
https://imagemagick.org/script/license.php
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
MagickCore image cache methods.
*/
#ifndef MAGICKCORE_IMAGE_CACHE_H
#define MAGICKCORE_IMAGE_CACHE_H

#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif

#if defined(__cplusplus) || defined(c_plusplus)
}
#endif

#endif
37 changes: 28 additions & 9 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -458,15 +458,16 @@ am__MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_SOURC
MagickCore/geometry.h MagickCore/histogram.c \
MagickCore/histogram.h MagickCore/identify.c \
MagickCore/identify.h MagickCore/image.c MagickCore/image.h \
MagickCore/image-private.h MagickCore/image-view.c \
MagickCore/image-view.h MagickCore/layer.c MagickCore/layer.h \
MagickCore/linked-list.c MagickCore/linked-list.h \
MagickCore/list.c MagickCore/list.h MagickCore/locale.c \
MagickCore/locale_.h MagickCore/log.c MagickCore/log.h \
MagickCore/magic.c MagickCore/magic.h MagickCore/magick.c \
MagickCore/magick-baseconfig.h MagickCore/magick-config.h \
MagickCore/magick-type.h MagickCore/magick.h \
MagickCore/matrix.c MagickCore/matrix.h \
MagickCore/image-private.h MagickCore/image-cache.c \
MagickCore/image-cache.h MagickCore/image-cache-private.h \
MagickCore/image-view.c MagickCore/image-view.h \
MagickCore/layer.c MagickCore/layer.h MagickCore/linked-list.c \
MagickCore/linked-list.h MagickCore/list.c MagickCore/list.h \
MagickCore/locale.c MagickCore/locale_.h MagickCore/log.c \
MagickCore/log.h MagickCore/magic.c MagickCore/magic.h \
MagickCore/magick.c MagickCore/magick-baseconfig.h \
MagickCore/magick-config.h MagickCore/magick-type.h \
MagickCore/magick.h MagickCore/matrix.c MagickCore/matrix.h \
MagickCore/matrix-private.h MagickCore/memory.c \
MagickCore/memory_.h MagickCore/memory-private.h \
MagickCore/method-attribute.h MagickCore/methods.h \
Expand Down Expand Up @@ -635,6 +636,7 @@ am__objects_1 = MagickCore/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFF
MagickCore/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-histogram.lo \
MagickCore/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-identify.lo \
MagickCore/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image.lo \
MagickCore/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-cache.lo \
MagickCore/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-view.lo \
MagickCore/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-layer.lo \
MagickCore/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-linked-list.lo \
Expand Down Expand Up @@ -2199,6 +2201,7 @@ am__depfiles_remade = Magick++/demo/$(DEPDIR)/analyze-analyze.Po \
MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-geometry.Plo \
MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-histogram.Plo \
MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-identify.Plo \
MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-cache.Plo \
MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-view.Plo \
MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image.Plo \
MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-layer.Plo \
Expand Down Expand Up @@ -5207,6 +5210,9 @@ MAGICKCORE_BASE_SRCS = \
MagickCore/image.c \
MagickCore/image.h \
MagickCore/image-private.h \
MagickCore/image-cache.c \
MagickCore/image-cache.h \
MagickCore/image-cache-private.h \
MagickCore/image-view.c \
MagickCore/image-view.h \
MagickCore/layer.c \
Expand Down Expand Up @@ -6620,6 +6626,9 @@ MagickCore/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-identify.
MagickCore/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image.lo: \
MagickCore/$(am__dirstamp) \
MagickCore/$(DEPDIR)/$(am__dirstamp)
MagickCore/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-cache.lo: \
MagickCore/$(am__dirstamp) \
MagickCore/$(DEPDIR)/$(am__dirstamp)
MagickCore/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-view.lo: \
MagickCore/$(am__dirstamp) \
MagickCore/$(DEPDIR)/$(am__dirstamp)
Expand Down Expand Up @@ -8176,6 +8185,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-geometry.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-histogram.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-identify.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-cache.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-view.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-layer.Plo@am__quote@ # am--include-marker
Expand Down Expand Up @@ -8834,6 +8844,13 @@ MagickCore/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image.lo:
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o MagickCore/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image.lo `test -f 'MagickCore/image.c' || echo '$(srcdir)/'`MagickCore/image.c

MagickCore/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-cache.lo: MagickCore/image-cache.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT MagickCore/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-cache.lo -MD -MP -MF MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-cache.Tpo -c -o MagickCore/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-cache.lo `test -f 'MagickCore/image-cache.c' || echo '$(srcdir)/'`MagickCore/image-cache.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-cache.Tpo MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-cache.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='MagickCore/image-cache.c' object='MagickCore/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-cache.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o MagickCore/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-cache.lo `test -f 'MagickCore/image-cache.c' || echo '$(srcdir)/'`MagickCore/image-cache.c

MagickCore/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-view.lo: MagickCore/image-view.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT MagickCore/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-view.lo -MD -MP -MF MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-view.Tpo -c -o MagickCore/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-view.lo `test -f 'MagickCore/image-view.c' || echo '$(srcdir)/'`MagickCore/image-view.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-view.Tpo MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-view.Plo
Expand Down Expand Up @@ -12681,6 +12698,7 @@ distclean: distclean-am
-rm -f MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-geometry.Plo
-rm -f MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-histogram.Plo
-rm -f MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-identify.Plo
-rm -f MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-cache.Plo
-rm -f MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-view.Plo
-rm -f MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image.Plo
-rm -f MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-layer.Plo
Expand Down Expand Up @@ -13175,6 +13193,7 @@ maintainer-clean: maintainer-clean-am
-rm -f MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-geometry.Plo
-rm -f MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-histogram.Plo
-rm -f MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-identify.Plo
-rm -f MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-cache.Plo
-rm -f MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image-view.Plo
-rm -f MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-image.Plo
-rm -f MagickCore/$(DEPDIR)/libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-layer.Plo
Expand Down
4 changes: 2 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -4552,7 +4552,7 @@ MAGICK_PATCHLEVEL_VERSION=4

MAGICK_VERSION=7.0.11-4

MAGICK_GIT_REVISION=18523:904cee2ec:20210307
MAGICK_GIT_REVISION=18533:4b2f8265c:20210314


# Substitute library versioning
Expand Down Expand Up @@ -4582,7 +4582,7 @@ PACKAGE_LIB_VERSION=0x70B

PACKAGE_LIB_VERSION_NUMBER=7,0,11,4

PACKAGE_RELEASE_DATE=2021-03-06
PACKAGE_RELEASE_DATE=2021-03-13


# Ensure that make can run correctly
Expand Down
4 changes: 3 additions & 1 deletion utilities/montage.1
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ Image Settings:
\-display server query font from this X server
\-dispose method layer disposal method
\-dither method apply error diffusion to image
\-draw string annotate the image with a graphic primitive
\-encoding type text encoding type
\-endian type endianness (MSB or LSB) of the image
\-extract geometry extract area from image
Expand Down Expand Up @@ -98,6 +97,9 @@ Image Operators:
\-border geometry surround image with a border of color
\-channel mask set the image channel mask
\-crop geometry preferred size and location of the cropped image
\-distort method args
distort images according to given method and args
\-draw string annotate the image with a graphic primitive
\-extent geometry set the image size
\-flatten flatten a sequence of images
\-flip flip image in the vertical direction
Expand Down

0 comments on commit ba2deb1

Please sign in to comment.