Skip to content

Commit

Permalink
MMVII: Rasterization of text string into cIm2D<tU_INT1> (without mm3d)
Browse files Browse the repository at this point in the history
  • Loading branch information
meynardc committed Nov 15, 2024
1 parent 2f05f7b commit d44f845
Show file tree
Hide file tree
Showing 2 changed files with 1,581 additions and 30 deletions.
32 changes: 2 additions & 30 deletions MMVII/src/ImagesBase/FileImages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#include <gdal_priv.h>

#include "MMVII_Sys.h" //FIXME CM: Used by Convert_JPG. Delete when Convert_JPG refactored
//#ifdef MMVII_KEEP_MMV1_IMAGE //FIXME CM: Used by code at end of this file. Remove comment when refactored
#ifdef MMVII_KEEP_MMV1_IMAGE
# include "V1VII.h"
//#endif
#endif

using namespace MMVII;

Expand Down Expand Up @@ -842,34 +842,6 @@ double DifAbsInVal(const std::string & aN1,const std::string & aN2,double aDef)
}


// FIXME CM: rewrite ImageOfString_10x8, ImageOfString_DCT from MMV1
template <const int aNbBit> cIm2D<tU_INT1> BitsV1ToV2(const Im2D_Bits<aNbBit> & aImV1)
{
cIm2D<tU_INT1> aImV2(ToMMVII(aImV1.sz()));
cDataIm2D<tU_INT1>& aDImV2 = aImV2.DIm();

for (const auto & aPixV2 : aDImV2)
{
aDImV2.SetV(aPixV2,aImV1.GetI(ToMMV1(aPixV2)));
}


return aImV2;
}


cIm2D<tU_INT1> ImageOfString_10x8(const std::string & aStr ,int aSpace)
{
Im2D_Bits<1> aImV1 = cElBitmFont::BasicFont_10x8().BasicImageString(aStr,aSpace);
return BitsV1ToV2(aImV1);
}

cIm2D<tU_INT1> ImageOfString_DCT(const std::string & aStr ,int aSpace)
{
Im2D_Bits<1> aImV1 = cElBitmFont::FontCodedTarget().BasicImageString(aStr,aSpace);
return BitsV1ToV2(aImV1);
}


// FIXME CM: Rewrite Convert_JPG with special API from cDataFileIm2D / CDataIm2D.toFile()
void Convert_JPG(const std::string & aNameIm,bool DeleteAfter,tREAL8 aQuality,const std::string & aPost)
Expand Down
Loading

0 comments on commit d44f845

Please sign in to comment.